I have an iOS application that programmatically lets the user make a phone call.
I would like to display a popup asking a question when the user's phone call has finished (and the user is automatically taken back to the app they made the phone call from).
What is a recommended way to do this in swift?
Here is the current code:
@IBAction func makePhoneCall(_ sender: UIButton) {
let phone = getPhone().filter(characterOkay)
if let url = URL(string: "tel://\(phone)"), UIApplication.shared.canOpenURL(url) {
if #available(iOS 10, *) {
UIApplication.shared.open(url)
} else {
UIApplication.shared.openURL(url)
}
}
// This incorrectly shows the popup before the phone call.
showQuestionPrompt();
}