I know this is an old question and I have read in the documents that we cannot customise the UI of the MFMessageController/MFMailController and doing such can increase the chance of the flagging of the applications from the AppStore if they found me using the private APIS's. So right now what I am doing is just for exploring the private api's
But still I followed some documents and I tried to do the following code by using some private API's
@IBAction func sendSmsClick(_ sender: AnyObject) {
guard MFMessageComposeViewController.canSendText() else {
return
}
let messageController = MFMessageComposeViewController()
messageController body = "fhfhfkjhfdgggefgregfhrfhfrhggejhvghjkgevhjg"
messageController.recipients = ["64688098"]
messageController.messageComposeDelegate = self;
// Disabling the recepient editing - not working
// Here the _setCanEditRecipients: is a private API
let disableRecepients = "_setCanEditRecipients:"
print(disableRecepients)
let selOne = NSSelectorFromString(disableRecepients)
if messageController.responds(to: selOne) {
print("Yes")
messageController.perform(selOne, with: false)
}
self.present(messageController, animated: true) {
}
}
The private APIs I got from the the list of iVars and Methods of MFMessageComposeViewController here.
But still I am able to edit the recipients list even if pass to one of the instance method _setCanEditRecipients
which is in the private API . How can I disable the Add button and the Recipients editing in the MFMessageComposer controller? Any ideas will be appreciated