查看无需任何代码即可在触摸时自行关闭

时间:2015-04-26 03:59:07

标签: ios

我有一系列视图控制器,它们由“Back”和“Next”UIBarButtonItems *导航。我遇到的问题是当视图被触摸到视图的上半部分的任何地方而视图控制器没有任何代码时会被忽略。

什么都没有调用 [self dismissViewControllerAnimated:YES completion:nil]; 我没有注意到这种行为,直到我更新到xcode 6.3.1之后我甚至想不出一种方法来捕获NSLog的事件。

我已经评论了所有内容,但是当我触摸时,视图仍然会被忽略 它。我从来没有像这样难过。 任何建议

- (void)viewDidLoad {
    [super viewDidLoad];
  //  UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(actNext:)];
  //  swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft;
  //  [self.view addGestureRecognizer:swipeLeft];

 //   UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(actBack:)];
 //   swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
 //  [self.view addGestureRecognizer:swipeRight];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(IBAction)actNext:(id)sender
{
    //PageThree *p3 = [[PageThree alloc] initWithNibName:@"PageThree" bundle:nil];
    //[p3 setModalTransitionStyle:UIModalTransitionStylePartialCurl];
    //[self presentViewController:p3 animated:YES completion:nil];
}


-(IBAction)actBack:(id)sender
{

    NSLog (@"Dismiss Invoked");
   // [self dismissViewControllerAnimated:YES completion:nil];
}

@end

0 个答案:

没有答案