MFMessageComposeViewController disable add recipients button - ios

I have a MFMessageComposeViewController witch i pre define its body and recipients fields.
I want to disable the add more contact button "see the attached screen shot" because i just want the user to send this message to 1 pre defined number.
How can accomplish that. Thanks.

From Apple documentation of MFMessageComposeViewController
Important: The message composition interface itself is not
customizable and must not be modified by your app. In addition, after
presenting the interface, your app is unable to make further changes
to the message content. The user can edit the content using the
interface, but programmatic changes are ignored. Thus, you must set
the values of content fields, if desired, before presenting the
interface

Related

How to set a custom keyboard for UIWebView

How to show a custom keyboard and Input Accessory View for a editable UIWebView for iOS7 and up.
i.e: How can i set and make use a value from [UIWebView setInputView:] and [UIWebView setInputAccessoryView:]
It would be helpful to understand what you're trying to do? You can either be trying to force a specific type of keyboard such as numeric, email, etc. that will use the keyboard the user has explicitly installed on their device (or the system one).
In order to do this, you can reference this apple doc which shows you the 'type' attribute to add to an tag.
Otherwise you are asking about loading a custom keyboard that you have created from the webview. The app developer in me screams, "you should NEVER do this." If you're content is generic enough to merit putting into a webview, than it is certainly not worth loading a custom keyboard.
If you realllly need to do this, you can set keyboardDisplayRequiresUserAction to NO, then use custom javascript to request the app to perform a native function, then drop a uitextfield or uitextview directly overtop the html input field and set a custom input view on the native control. There are an obscene amount of problems with following this approach, and I sincerely hope you
Are you trying to customize the ios keyboard or you want to show an HTML keyboard?
In the first case you can look at this link: link
In the second case you can just google for it, this is the first result searching for "html keyboard".
Good luck
I believe there is no way to do this as of now. Hence, my current approach is to use a custom view below the keyboard and hide the keyboard and show the keyboard as required.

How to identify which option selected on UIActivityViewController before presenting respective view modally?

I have a button on my view, on click of which I am presenting user with UIactivityViewController, to select options from Message and Mail.
Now I want to know how to identify which option was selected by user, so that I can perform custom check and modifications to navigation and status bar when presenting mfmailcomposeviewcontroller modally?
Also, I want to implement other checks whether device is capable of sending emails or not, this can be done only if I am able to determine, if user selected Mail option from UIActivityViewController.
As far as I know you can't do this with the default built-in activities. All you get is the completionHandler which only gets called once the action is cancelled or completed. If you want more granular control you can create your own activity and implement it yourself.
The built-in share options are also disabled automatically if they are not usable. If you need to, you can perform extra checks and if you want to disable a particular activity, use the excludedActivityTypes property of your UIActivityViewController.

AlertView with Checkbox Control in iOS

I want to display an alert view dialog in ios with usual title, message and two buttons + additionally I need a check box with message like "Always show this". In apple HIG document, they stated better to use an action sheet or view controller instead of displaying more controls in an alertview. Any alternative options are there?
Thanks in advance
You can create Custom View in which you can you all the required control and if you want to show the you can also use nice animation to show them and also you can set some good graphics as well. So the best way is to create CustomView.
All the best !!!

No need to save draft in MFMailComposeViewController

After clicking the cancel button of MFMailComposeViewController action sheet of save draft or not is generated.
I dont want this action sheet how can i achieve that?
thanks in advance.
From documentation
Important The mail composition interface itself is not customizable
and must not be modified by your application. In addition, after
presenting the interface, your application is not allowed to make
further changes to the email content. The user may still edit the
content using the interface, but programmatic changes are ignored.
Thus, you must set the values of content fields before presenting the
interface.
First line answers your question I think.

How to send email message from IOS application using 2 Views?

I am an IOS noob and this may be a dumb question, so here it is. I have two views. View A and View B. View A has my textField (for my message) and View B has my send button. Is it possible to send text inputed in View A from my send button in View B? Or is there a better way to do this?
Basically what I am trying to do is share a message using a menu. After the user clicks the send message a popup will display asking the user how to send. (IE: Send as Email, Share on Twitter, Share on Facebook, or Cancel).
My FIRST VIEW
My SECOND VIEW
Also just so I am clear. I don't expect anyone to solve it just wondering if anyone has ever done something like this before. If you want to provide possible solution that would be awesome. But really, more or less, I am looking for some insight.
Question: "Is it possible to send text inputed in View A from my send button in View B? Or is there a better way to do this?"
Answer: Yes, it is possible. Here is a tutorial which contains an explanation of how to send an email from an app: http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/. In the toolbar in the first view you might consider using a standard system image, UIBarButtonSystemItemAction, instead of "Send Message." You might also consider using a UIActionSheet instead of the second view. Apple says, "Use the UIActionSheet class to present the user with a set of alternatives for how to proceed with a given task."
Yes this is possible through several methods. The most OO and IMO the best way will be to create a custom init method on ViewB.
Something like -(id) initWithEmail(NSString* email, NSString* message)
It is easy if all your widgets (the textfield, the button and the action sheet) are all ivars of the same view controller.
So, in the same controller, the button will trigger the selectSendingMethod which will display the pop up and each button of this sheet will call an adequate method.
That should solve your problem.

Resources