forked from soffes/cheddar-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CDISplitViewController.m
61 lines (42 loc) · 1.54 KB
/
CDISplitViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// UISplitViewController.m
// Cheddar for iOS
//
// Created by Sam Soffes on 4/24/12.
// Copyright (c) 2012 Nothing Magical. All rights reserved.
//
#import "CDISplitViewController.h"
#import "CDIListsViewController.h"
#import "CDIListViewController.h"
#import "CDIAppDelegate.h"
@interface CDISplitViewController () <UISplitViewControllerDelegate>
@end
@implementation CDISplitViewController
@synthesize listsViewController = _listsViewController;
@synthesize listViewController = _listViewController;
#pragma mark - Class Methods
+ (CDISplitViewController *)sharedSplitViewController {
return (CDISplitViewController *)[[[CDIAppDelegate sharedAppDelegate] window] rootViewController];
}
#pragma mark - NSObject
- (id)init {
if ((self = [super init])) {
_listsViewController = [[CDIListsViewController alloc] init];
_listViewController = [[CDIListViewController alloc] init];
self.viewControllers = [[NSArray alloc] initWithObjects:
[[UINavigationController alloc] initWithRootViewController:_listsViewController],
[[UINavigationController alloc] initWithRootViewController:_listViewController],
nil];
self.delegate = self;
}
return self;
}
#pragma mark - UIViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
}
#pragma mark - UISplitViewControllerDelegate
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation {
return NO;
}
@end