Created
July 8, 2022 09:40
-
-
Save larryluoo/3622153a841174ff89f027f039dda698 to your computer and use it in GitHub Desktop.
unwindForNewCall
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
@IBAction private func unwindForNewCall(_ segue: UIStoryboardSegue) { | |
// 1. | |
let newCallController = segue.source as! NewCallViewController | |
guard let handle = newCallController.handle else { return } | |
let videoEnabled = newCallController.videoEnabled | |
// 2. | |
let backgroundTaskIdentifier = UIApplication.shared.beginBackgroundTask(expirationHandler: nil) | |
DispatchQueue.main.asyncAfter(wallDeadline: DispatchWallTime.now() + 1.5) { | |
AppDelegate.shared.displayIncomingCall(uuid: UUID(), handle: handle, hasVideo: videoEnabled) { _ in | |
UIApplication.shared.endBackgroundTask(backgroundTaskIdentifier) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment