Help on this would be much appreciated.
I would like to send an SMS message from within an app in iOS.
In Xcode, I have done the following:
Added a reference in Link Binary With Library:
MessageUI.framework
In ViewController.swift I have added the import:
import MessageUI
However, when I try to add the delegate ...
class ViewController: UIViewController, MFMessageComposeViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
I get this error:
Type 'ViewController' does not conform to protocol 'MFMessageComposeViewControllerDelegate'
Update
Solved by following Antonio's advice. I added this:
func messageComposeViewController(controller: MFMessageComposeViewController!, didFinishWithResult result: MessageComposeResult) {
}