Using storyboards, what is the proper way to dismiss a modal?
According Alex Cio answer for Swift 3
and XCode 8.3
:
Create class:
import UIKit
class DismissSegue: UIStoryboardSegue {
override func perform() {
self.source.presentingViewController?.dismiss(animated: true, completion: nil)
}
}
But in storyboard you should choose:
Action Segue -> Custom -> dismiss
Only after this option appear on Action Segue
menu