UInavigationController
이 있으면 콘텐츠 공유를위한 바 버튼을 추가 할 수 있습니다. 또는 viewcontroler에 공유 단추를 추가 할 수 있습니다.
MessageUI
을 사용하십시오. 대리자 MFMessageComposeViewControllerDelegate, MFMailComposeViewControllerDelegate
을 추가하십시오.
- (IBAction)contactBtn:(id)sender {
if ([MFMailComposeViewController canSendMail]){
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
[controller setSubject:@"Subject"];
[controller setMessageBody:@" " isHTML:NO];
[controller setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];
controller.mailComposeDelegate = self;
[self presentViewController:controller animated:YES completion:NULL];
}
else{
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Failed!" message:@"Mail can not be sent. Check your email settings." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil] ;
[alert show];
}
}
- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {
[self dismissViewControllerAnimated:YES completion:NULL];
}
이메일 계정이 유효한지 확인 하시겠습니까? – Rashad
@Rashad .... 예 전자 메일 계정이 장치에 설정되어 있는지 확인하고 싶습니다. ... –
장치의 설정은 무엇을 의미합니까? 해당 이메일은 기기에 저장되거나 기기가 이메일을 사용하고 있습니까? – Rashad