I have Button1 outside ScrollView and another Button2 inside scrollview. I use a storyboard. I used drag and drop from both buttons to another view. Button1 works fine, the problem is with Button2, it doesn't work no matter how many times I click, it only works when I click and drag (weird !!). When I was troubleshooting, I found that whenever I create an output from scrollview, it behaves this way, if I remove the scroll connection from the outlet, it works fine, but I need the outlet for scrollview to work. Any decision on how I can do this? This is sample code of my view, booted if it helps
- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]]; self.scrollView.contentSize =CGSizeMake(320, 500); UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(resignKeyboard)]; [self.scrollView addGestureRecognizer:singleTap]; singleTap.numberOfTapsRequired = 1; } -(void) resignKeyboard { [self.view endEditing:YES]; }
This is how I determined the way out
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
Note that Button2 Click works, but it doesnβt click and drag / project on one or more clicks.
EDIT: I checked and found that it works fine for 6.1 simulator, but not 5.0
source share