Search code examples
swiftmfmessagecomposeviewcontroller

Method to open Phone app (Swift)


What's the method to open the phone app with a populated number? I know how to do this for a text message with MFMessageCompose but would like to learn how for phone calls. Thanks all!


Solution

  • UIApplication.sharedApplication().openURL(NSURL(string : "tel://9999999999")) will do the trick. I reccommend spending some more time searching next time before you ask a question as this has been asked several times.