ABPeoplePickerNavigationController inside a view? - cocoa-touch

In my tab bar iPad application, one of my tabs needs to have an "ABPeoplePicker", ie a view exactly similar the view that ABPeoplePickerNavigationController presents. However, only the controller is exposed in the API and Apple warns against having several controllers to manage a single screen.
To expose the idea slightly differently, Apple explains how to use ABPeoplePickerNavigationController modally. That's about the only use case for the small iPhone screen, but the iPad larger screen allows for a modeless use case inside the screen.
Is this possible or do I have to redesign my picker from scratch?

I was trying to do just that and did not succeed.
A delegate can not be subviewed it seems.

Related

Adapting between two different UIPresentationController's

I would like to adapt between two different UIPresentationController, according to the current trait collection. For example, the two controllers could be UIPopoverPresentationController for any traits and a custom UIPresentationController for compact horizontal traits (e.g. iPhone).
Unfortunately this doesn't seem possible in the latest iOS 8. In particular:
You can set a UIAdaptivePresentationControllerDelegate to swap out the presentation style, but only permits the standard full screen presentation controller.
You can choose which presentation controller to use just before presenting the view controller, but this doesn't actually adapt after presenting when the traits collection changes e.g. in iPad multitasking or orientation change.
A couple of different attempts at a solution: Tumblr, Irace
Any suggestions?
To assume you require two presentation controllers for adaptation is a false assumption.
There is only one presentation controller and you have to adapt the view and/or the transition using the delegate methods. For the custom transition you simply set a transition delegate class on the view controller you return from viewControllerForAdaptivePresentationStyle which in my case was a navigation controller with a transparent dimmed view with table at bottom and done button in the right nav item. My custom transition moves the table up from the bottom, while dimming and resizing the dimmed view, and fading in the nav bar. If you would like to see the behaviour yourself run Maps and tap the bottom right info button and try it on iPhone and iPad, I've copied that exactly. Here are screenshots of compact and regular:

Custom size iPad Split view

Im fairly new to objective C. I am currently trying to implement a split view on the iPad. I would like to have a left side view that can be resized so that it looks more like the side view on the spotify app for the ipad.
I understand UI Split controllers won't work because their width's are fixed.
I understand the other option is to use a View controller with sub views that can resized as required. However, I am not too sure how I should implement each subview with its own navigation controller. Any suggestions how else I can implement the said feature.
The image of the side panel implementation can be found in this link.
You can use Matt Gemmell's MGSplitViewController to accomplish this. It provides a custom split view controller implementation that might let you do what you want.
I would like to recommend, PSStackedView which i have used to create a similar layout as the Spotify iPad app. Took some time to understand it

iOS layout: alternative to tabs?

I'm working on a iPhone app which shows an mobile webform in a UIWebView. I'm using a default iOS layout with a navigation and tab bar.
The mobile webform is displayed in a UIWebView in the white area. Since the webform has a lot of input fields, we really need as must space for it as possible. Because of this, we are planing to remove the tabs in the bottom. Over time, there will be more tabs/sections, so it is not a solution to just add a button for each section in the left side of the navigation bar. On a iPad a popover could easily be used to handle this.
Is there a standard iOS layout mechanism to handle this change of sections/views without using tabs?
You could do something long the lines of Path or the new Facebook app and have the "table of contents" behind the Navbar and the navbar slides away (along with the child view) to reveal it. When done right (ie smoothly) I think the effect is really cool.
This would also work great as you add more and more options, since the table could just scroll.
Here is a framework that might be you started: http://www.cocoacontrols.com/platforms/ios/controls/iiviewdeckcontroller
I would consider replacing the navigation bar's title with a control that lets you switch between tabs. You can assign the bar's titleView property to a control or a button and it will generally do the right thing.
If you're limited to 2-3 tabs, you could simply use a UISegmentedControl.
If you want more, you could use a button which, when tapped, pops up a view that allows you to select the view you want. This could be a modal table view, or you could slide up a UIPickerView from the bottom of the screen, similar to the keyboard.
I use this technique in an app of my own, screenshots here. Tapping the button cycles between views (in this case, I'm changing the contents of the table cells); tap-and-hold slides up a picker.
Another possibility would be to arrange your different forms on pages in a scroll view with a page control at the bottom, à la Weather. The best option, though, if you’re going to have a particularly long list and want to keep your screen real estate, is probably the FB/Path-style sidebar table.
I ended up using a UIActionSheet but I think it in other situations would be more stylish to use a controller like the IIViewDeckController.

Is there another way than presentModalViewController to show a UITabBarController on just part of the screen?

I have a UITabBarController displaying a number of settings-screens in my app. I want them to be shown on just a part of the screen for layout reasons. In fullscreen, the lists become unreadable (too wide), there are just a few controls per page making the page feel very empty, and the tabbar buttons are far away from the content (Fitts law).
Using presentModalViewController with the UIModalPresentationFormSheet style gives me the size I want. I do this on top of an empty background, since in my case it doesn't make sense to display anything behind it. The "real" working area is displayed with another presentModalViewController in fullscreen mode on top of it all.
This works but feels like a hack. One problem is, I can't make the background behind the settings dialog move in the transition to fullscreen with the UIModalTransitionStyleFlipHorizontal style.
TL;DR
Can I embed a UITabBarController non-fullscreen in another "background"-view? I can't find any information of how I would do this.
Can I embed a UITabBarController non-fullscreen in another "background"-view? I can't find any information of how I would do this.
Why don't you try it out?
Create a container view of the size you want the tab bar controller to have.
Create the tab bar controller.
[containerView addSubview:tabBarController.view];

How to create a Controller to simulate the Springboard feature of the iPhone within your own application

I am trying to design a feature in my application for the iPhone that simulates the Springboard feature (Main menu of the iPhone that allows you to view more apps), or the way Weather application works that allows you to flip between views.
Does anyone have any samples of this how I would go about doing this. It's seems very trivial but I am wondering if I am missing something that is already available either as an Apple example or someone who did a tutorial on this.
The image below show how the user would use it.
alt text http://www.agilitesoftware.com/SpringboardExample.png
As they slide their finger to the right (or left) the other image would begin to show up. And it would animate smoothly. The faster you swiped your finger the faster it would move to the next view.
Update: The other feature is that it should mimic the same feel when you slide your hand across the display that is snaps to the current view into place. It should not keep sliding across if there is more than 1 view to the direction you swiping your finger.
I've seen other applications use this so that is why I am asking.
This is accomplished using the UIScrollView with the pagingEnabled property set to true. Just add each of your views, adjust the contentSize, and it will automatically "page" to the width of the screen across the content.
There is a sample app (with code) with exactly this functionality on the iPhone developer site on Apple.com (I believe it's called "PageControl".) - I'd suggest checking it out.
d.
I'm writing an app that uses a similar UI. As NilObject recommended, we're using a UIScrollView with pagingEnabled=YES.
You may also be interested in this example code involving just two child views. I'm trying it out now; it's an interesting technique but I've had to write some additional special-casing code for some odd situations that resulted.
There's also another question on this site that asks about creating a grid of icons like the home screen.
I would check out Joe Hewitt's code from the Three20 project for this. It provides a nice interface and further refinement of the UIScrollView implemented as TTScrollView and TTScrollViewDelegate, TTScrollViewDataSource.