How To Send SMS and Call in iPhone Apps Swift

Today we will learn How To Send SMS and Call in iPhone Apps Swift, there is an existing framework for sending Messages (sms). The Message UI framework provides view controller for developers to present standard interface for composing SMS text message within apps.

The framework provides class named MFMessageComposeViewController for handling text message.

Sending SMS from App

First, import the MessageUI framework into the project.

How To Send SMS and Call in iPhone Apps Swift
How To Send SMS and Call in iPhone Apps Swift

 

Now implement the MFMessageComposeViewControllerDelegate.

We can handle the result in delegate method of MFMessageComposer like below.

Now initiate the MFMessageComposerViewController to display message view.

 

 

How To Send SMS and Call in iPhone Apps Swift

We can handle all situation in the above delegate method like cancel, sent and failed.

 

Initiate call from App.

Initiating call from app is just a single line code.

See just a single line to initiate call you can modify it according to requirement.

Today we learn How To Send SMS and Call in iPhone Apps Swift. Hope you enjoyed the tutorial. See you next time with some useful tutorial till then Happy Coding 😉

 

 

Add a Comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.