Created
October 8, 2017 10:57
-
-
Save dmytro-anokhin/ae3f444153dbe71fca3c8eb02d06ac81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) { | |
super.willTransition(to: newCollection, with: coordinator) | |
coordinator.animate(alongsideTransition: nil) { _ in | |
switch displayMode { | |
case .sideBySide: | |
navigationItem.rightBarButtonItem = nil | |
break | |
case .one: | |
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Flip", style: .plain, target: self, action: #selector(flipAction)) | |
break | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment