简体   繁体   中英

presenting MFMailComposeViewController modally from iPhone addressbook

I am building an iPhone app which sends email to contacts from address-book.

After selecting the email-address from a persons contact...i want to use MFMailComposeViewController and present the MailComposeViewController modally, but on tap to email field of contact it launches the mail application....

how can i discard the default functionality of switching to mail app and use MFMailComposeViewController instead?

In the delegate method

- (BOOL)personViewController:(ABPersonViewController *)personViewController 
shouldPerformDefaultActionForPerson:(ABRecordRef)person 
                           property:(ABPropertyID)property 
                         identifier:(ABMultiValueIdentifier)identifierForValue

return NO and present the MailComposeViewController from there when property==kABPersonEmailProperty .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM