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.
Related
I have some code that opens a popover window that displays some text. This is done by an action segue rather than actual code in a storyboard. Is there any way, that I can load into a different view by pressing a button on the popover view and have it load into the next view? I've tried using another action segue, but it puts a popover into my current popover over the button that I press. Thanks!
This kind of thing can't be done with just storyboards; some code will be necessary.
Here's how I would do this: instead of trying to use two separate popovers, use one popover with kind of a "nested" setup. The popover's content view controller would contain, say, a Page1ViewController and a Page2ViewController. When first displayed, the main controller would install page 1's view. You could maybe wire the action from page 1's button directly to the main controller, but I recommend that you use delegation for this. Create a protocol that's something like Page1ViewControllerDelegate and adopt the protocol in your main controller, then in the delegate method for page1ControllerRequestTransition(_:) or whatever you choose, just grab the page 1 view out and swap the page 2 view in. You can even have the two views be different sizes; the popover will automatically adjust itself.
Oh, and don't forget to disable translatesAutoresizingMaskIntoConstraints and add appropriate constraints to fix the four sides of each page's view.
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.
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.
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 !
I have looked at the PageControl example from Apple and have an architectural requirement difference. In the example the scroll view and page control objects are at the app delegate level. This means the scroll view and page control appears on every view of the application.
However, I have a "settings" view toggled from an info button (for now) that should not have these controls displayed. Therefore, I need to move my scroll view, page control, and view controllers objects down a layer and I'm struggling with how to best do this.
For example, the primary application view consists of metals (periodic elements). From this view I need a scroll view, page control, and info button on every view descending from here. Each metal will have it's own subclass where different images, calculations, etc will be displayed but I believe I need each of these subclassed elements to share the same scroll view, page control, and viewControllers array, right? Do I need a singleton?
What you are describing is kind of like how the native Weather application works. Each time you swipe, the info light is rendered as part of the page you are viewing. However, no matter what info light you tap, when it flips over you still get the same settings. Obviously this is how Apple thinks the UI should work because they did it that way. There is no reason you can't do the same.
In this situation, you don't need to create a singleton, you can use [UIApplication sharedApplication] as your singleton to get to your custom application delegate via the delegate property.
Look at Crème where I do exactly what you describe. The main view is scrollview+pagecontrol. Upon triggering the app into settings mode, the settings panel comes up that does not have a page control.
The solution is simply that you have a simple top-level UIViewController, and you make both the scrollview and pageview children of that viewcontroller. And for settings, you animate the modal settings dialog with a flip animation into the top-level UIViewController.