Swift 4 and tweaks to example projects

This commit is contained in:
Matt Coneybeare
2017-09-14 20:40:16 -04:00
parent 87d68ec2a7
commit dfb230dcd2
8 changed files with 128 additions and 83 deletions

View File

@@ -28,12 +28,13 @@
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
AppDelegate.setupArmchair()
return true
}
}
let Pages = "361309726" // Pages iOS
let appID = "361309726" // Pages iOS
#elseif os(OSX)
@@ -43,9 +44,12 @@
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
override init() {
AppDelegate.setupArmchair()
}
}
let Pages = "409201541" // Pages Mac
let appID = "409201541" // Pages Mac
#else
#endif
@@ -54,10 +58,6 @@ import Armchair
extension AppDelegate {
override class func initialize() {
AppDelegate.setupArmchair()
}
class func setupArmchair() {
// Normally, all the setup would be here.
// But, because we are presenting a few different setups in the example,
@@ -68,7 +68,7 @@ extension AppDelegate {
// because it needs to receive application life-cycle notifications
//
// NOTE: The appID call always has to go before any other Armchair calls
Armchair.appID(Pages)
Armchair.appID(appID)
Armchair.debugEnabled(true)
}
}