Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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
You can’t perform that action at this time.