Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var micHintWorkItem: DispatchWorkItem?
func recordVoiceMessage() {
micHintWorkItem?.cancel()
}
//in your viewDidAppear method, create and schedule the work item:
micHintWorkItem = DispatchWorkItem { [weak self] in
self?.micButton.jump()
}
//we just created the work item, it is safe to force unwrap in this situation
DispatchQueue.main.asyncAfter(.now() + 3, execute: micHintWorkItem!)
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.