Created
February 19, 2018 17:01
-
-
Save simrandotdev/17c958524b16b19affdbd28d40f4dd01 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 viewWillTransition(to size: CGSize, | |
with coordinator: UIViewControllerTransitionCoordinator) { | |
if UIDevice.current.orientation.isLandscape { | |
print("Landscape") | |
chatButton.removeTarget(self, action: #selector(handleChatButtonClick), for: .touchUpInside) | |
} else { | |
print("Portrait") | |
chatButton.addTarget(self, action: #selector(handleChatButtonClick), for: .touchUpInside) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment