如何启动短信应用程序 [英] How to launch SMS Message app
本文介绍了如何启动短信应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想打开SMS消息应用程序以复制朋友的一些文本.我不是在创建短信.
I want to open SMS Message App to copy some text from friends. I am not creating SMS.
如何使用Swift代码启动iPhone SMS消息应用程序?我在下面遇到了以下代码,用于启动Mail应用程序,但无法正常工作.
How to launch iphone SMS Message app using Swift code? I come across this code below for launching Mail app but not working.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto:"]];
我将其更改为,并且同样无法正常工作
I changed it to and the same not working
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:"]];
感谢您的帮助.TIA
appreciate your help. TIA
推荐答案
// Swift 3
UIApplication.sharedApplication().openURL(NSURL(string: "sms:")!)
// Swift 4
UIApplication.shared.open(URL(string: "sms:")!, options: [:], completionHandler: nil)
这篇关于如何启动短信应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文