Last active
January 23, 2017 21:03
-
-
Save Wooder/925a024e18d1a0842efd09847e79741c 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
import UIKit | |
extension UIApplication { | |
static var applicationName: String { | |
let mainBundle = NSBundle.mainBundle() | |
let key = String(kCFBundleNameKey) | |
let value = mainBundle.objectForInfoDictionaryKey(key) as? String | |
return value ?? "" | |
} | |
static var bundleId: String { | |
return Bundle.main.bundleIdentifier | |
} | |
class func mainWindow() -> UIWindow?{ | |
if let appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate { | |
return appDelegate.window | |
} | |
return nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment