Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save billypchan/dc9f76a00a298cb5e0d6cd522f68a71b to your computer and use it in GitHub Desktop.
Save billypchan/dc9f76a00a298cb5e0d6cd522f68a71b to your computer and use it in GitHub Desktop.
For printing UIInterfaceOrientation in Swift
extension UIInterfaceOrientation : CustomStringConvertible {
public var description: String {
switch self {
case .unknown: return "unknown"
case .portrait: return "portrait"
case .portraitUpsideDown: return "portraitUpsideDown"
case .landscapeLeft: return "landscapeLeft"
case .landscapeRight: return "landscapeRight"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment