Created
February 12, 2019 13:06
-
-
Save natanrolnik/6dbeaaef228253824457910a2f335831 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
//keep a variable to know if the user tapped the button: | |
var micButtonTapped = false | |
func recordVoiceMessage() { | |
//if the user tapped/held the mic button, set the variable to true | |
micButtonTapped = true | |
} | |
//in your viewDidAppear method, schedule it: | |
DispatchQueue.main.asyncAfter(.now() + 3) { [weak self] in | |
//make sure the mic button wasn't used yet | |
guard self?.micButtonTapped == true else { | |
return | |
} | |
self?.micButton.jump() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment