@fernando - I tried creating the MSMessage without the MSSession in constructor and I got the same result.
So this is what I did from scratch (in case someone can see something really obviously wrong). Again, any help would be greatly appreciated. It really feels like I'm missing something really obvious.
1. Create a brand new Single-View Application
2. In main.storyboard, create a button in the middle of the screen
3. Ctrl-drag "Touch Up Inside" for the button to my ViewController class to create onTouchUp in code (see below)
4. Wrote the code below
5. Run the app on an iPhone 6s Plus
6. See no MSMessage in the MFMessageComposeViewController
import UIKit
import Messages
import MessageUI
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
/
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
/
}
@IBAction func onTouchUp(_ sender: AnyObject) {
let composeVC = MFMessageComposeViewController()
let msgLayout = MSMessageTemplateLayout()
msgLayout.caption = "something here"
let message = MSMessage()
message.layout = msgLayout
composeVC.message = message
self.present(composeVC, animated: true, completion: nil)
}
}