How to define a custom keyPad in my App? - iphone

I want define a custom keyboard in my App,When I press one TabBar Item in my UITabBarController, then custom keyboard slide up, when I touch the the tabview, I hope the custom keyboard can slide down, But, Because the custom keyboard add in UITabBarController's view, and tableView add in UIViewController one of UITabBarController's ViewController, they are not in the same Class, How can I define the Keyboard, and add to which view?
I want to do like this:
When Press tab bar Item keyboard slide up,
http://i.stack.imgur.com/66NDu.png
When touch tableview, keyboard slide down.
http://i.stack.imgur.com/ZiHaR.png

Make a custom UIView with your custom keyboard buttons.
UITextField and UITextView have a property called inputView. If you set your custom view to this, iOS automatically takes care of resignFirstResponder and becomesFirstResponder messages on the text field.
This is the easiest way to use a custom keyboard.

Why are you declaring the custom keyboard in the UITabBarController class ? You can declare it in the view controller that is attached to that particular tabBarItem. If you add it to the that view controller, I am sure you can just make it resignFirstResponder or removeFromSuperView and manipulate it as you want.
Or you can just create a separate class for your customKeyboard, and add it along with your other classes. Simply include that class and create objects in other view controllers to manipulate them, and then release them. This is very easy and it is better programming compared to your approach, as at a later point of time, if you need to make changes or release 2.0 version of your app, it will come in handy and save some development time !

Related

How to make a combo box in iphone/ipad?

This is maybe a simple question, but I don't have a clue the keyword i had to search for this...
I want to create a simple selector (I called it spinner in Android). This is what i want to achieve
Or it will take a whole screen if it's in ipod touch / iphone.
So, I have 3 button that represent filter (category, country, sort) for a ListView... and if I press one of the button, a popover / dialog should be appear to select the filter for each button.
thanks...
Please let me know if I need to add some information to make the question clear.
Its not so much typical that is it appearing.
Create a new UIViewController class with xib and adjust view size you want to display for combo box or popviewControoler. Then put navigation controller over and tableviewController.
And customize your UIViewController using its controller class. Controller class will be reponsible for displaying and selecting data.
Now in your MainViewController From where you want to show ComboBox or popviewcontroller.
declare popViewController instance variable,synthesize it.
implement a userdefined method here alloc your popviewcontroller class and assign it to popviewController instance variable of your class.
Then called it didSelectRowAtIndexPath.
When popover dismiss you set popViewController result in instance variable of this class so it can easily access in MainViewController class.
You can achieve combo box like functionality by adding a UItableView in a UIView and implement all the delegates of UITableView in that custom view.
Now you can add object of that custom UIView where ever you want that combo. Just you have to workout with some Frame setting.

iPhone Swipe UIKeyboard to Switch Views

I want to achieve something like this with my application and its keyboard.
http://www.youtube.com/watch?v=ajs1p5NCNw4 from 1:32 - 1:38.
How can you hide your keyboard by swiping it horizontally and show another view on its place? Is it possible with default keyboard or should I create my own view with few buttons which I'll need and then add the swiping? (I know how to do this, but I'm not sure if apple wouldn't deny the app in app store because I implement my own keyboard or something like that)
Those are custom views. It might be a scroll view with paging enabled and two subviews (the numerical keypad is one subview and items view is the other subview).
The app might be using the custom view in place of the system keyboard, by setting the inputView property of a text field for example. Or it might just be displaying the custom view as a subview of its top-level view.

Mimicking iOS notification view

I am trying to mimic iOS 5's notification view (when you swipe down the view appears) for hub with a left swipe in my view. I created a mimic for a single view controller by adding the hubview as subview and changing the origin of view when making swipe. But With this approach I have to add it to every view I implement in my app. I want to add it to UIViewController as a category. I am not sure how to proceed at this point.
If you don't want every viewController to have to handle the menu then I would suggest having a root viewController that acts like a container. It has a subview that displays the content from your various view controllers and it also has the controls for your menu and any other overlay information you may want to provide.
A category won't work in this case but subclassing will. Just ensure that all of your view controllers are sub classes of the view controller with this functionality implemented.

Switchable subview in window for iphone app

I've been looking everywhere but can't seem to find any examples/tutorials for my situation (not sure how to google it..)
So i have a window where a portion of it should be static (buttons and such) and there is a dynamic part (bottom leftish) that should change subviews.
So what i'm looking for is a way so that clicking the buttons in the static area will change the dynamic area to a view of my choice. I have no idea how to do this using the IB, but doing it programatically seems the only way. Any suggestions(I do not want to use a tab bar controller)?
Oh, and is there a benefit to making views and such programatically vs through the IB?
Thanks!
You can also achieve it programatically. Just create another viewcontroller class (as many as u want). In the loadView method of it create a UIView in the coordinates where u want to add the subview in the current view. Now create an instance of this viewcontroller class in the currentview controller and add it as a subview. You will get the subview at the desired location.If u want to change it dynamically create as many views and then add them to the array and change them whenever the button is clicked.
Hope this helps.
You should perform the switch in your view controller. The static buttons can have their actions hooked up to that controller (in IB), which can have an outlet (in IB) to the subviews and perform the swap.
As for when you should use IB, see this question.
You can do it from interface builder as well. You just need to take viewController from interface builder drag-n-drop to main window. assign IBAction to all buttons to add different viewController's view to main window just make their frame some smaller.
if u want to change or views by click on button then u chose segmentcontrol switch. and cod for each segment like as when click on segment 0 then open first sub view and when click on segment1 then open second sub view. And make by default unselected so that ur static view will appear initially lunching of view.

How would you create a static version of the UIPopoverView?

I tried using a popover in my interface, but all the convenience features of the UIPopoverController made it impossible.
My goal is to use the popover's chrome, but none of the associated events or actions. I need it to stay displayed onscreen (no dismissal) and not be modal.
So now I'm considering building my own view using images. My question: is there a better way to accomplish this (a view with image borders)?
If you want to stay your UIPopover onscreen and allow the user to interact with other views onscreen while to popover is show, consider using the passthroughViews property on UIPopoverController
The UIPopoverController Class Reference:
When a popover is active, interactions
with other views are normally disabled
until the popover is dismissed.
Assigning an array of views to this
property allows taps outside of the
popover to be handled by the
corresponding views.
You should be able to achieve the effect you want by just passing an array containing only the "background" viewcontroller's view.