Reputation: 633
I am using the iOS MessageUI framework to present a Message View Controller using MFMessageComposeViewController. I do not understand the return value from canSendSubject(). Apple docs say:
canSendSubject()
Indicates whether or not messages can include subject lines, according to the user’s configuration in Settings.
In my testing, canSendSubject() always returns true despite various combinations of switches in Settings: Messages. I expected the Show Subject Field switch setting would influence the return value, but it doesn't.
Does anyone know under what condition canSendSubject() will return false?
func displayMessagingUI() {
let composeVC = MFMessageComposeViewController()
composeVC.messageComposeDelegate = self
composeVC.recipients = [String(8005551212)]
composeVC.body = "This is a test message."
if MFMessageComposeViewController.canSendSubject() {
composeVC.subject = "Subject"
}
self.present(composeVC, animated: true, completion: nil)
}
Testing on iOS 11.1, iPhone X
Upvotes: 2
Views: 469