Hi All,
To call any number with code using swift you can use this function.
private func dialNumber(phoneNumber:String) {
let phoneUrl:NSURL = NSURL(string: "tel://\(phoneNumber)")!
let application:UIApplication = UIApplication.sharedApplication()
if(application.canOpenURL(phoneUrl))
{
application.openURL(phoneUrl)
}
}
Just call above functio and pass any valid number .For Example:-
self.dialNumber("1800-425-8888");
0 Comment(s)