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
| // Swift 3 | |
| // If you'd like to use the gestureDuration outside of the scope of the button press, create some variables. | |
| var gestureStartTime: TimeInterval! | |
| var gestureDuration: TimeInterval! | |
| // IBAction for UILongPressGestureRecognizer | |
| @IBAction func recordButtonHeld(_ sender: UILongPressGestureRecognizer) { | |
| switch sender.state { |
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
| // Swift 3 | |
| // Simple object example | |
| class Phone { | |
| let name: String | |
| let serialNumber: Int | |
| init(name: String, serialNumber: Int) { | |
| self.name = name |
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
| class Player { | |
| let name: String | |
| let highScore: Int | |
| init(name: String, highScore: Int) { | |
| self.name = name | |
| self.highScore = highScore | |
| } | |
| } |
OlderNewer