- StoryboardでUIViewController(A)を選択状態にする。
- メニューから Editor -> Embed In -> Navigation Controller を実行する。
UINavigationContoller下で、UIViewController(A)からUIViewController(B)に画面遷移する。
(A)にnextボタン、(b)にcancelボタンをつけて、nextボタンタップで(B)を表示し、cancelボタンタップで(A)に戻るようにする。
- (A)のnextボタンタップで(B)を表示
- StoryboardでUIViewController(B)を作成する。
- (A)にnextボタン、(B)にcancelボタンをつける。
- Controlキーを押しながらUIViewController(A)のnextボタンからUIViewController(B)にドラッグ&ドロップする。
- Action Segue で push/modal/custom からpushを選択する。
- (B)のcancelボタンタップで(A)に戻る。
- Storyboardで(B)にcancelボタンをつける。
- Controlキーを押しながらUIViewController(B)のcloseボタンから.hファイルにドラッグ&ドロップしてActionをつける。(Name:didTapCancel, Type:id, Event:Touch Up Inside, Arguments:Sender)
- .mファイルのdidTapCancelで popViewControllerAnimated をコールする。
- (IBAction)didTapCancel:(id)sender { [self.navigationController popViewControllerAnimated:YES]; }
0 件のコメント:
コメントを投稿