Send Email using MFMailComposeViewController
Currently 开发者_JS百科I have a UITextView field with the CheckBox "Detect Links" checked. The contents of the field will always be an email address.
What I want to do is allow the users to tap the email address and the mail composer open inside of my app.
I have read how you implement sending an email inside of your app using MFMailComposeViewController but how do I capture the user touching the email address, in the UITextView, and send it to my mail composer code instead of the default action?
Since UITextView
does not support intercepting taps on links, you would probably have to subclass UIApplication
to override its openURL:
method. I'm not even sure if this will work. If you want to go that route, note that you have to make your UIApplication
subclass known to the system in the call to UIApplicationMain()
in main.m and in MainWindow.xib.
精彩评论