How to make a Phone Call in SwiftUI. Here is the sample code with Swift and UIKit:
guard let number = URL(string: "tel://" + "+1(222)333-44-55") else { return }
UIApplication.shared.open(number)
Here is the thread for Swift and the UIKit Version:
How to make phone call in iOS 10 using Swift?
let numberString = "111-222-3334"
Button(action: {
let telephone = "tel://"
let formattedString = telephone + numberString
guard let url = URL(string: formattedString) else { return }
UIApplication.shared.open(url)
}) {
Text(numberString)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With