In this video I will show you how to compose and send emails from your iOS Swift Xcode application.
Giving the user the ability to send you an email is a great way to encourage feedback and communication between yourself and your users. Wouldn’t it be great that instead of possibly giving your app a negative review in the app store due to a possible poor experience that they have the opportunity to rather contact you, the developer instead? That is the use case we will explore here.
Sending emails is pretty straightforward and easy to do, and without much hassle you can implement the option into your own app.
In the demo project we will create a simple table view controller (as you would find in the settings portion of your app), we will add 2 rows. The first row will be a ‘Rate Us’ option which, when selected, will pop-up an alert asking the user to rate our application if they like it else to encourage them to send us feedback rather if they didn’t. This shows a nice use case flow for diverting negative feedback to your inbox, rather than to the app store.
The second option will be a general ‘Give Feedback’ select, which will launch the email compose view.
The demo tutorial will see us go over the following –
- Create a simple UITableView with two basic static cells for our options
- Import the MessageUI.framework into our project
- create the class file where our logic will be coded in
- create the logic to identify which row is selected
- Show an alert pop-up for the ‘Rate Us’ option, which option to send feedback
- Show the email composer on selection of the ‘Send Feedback’ option
- how to handle the various results when on the email compose screen (how to dismiss the view controller, and catch any other results)
If you have any comments or questions, please post them below. Thanks for watching!0