AlertView with Checkbox Control in iOS - 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 !!!

Related

iOS custom error popup

I would like to add "more info" collapsible accordion into my error alert view. So it will expand with additional information about the err after user presses it. And of course it will animate the size of error alert too. How it can be done? Maybe there is already existing solution for what I need?
Thanks a lot!
The standard UIAlertView does not allow this. You'll have to make your own view that mimicks the appearance of an alert view (using a UIVisualEffectView and possibly even a UIInterpolatingMotionEffect if you really want it to look like the real thing). Takes a fair but of work, especially if you want to support older iOS versions. And of course with every new iOS version that changes the appearance of alerts, you'll have to update the code. You might be better off just going with a completely different appearance unique to your app.
Once you have made that custom view, you can add the extra field as a hidden text field. When the triangle button is pressed, you set the height of that hidden field to 0, unhide it, then animate the height of the text field and the height of the containing view to their new values.
Try this custom alert view
https://github.com/wimagguc/ios-custom-alertview
You can add whatever animation you want.

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.

Popup notification box

Im trying to create a popup style notification, which is shown at the top of the screen (using a basic animation). The notification is going to be a simple form with a submit button.
Im trying to figure out how to go about this, and what are the best options i have. I've found this popup library: https://www.cocoacontrols.com/controls/cqmfloatingcontroller
What are the best options for 1. creating the popup and 2. animating to popup
If this is something that you will be reusing a lot, it might be worth subclassing UIAlertView, as you can then automatically use all "popup" methods provided by it,and by customizing it's view you can get the appearance you want.

Implementing a "context menu" with a grid of buttons

I'm wondering whether there's a better way of implementing a "context menu" in my app. This is a screenshot of how it currently looks like and as you can see, almost the entire screen is already filled up with entries:
This is actually a UIAlertView with multiple "other" buttons.
I wondered if it's possible to create sort of a grid layout within the alert view and add three buttons per row which show icons only, instead of labels (in order to save some space). I'd like to make it similar to this (photoshopped) layout:
I read that it's possible to create a popup with custom stuff in it by using a UIView but perhaps you guys know an easier trick of accomplishing the same thing with an UIAlertView.
Is this even possible with an alert view?
it's impossible to create an UIAlertView like this.. Create a new UIView and add it to your viewController with [self.view addSubview:..]
You should use UIActionSheet instead of UIAlertView in this case. Or you can use modalViewController something like this: http://timneill.net/2010/09/modal-view-controller-example-part-1/

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