Skip to content

Instantly share code, notes, and snippets.

@nbhasin2
Created January 21, 2016 18:56
Show Gist options
  • Select an option

  • Save nbhasin2/0e8af7212f5c596efc8a to your computer and use it in GitHub Desktop.

Select an option

Save nbhasin2/0e8af7212f5c596efc8a to your computer and use it in GitHub Desktop.
Orientation.swift
override func didRotateFromInterfaceOrientation(fromInterfaceOrientation: UIInterfaceOrientation) {
var text=""
switch UIDevice.currentDevice().orientation{
case .Portrait:
self.delegate?.reloadButtons!()
case .PortraitUpsideDown:
text="PortraitUpsideDown"
case .LandscapeLeft:
text="LandscapeLeft"
case .LandscapeRight:
text="LandscapeRight"
default:
text="Another"
}
NSLog("You have moved: \(text)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment