How to make phone call in iOS 10 using Swift? [duplicate]

You can call like this:

 if let url = URL(string: "tel://\(number)") {
     UIApplication.shared.openURL(url)
 }

For Swift 3+, you can use like

guard let number = URL(string: "tel://" + number) else { return }
UIApplication.shared.open(number)

OR

UIApplication.shared.open(number, options: [:], completionHandler: nil)

Make sure you’ve scrubbed your phone number string to remove any instances of (, ), -, or space.

Leave a Comment