call phone number in swift code example
Example: swift 5 make a phone call
if let url = URL(string: "tel://\(phoneNumberTextfield.text!)"),
UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
if let url = URL(string: "tel://\(phoneNumberTextfield.text!)"),
UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)