Created
March 23, 2018 12:01
-
-
Save Stickerbox/9fbadd1e2e89187cdfb7c9ccdc0b6d24 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
extension UIWindow { | |
open override func motionEnded(_ motion: UIEventSubtype, with event: UIEvent?) { | |
super.motionEnded(motion, with: event) | |
guard motion == .motionShake else { return } | |
let version = Bundle.main.versionNumber ?? "" | |
let build = Bundle.main.buildNumber ?? "" | |
Logger.present(onto: rootViewController, version: version, build: build) | |
} | |
} | |
extension Bundle { | |
var versionNumber: String? { | |
return infoDictionary?["CFBundleShortVersionString"] as? String | |
} | |
var buildNumber: String? { | |
return infoDictionary?["CFBundleVersion"] as? String | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment