iPad for iPhone Developers 101 in iOS 6: UISplitView Tutorial

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

iPad for iPhone Developers 101 in iOS 6: UISplitView Tutorial

Postby rwenderlich » Tue Mar 26, 2013 11:00 am

This is the official thread to discuss the following blog post: iPad for iPhone Developers 101 in iOS 6: UISplitView Tutorial
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2155
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 336 times

Re: iPad for iPhone Developers 101 in iOS 6: UISplitView Tut

Postby Renexandro » Sun May 19, 2013 3:27 pm

Is there any easy way, to make the master popover look like conventional popovers and not the drawer style?
Renexandro
Subscriber since Jul 16, 2014
n00b
 
Posts: 4
Joined: Fri May 17, 2013 5:56 pm
Has thanked: 1 time
Been thanked: 0 time

Re: iPad for iPhone Developers 101 in iOS 6: UISplitView Tut

Postby rtamesis » Mon Jun 24, 2013 5:40 am

I made the detail view controller the delegate of the master view controller, and so far I'm able to pass info from the master view controller to the delegate view controller without any problems when the user selects a cell in the master view controller. My dilemma now is that I need to pass information back from the detail view controller to the master view controller in order to tell it what cell should be selected next. I need to get a reference to the instance of the master view controller that already exists in order to send information to it to do so, but I'm at a loss at how to do so.
rtamesis
Subscriber since Aug 5, 2014
n00b
 
Posts: 4
Joined: Tue May 14, 2013 4:30 am
Has thanked: 0 time
Been thanked: 0 time

Postby auspicious99 » Mon Jun 24, 2013 10:25 am

@renexandro People have tried hacking it to get the traditional popovers, e.g., https://github.com/masaniparesh/MGSplitViewController and http://www.i4-apps.com/splitviewcontroller-popovers/
auspicious99
n00b
 
Posts: 3
Joined: Fri Jun 21, 2013 1:10 am
Has thanked: 0 time
Been thanked: 0 time

Postby auspicious99 » Mon Jun 24, 2013 10:28 am

@rtamesis There is actually the UISplitViewController, the master and the detail, which are 3 different view controllers. The master and detail should each have a pointer back to the UISplitViewController, through their splitViewController property. Meanwhile, the UISplitViewController has a 2 element array, viewControllers, pointing to the master and detail view controllers as elements 0 and 1, respectively.
auspicious99
n00b
 
Posts: 3
Joined: Fri Jun 21, 2013 1:10 am
Has thanked: 0 time
Been thanked: 0 time

Postby techd » Mon Jul 08, 2013 12:17 am

I am trying to put a uisplitview under a uitabview, can you please offer any help on how to do that?
techd
n00b
 
Posts: 1
Joined: Mon Jul 08, 2013 12:13 am
Has thanked: 0 time
Been thanked: 0 time

Postby atm849 » Sat Jul 13, 2013 6:57 pm

Thank you for tutorial. I have a problem with split view. I do not know what should do when I have tow or more UIViewControllers in master side.
Suppose that in your example project We have a UIViewController on master side that have a button. the button connect to LeftViewController with push segue. In other words, in master side after Navigation Controller I have a UIViewController with a button and then I have LeftViewController which is connected with push segue. Thank you in advance
atm849
n00b
 
Posts: 1
Joined: Sat Jul 13, 2013 6:48 pm
Has thanked: 0 time
Been thanked: 0 time

Postby juandejesuss » Thu Sep 19, 2013 10:35 pm

for making it work with UINavigationController instead just replace in your appDelegate.m method didFinishLaunchingWithOptions next code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
UINavigationController *leftNavController = [splitViewController.viewControllers objectAtIndex:0];
UINavigationController *rightNavController = [splitViewController.viewControllers objectAtIndex:1];

LeftViewController *leftViewController = (LeftViewController *)[leftNavController topViewController];
RightViewController *rightViewController = (RightViewController *)[rightNavController topViewController];

Monster *firstMonster = [[leftViewController monsters] objectAtIndex:0];

[rightViewController setMonster:firstMonster];

leftViewController.delegate = rightViewController;
splitViewController.delegate = rightViewController;


return YES;
}
juandejesuss
n00b
 
Posts: 1
Joined: Thu Sep 19, 2013 10:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: iPad for iPhone Developers 101 in iOS 6: UISplitView Tut

Postby Andreasson » Wed Oct 30, 2013 2:58 pm

I have an iPhone app that is based on a tab bar with tableviews inside it. ie. you tap on a bar and you get a table view. Drilling down from that is the detailview. It was made using storyboard and all is working fine.

Now I want to make a universal app and obviously the tableview/detailview should be a splitview. They seem to sit happily inside the tab bar.
First question is: Do I need to create new viewControllers for the iPad end of things, or can I use the ones I have?
Secondly, I have made some progress (I can see some data in the masterview), but linking the data from the master to the detail is not working. The first table is a simple database with names etc from a NSManagedObject source.
Thirdly, but not imminent, I need to deal with updates and new entries to the database. In the iPhone end I just brought on a modalview to handle the input, and viewing a record made it live to edit.

Any help would be most appreciated.
Andreasson
n00b
 
Posts: 1
Joined: Wed Oct 30, 2013 2:45 pm
Has thanked: 0 time
Been thanked: 0 time

Postby silviya » Fri Nov 08, 2013 6:29 am

hello sir this tutorial is more useful to me,but in my application i want to add a login screen ...is this possible to add a screen before split view controller???
silviya
n00b
 
Posts: 2
Joined: Sat Oct 26, 2013 10:29 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 7 guests