MFMailComposeViewController class provides access to the same interface used by the
Mail client to edit and send an email. The most common way to present this
interface is to do so modally using the
method, just as we did in the preceding section to create a
reusable web view class.
We can therefore reuse our Prototype application code from the preceding section to demonstrate how the mail composer works; we’ll just drop in a class that displays the mail interface instead of the web interface. Open the Finder and navigate to the location where you saved the Prototype project. Right-click on the folder containing the project files and select Duplicate; a folder called Prototype copy will be created containing a duplicate of our project. Rename the folder Prototype2, and then open the new (duplicate) project inside Xcode and use the Project→Rename tool to rename the project itself.
Next, prune back the code:
Open the copy of the project in Xcode and delete the WebViewController.h, WebViewController.m, and WebView.xib files by right-clicking on each file in the Groups & Files pane and selecting Delete from the pop-up menu. When prompted, click Also Move to Trash. If you moved WebView.xib into your Resources folder with the rest of the NIBs, look for it there.
Now click on the PrototypeViewController.m
file to open it in the editor. Delete the line where you import the
WebViewController.h file and delete all the code