Closing a view displayed via a modal segue

后端 未结 4 901
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 02:28

I\'m manually invoking a segue (set as modal) in order to display a login form in Xcode 4.2 using Storyboards with the following line of code:

[self performSegue         


        
相关标签:
4条回答
  • 2021-01-30 02:35

    The following should work fine...

    [self dismissModalViewControllerAnimated:YES];
    

    I do exactly this with a login page in my latest tutorial here, with no issues.

    0 讨论(0)
  • 2021-01-30 02:46

    If your deployment target is iOS 5.0 or later, use this message:

    [self dismissViewControllerAnimated:YES completion:nil];
    

    Or in Swift:

    self.dismissViewControllerAnimated(true, completion: nil)
    

    If your deployment target is older, use this (deprecated) message:

    [self dismissModalViewControllerAnimated:YES];
    
    0 讨论(0)
  • 2021-01-30 02:51

    [self dismissViewControllerAnimated:YES completion:nil]; is a new way in IOS5

    0 讨论(0)
  • 2021-01-30 02:52

    The following code works in swift 3:

     self.dismiss(animated: true, completion: nil)
    
    0 讨论(0)
提交回复
热议问题