0

いくつかの要素を表示する必要がありUITableViewます。各セルをクリックすると、detailViewController が表示されます。あるdetailViewControllerから次のdetailViewControllerに渡しUISwipeGestureRecognizerて左に渡しUISwipeGestureRecognizer、右にするとtableViewに戻ります。

ありがとうございました

4

1 に答える 1

0

ビューまたはテーブルビューにスワイプ認識機能を追加します

UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(goToNextView)];

    [swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
    [self.view addGestureRecognizer:swipeLeft]; //Add to the view or tableview or whatever

メソッドを追加する

- (void)goToNextView
{
     YourViewController *vc =
     [self.storyboard instantiateViewControllerWithIdentifier:@"yourViewControllerIdendifier"];
     [self.navigationController pushViewController:vc animated:YES];
}

戻るには同じことを行いますが、プッシュを使用する代わりに、ポップを使用します

于 2013-07-08T22:22:06.120 に答える