Created
January 10, 2016 14:34
-
-
Save viccc/86664ff069aad1cc9bde to your computer and use it in GitHub Desktop.
Shake to execute some code for debugging. To be inserted into view controller.
This file contains hidden or 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
override func viewDidAppear(animated: Bool) { | |
super.viewDidAppear(animated) | |
#if DEBUG | |
// Shake to debug | |
becomeFirstResponder() | |
#endif | |
// ... | |
} | |
#if DEBUG | |
private func shakeToDebug() { | |
// ... | |
} | |
override func canBecomeFirstResponder() -> Bool { | |
// Shake to debug | |
return true | |
} | |
override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) { | |
// Shake to debug | |
shakeToDebug() | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment