Skip to content

Instantly share code, notes, and snippets.

@larryluoo
Created July 8, 2022 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larryluoo/3622153a841174ff89f027f039dda698 to your computer and use it in GitHub Desktop.
Save larryluoo/3622153a841174ff89f027f039dda698 to your computer and use it in GitHub Desktop.
unwindForNewCall
@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