Call action implementation iOS swift || Call implementation || phone number call iOS swift || Phone call implementation when click the number iOS swift
Problem:
I want to create a button with title of phone number and if the user touches the button it wants to call that phone number.
Solution:
Just add the below code inside the action of that button and pass the number value.
Code:
let cleanNumber = number.replacingOccurrences(
if let url = URL(string: "TEL://\(String(describing: cleanNumber))") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
Comments
Post a Comment