I have followed the following tutorial to implement CallKit within my app:
https://www.raywenderlich.com/150015/callkit-tutorial-ios
But I would like to go further, and display my own ViewController while the call is active. I am doing a videocall service so I would like to have my own interface.
Is that possible at all? I have been trying to launch the ViewController from the method provider(CXProvider:CXAnswerCallAction)
which is the one called when the user answers the call, but it seems to crash every time. I am trying to instantiate it with this (Swift 3):
let vc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "VideoCallViewController") as! VideoCallViewController
UIApplication.shared.keyWindow?.rootViewController?.present(vc, animated: true, completion: nil)
It crashes on the second line without explanation. It shows lldb
, I have tried to get the backtrace by entering bt
but it doesn't return anything.