In simulator we can’t test in below code using device we can try 1234567970 - example phone number let url: NSURL = URL(string: "TEL://1234567970")! as NSURL UIApplication.shared.open(url as URL, options: [:], completionHandler: nil) We can write above code as one function and call that method in viewdidload. (Or) write above code as it is in viewdidload method.
How to prevent the screen from sleeping in iOS Programmatically?
How do i get build/version number of an iOS App?
How to take a screenshot on iOS programmatically ?
How to make a phone call in iOS 10 using Swift?
How can I get battery level and state (plugged in, discharging, charging, etc) in iOS?