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