Is it possible to somehow lock the fields in an MFMailComposeViewController
so that the body, recipients etc cannot be changed by the user? I need the e-mail the user sends to go to a particular account and the body to meet certain criteria so if the user drastically edits the format everything could go horribly wrong..At the moment the body is filled in from data that the user inputs to textfields and date-pickers in the previous view.
Basically I think it would just be more professional to have the fields locked rather than display an alert or something saying "Please Don't Edit the Message", so its not a massive problem if the fields can't be locked, but any help would be greatly appreciated.
Download the framework from the link below. Then I have put together some code that sends the email with a nice "please wait" overlay. I have attached an image of what this looks like while its running (for the few seconds it takes). Please note, I take no credit for creating the SMTP framework. It was downloaded from the internet after searching for it forever. The zip file that you can download includes the overlay images that I created for user feedback. It has both @2x and regular. You will have to go into interface builder and create the label though that says "sending test drive..". Its already in the code but I didnt add it from code. So youll have to add it in IB.
1. Make sure to add the framework you downloaded to your project.
2. Make sure to add the CFNetwork framework to your project
3. Make sure to attach the UILabel name "loadingLabel" in interface builder
4. The username and password that the code is refering to is an smtp server. If you dont have one create a gmail account and use gmail settings. If you are not familiar with gmail settings google "gmail smtp" you will find what you need.
Find Framework & Art here
For your .h file make sure to include:
For your .m file include:
everything else is its own function
The final results are shown below. The screen appears to dim a bit (kind of like when an UIAlert is shown). It shows a message saying its being sent, and then "brightens" back up when the message is sent.
Happy Coding!!