Nilesh Ukey
Nilesh Ukey

Reputation: 5526

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?

Upvotes: 0

Views: 221

Answers (1)

Felix
Felix

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

Related Questions