Created
April 19, 2020 05:32
-
-
Save alexnikol/d65864812136a4d1edd18efa469b2f66 to your computer and use it in GitHub Desktop.
Swift 4. Run phone call from iOS Application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let yourNumber = "+1 999 999 9999" //Your needed phone | |
guard let number = URL(string: "tel://" + yourNumber), //Check if phone non-optional and app can open this URL | |
UIApplication.shared.canOpenURL(number) else { return } | |
UIApplication.shared.open(number) //Call your phone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment