How to launch SMS Message app

// Swift 3
UIApplication.sharedApplication().openURL(NSURL(string: "sms:")!)

// Swift 4
UIApplication.shared.open(URL(string: "sms:")!, options: [:], completionHandler: nil)

I'm not sure why you want to explicitly use SMS app and I'm not sure if it's possible. On the other hand iOS by default offers MFMessageComposeViewController for sending SMS from iOS app.

Check this Swift example for more details.

Edit: I've found this wiki page which may contain answer for your question. Be aware I haven't tested it.

let number = "sms:+12345678901"
UIApplication.sharedApplication().openURL(NSURL(string: number)!)

Swift 5:

let sms = "sms:+1234567890&body=Hello Abc How are You I am ios developer."
let strURL = sms.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
UIApplication.shared.open(URL(string: strURL)!, options: [:], completionHandler: nil)

Tags:

Ios

Swift