Do you ever want to send text messages in your iOS app from your user’s phone number? While you can’t do this directly without your user’s consent, you can display a pre-composed message for your user to send using MFMessageComposeViewController.

If you want to programmatically send an SMS from a different phone number, you can do this with Swift using Twilio.

That’s cool. Let’s send a message!

If you already have an app and want to get straight to the point, here’s the code you need to display the message composition interface: