Search code examples
iosxcodeios6deprecated

dimissViewControllerAnimated completion: nil?


I'm trying to update my app for iOS 6 and above. I'm removing the code that has been deprecated, namely dimissModalViewControllerAnimated. How come Xcode does not recognize dimissViewControllerAnimated as a method unless I put a "completion: nil" after it like this:

[self dimissViewControllerAnimated: YES completion nil];

What does that last part even mean? When I put nil, is that opposed to putting something else?


Solution

  • Well the API was changed to this call. The last argument takes a completion block which is executed after the dismiss animation finsihed.

    When you pass nil it will execute nothing because nothing is there.