This file contains hidden or 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
//: Permutations | |
// based on https://www.objc.io/blog/2014/12/08/functional-snippet-10-permutations/ | |
// but updated for Swift 2.0 (Xcode 7.0) | |
extension Array { | |
func decompose() -> (Generator.Element, [Generator.Element])? { | |
guard let x = first else { return nil } | |
return (x, Array(self[1..<count])) | |
} | |
} |
This file contains hidden or 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
// UIApplication.h | |
UIApplicationDidEnterBackgroundNotification __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0); | |
UIApplicationWillEnterForegroundNotification __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0); | |
UIApplicationDidFinishLaunchingNotification; | |
UIApplicationDidBecomeActiveNotification; | |
UIApplicationWillResignActiveNotification; | |
UIApplicationDidReceiveMemoryWarningNotification; | |
UIApplicationWillTerminateNotification; | |
UIApplicationSignificantTimeChangeNotification; | |
UIApplicationWillChangeStatusBarOrientationNotification; // userInfo contains NSNumber with new orientation |