Reputation: 5526
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?
Upvotes: 0
Views: 221
Reputation: 35394
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
.
Upvotes: 1