iOS 打电话,发短信,复制
来源:互联网 发布:淘宝二手手机靠谱么 编辑:程序博客网 时间:2024/05/18 02:31
一、打电话
1、打电话会先弹出提示框,询问你是否打电话,结束通话后会返回到程序中
if (_webView ==nil){
_webView = [[UIWebViewalloc]initWithFrame:CGRectZero];
}
[_webViewloadRequest:[NSURLRequestrequestWithURL:[NSURLURLWithString:@"tel://10086"]]];
2、直接跳转到打电话界面
NSURL *url = [NSURLURLWithString:@"tel://10086"];
[[UIApplicationsharedApplication]openURL:url];
3、打电话会先弹出提示框,询问你是否打电话,结束通话后会返回到程序中
NSURL *url = [NSURLURLWithString:@"telprompt://10010"];
[[UIApplicationsharedApplication]openURL:url];
二、发送短信,
MFMessageComposeViewController *controller = [[MFMessageComposeViewControlleralloc]init];
if([MFMessageComposeViewControllercanSendText])//判断当前设备是否可以发送短信息
{
controller.body =@"你好";//短信内容
controller.recipients =@[@"123"];//短信接收者,可设置多个
controller.messageComposeDelegate =self;
[selfpresentViewController:controlleranimated:YEScompletion:nil];
}else{
UIAlertView * aler = [[UIAlertViewalloc]initWithTitle:@""message:@"设备不具备发短信功能"delegate:nilcancelButtonTitle:@"确定"otherButtonTitles:nil];
[alershow];
}
#pragma mark - MFMessageComposeViewControllerDelegate //处理发送完的响应结果
(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
{
[selfdismissViewControllerAnimated:YEScompletion:nil];
NSString * str ;
if (result ==MessageComposeResultCancelled)
{
str =@"取消发送短信!";
}
elseif (result ==MessageComposeResultSent)
{
str =@"发送短信成功!";
UIAlertView * aler = [[UIAlertViewalloc]initWithTitle:nilmessage:strdelegate:nilcancelButtonTitle:@"确定"otherButtonTitles:nil];
[alershow];
}
else
{
str =@"短信发送失败!";
}
}
三、复制NSString *str =@"123456";
UIPasteboard *pastboard = [UIPasteboardgeneralPasteboard];
pastboard.string = str;
- iOS 打电话,发短信,复制
- iOS—打电话、发短信
- iOS打电话、发短信功能
- IOS打电话、发短信、发邮件总结
- iOS中摇一摇 发短信 打电话 发邮件
- ios 打电话,发邮件,发短信
- iOS 打电话 & 发短信 & 发邮件
- iOS 打电话、发短信、发邮件
- iOS打电话、发短信、发邮件开发
- iOS打电话、发短信、发邮件功能
- IOS 开发调用打电话,发短信
- iOS 打电话,发短信,打开网址
- iOS--调用打电话,发短信,打开网址
- IOS 开发调用打电话,发短信
- iOS中实现打电话、发短信
- ios判断设备能否打电话、发短信
- ios 调用打电话,发短信的功能
- iOS系统开发:打电话、发短信
- caffe 指定GPU
- 层次化聚类
- Mutual Information
- 学习笔记——内部类的特殊用法
- 聚类算法的评估应面向具体问题
- iOS 打电话,发短信,复制
- 数据增强方法
- js将日期格式的时间转成时间戳,方便做时间对比
- 《一本书玩转数据分析》
- 为什么很多公司都开始去oracle而使用mysql?(整理)Oracle和MySQL的主要区别 Oracle:客户端和命令窗口,都是由用户决定内容-> conn user_name/password;
- nodejs中解决异步嵌套循环,循环嵌套异步
- Android 自定义控件之继承view
- cpp 11.19
- intellij2016.2.3常用设置