SelectorViewController

SelectorViewController

viewDidAppear segue退出时,是否知道如何解决UIModalTransitionStylePartialCurl没有被击中的问题?

- (IBAction)buttonSelector:(id)sender
{

    // creating object for title screen
    UIStoryboard *storySelection =[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

    // creating object for profile view
    selectorViewController = [storySelection instantiateViewControllerWithIdentifier:@"Verse Selector"];

    // setting the transition style
    selectorViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;

    // performing the segue
    [self presentViewController:selectorViewController animated:YES completion:nil];
}

-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    // testing for a return from segue
    if (selectorViewController != nil)
    {
        // getting the chosen values from the instance
        chosenBook = selectorViewController.chosenBook;

        // setting instance to nil for garbage collection
        selectorViewController = nil;
    }
}

最佳答案

编辑

看起来最好的方法是实现自定义委托协议,该协议将通知呈现视图控制器已关闭的呈现视图控制器。

关于iphone - 从UIModalTransitionStylePartialCurl segue退出时,是否知道如何避免未触发viewDidAppear?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15057093/

10-11 14:43