发送短信MFMessageComposeViewController
Posted 超神船长
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了发送短信MFMessageComposeViewController相关的知识,希望对你有一定的参考价值。
if([MFMessageComposeViewController canSendText]) { MFMessageComposeViewController * controller = [[MFMessageComposeViewController alloc] init]; controller.recipients = @[weakSelf.detailModel.Telphone];//收信人 // controller.body = body;//短信内容 controller.messageComposeDelegate = weakSelf; [weakSelf presentViewController:controller animated:YES completion:nil]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示信息" message:@"该设备不支持短信功能" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; [alert show]; }
-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result { [self dismissViewControllerAnimated:YES completion:nil]; }
以上是关于发送短信MFMessageComposeViewController的主要内容,如果未能解决你的问题,请参考以下文章