Created
February 12, 2019 13:06
-
-
Save natanrolnik/96f28038cd67ec740584c6446a498f41 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
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