I have a Button1 outside ScrollView and another Button2 inside scrollview. I am using storyboard. I have used drag drop segue from both buttons to a different view. Button1 works fine, the problem is with Button2, it doesnt work no matter how many times I click, it only works when I click and drag (strange!!). When I troubleshooted I found that whenever I create an outlet of scrollview it behaves this way, if I remove the connection of scrollview to the outlet it works fine, but I need the outlet for the scrollview to work. Any solution on how I can get this done? This is a sample code of my view did load 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 defined the outlet
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
Note that Button2 Click does work but on click and drag/swipe not on single or multiple clicks.
EDIT:I checked and found that it works fine for simulator 6.1 but not for 5.0