Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmytro-anokhin/ae3f444153dbe71fca3c8eb02d06ac81 to your computer and use it in GitHub Desktop.
Save dmytro-anokhin/ae3f444153dbe71fca3c8eb02d06ac81 to your computer and use it in GitHub Desktop.
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