Last active
November 23, 2018 08:27
-
-
Save muhlenXi/bf2ecd7af60b7768ed99e5d09ae4e971 to your computer and use it in GitHub Desktop.
Get AppDelegate
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
extension AppDelegate { | |
/// 获取 App delegate | |
static func mainDelegate() -> AppDelegate? { | |
if let delegate = UIApplication.shared.delegate as? AppDelegate { | |
return delegate | |
} | |
return nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment