Skip to content

Instantly share code, notes, and snippets.

Created March 23, 2018 12:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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