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 o开发者_如何学Cf 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
.
精彩评论