2016-04-21 129 views

回答

0
//use swipe gesture recognizer 

    UISwipeGestureRecognizer *gestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeHandler:)]; 
    [gestureRecognizer setDirection:(UISwipeGestureRecognizerDirectionRight)]; 
    [self.view addGestureRecognizer:gestureRecognizer]; 


-(void)swipeHandler:(UISwipeGestureRecognizer *)recognizer { 
NSLog(@"Swipe received."); 
} 
+0

是的,但我怎麼能推視圖控制器?如果我以正常的方式推動它開始ios動畫打開視圖,我失去了拖動! –