已知的努力来更新iOS5和故事板的MGSplitViewController?

我正在开发一个iPad应用程序,需要隐藏/显示分割视图的主控制器。

相关SO答案说明马特 Gemmell的MGSplitViewController :

  • 如何在iPad中的UiSplitviewcontroller隐藏主视图
  • 如何以编程方式隐藏UISplitViewController的主要部分?
  • 在通用应用程序中集成MGSplitViewController
  • MGSplitViewController使用Storyboards

MGSplitViewController将是完美的,甚至提供了一种方法来调整主从细节视图的比例。

太棒了! 除了它使用故事板和ARC的最新Xcode不好玩。

我看到一个拉(9个月前)的请求,将其转换为适用于iOS4的ARC,但这仍然需要一些工作来保持故事板的友好性。

有谁知道正在进行的努力来更新这个开源的gem,以在最新的iOS开发环境中正常运行吗?

否则,如何将其集成到Xcode storyboard / iOS5项目中的示例/教程将非常有用。

看起来如果你等待足够长的时间,每一个好的包装都会得到应有的关注。

再次感谢Matt Gemmell提供了一个很好的包装,并且感谢Heath Borders采取主动。

Heath Borders移植到iOS 5.1

我能够解决故事板问题。 我有一个通用的应用程序与主细节故事板设置,所以我留下他们所有的地方,并更改应用程序的初始化不使用故事板,而是以编程方式在我的applicationDidFinishLaunching像这样设置它:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil]; self.masterController = [storyboard instantiateViewControllerWithIdentifier:@"masterController"]; self.detailController = [storyboard instantiateViewControllerWithIdentifier:@"detailController"]; self.splitViewController = [[MGSplitViewController alloc] init]; self.splitViewController.masterViewController = self.masterController; self.splitViewController.detailViewController = self.detailController; ACALandingVC* landingVC = [self.detailController.childViewControllers objectAtIndex:0]; landingVC.splitController = self.splitViewController; self.splitViewController.delegate = landingVC; //self.splitViewController.splitWidth = 5; self.splitViewController.allowsDraggingDivider = YES; self.splitViewController.dividerStyle = MGSplitViewDividerStylePaneSplitter; self.splitViewController.splitPosition = 350; self.splitViewController.splitWidth = 10; self.window.rootViewController = self.splitViewController; } else { UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; UITabBarController* firstVC = [storyboard instantiateInitialViewController]; self.window.rootViewController = firstVC; [[UINavigationBar appearance] setTintColor:[UIColor lightGrayColor]]; } [self.window makeKeyAndVisible]; 

我的AppDelegate.h如下所示:

 @class MGSplitViewController; @interface ACAAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (nonatomic, strong) MGSplitViewController* splitViewController; @property (nonatomic, strong) UITabBarController* masterController; @property (nonatomic, strong) UINavigationController* detailController; @end