├── .gitignore ├── JTRevealSidebar ├── JTNavigationBar.h ├── JTNavigationBar.m ├── JTNavigationView.h ├── JTNavigationView.m ├── JTRevealSidebar-Prefix.pch ├── JTRevealSidebarView.h ├── JTRevealSidebarView.m ├── JTTableViewCellFactory.h ├── JTTableViewCellFactory.m ├── JTTableViewCellModal.h ├── JTTableViewCellModal.m ├── JTTableViewDatasource.h └── JTTableViewDatasource.m ├── JTRevealSidebarDemo.podspec ├── JTRevealSidebarDemo.xcodeproj └── project.pbxproj ├── JTRevealSidebarDemo ├── AppDelegate.h ├── AppDelegate.m ├── JTRevealSidebarDemo-Info.plist ├── ViewController.h ├── ViewController.m ├── en.lproj │ ├── InfoPlist.strings │ ├── ViewController_iPad.xib │ └── ViewController_iPhone.xib └── main.m ├── JTRevealSidebarDemoTests ├── JTRevealSidebarDemoTests-Info.plist ├── JTRevealSidebarDemoTests.h ├── JTRevealSidebarDemoTests.m └── en.lproj │ └── InfoPlist.strings ├── JTRevealSidebarDemoV2 ├── AppDelegate.h ├── AppDelegate.m ├── ButtonMenu.png ├── ButtonMenu@2x.png ├── JTRevealSidebarDemoV2-Info.plist ├── JTRevealSidebarDemoV2-Prefix.pch ├── NewViewController.h ├── NewViewController.m ├── SidebarViewController.h ├── SidebarViewController.m ├── ViewController.h ├── ViewController.m ├── en.lproj │ └── InfoPlist.strings └── main.m ├── JTRevealSidebarDemoV2Tests ├── JTRevealSidebarDemoV2Tests-Info.plist ├── JTRevealSidebarDemoV2Tests.h ├── JTRevealSidebarDemoV2Tests.m └── en.lproj │ └── InfoPlist.strings ├── JTRevealSidebarV2 ├── JTRevealSidebarV2Delegate.h ├── UINavigationItem+JTRevealSidebarV2.h ├── UINavigationItem+JTRevealSidebarV2.m ├── UIViewController+JTRevealSidebarV2.h └── UIViewController+JTRevealSidebarV2.m ├── LICENSE ├── README.md ├── demo1.png ├── demo2.png ├── demo3.png ├── demo4.png ├── demo5.png └── demo6.png /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .svn 3 | build 4 | *.xcodeproj/*.mode1v3 5 | *.xcodeproj/*.pbxuser 6 | *.xcodeproj/project.xcworkspace/* 7 | *.xcodeproj/xcuserdata/* 8 | lib_output 9 | DerivedData 10 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTNavigationBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | 12 | @protocol JTNavigationBarDelegate 13 | @optional 14 | - (void)willPopNavigationItemAnimated:(BOOL)animated; 15 | @end 16 | 17 | 18 | @interface JTNavigationBar : UINavigationBar 19 | 20 | @property (nonatomic, assign) id delegate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTNavigationBar.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "JTNavigationBar.h" 10 | 11 | @implementation JTNavigationBar 12 | @synthesize delegate; 13 | 14 | - (UINavigationItem *)popNavigationItemAnimated:(BOOL)animated { 15 | if ([self.delegate respondsToSelector:@selector(willPopNavigationItemAnimated:)]) { 16 | [self.delegate willPopNavigationItemAnimated:animated]; 17 | } 18 | return [super popNavigationItemAnimated:animated]; 19 | } 20 | 21 | - (void)dealloc { 22 | self.delegate = nil; 23 | [super dealloc]; 24 | } 25 | 26 | @end -------------------------------------------------------------------------------- /JTRevealSidebar/JTNavigationView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | 10 | #import 11 | #import "JTNavigationBar.h" 12 | 13 | typedef enum { 14 | JTNavigationViewAnimationStylePush, 15 | JTNavigationViewAnimationStyleCoverUp, 16 | } JTNavigationViewAnimationStyle; 17 | 18 | @interface JTNavigationView : UIView { 19 | NSMutableArray *_views; 20 | JTNavigationBar *_navigationBar; 21 | UINavigationItem *_navigationItem; 22 | UIView *_rootView; 23 | 24 | JTNavigationViewAnimationStyle _animationStyle; 25 | struct { 26 | unsigned int isNavigationBarHidden:1; 27 | } _navigationViewFlags; 28 | } 29 | 30 | // Setting the root view will pop all views in the stack 31 | @property (nonatomic, retain) UIView *rootView; 32 | 33 | - (id)initWithFrame:(CGRect)frame animationStyle:(JTNavigationViewAnimationStyle)style; 34 | 35 | - (void)pushView:(UIView *)view animated:(BOOL)animated; 36 | - (UIView *)popViewAnimated:(BOOL)animated; 37 | - (UIView *)topView; 38 | - (NSArray *)views; 39 | 40 | // Navigation Bar 41 | - (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated; // Default NO 42 | 43 | @end 44 | 45 | 46 | 47 | @interface UIView (UINavigationControllerItem) 48 | 49 | @property(nonatomic, retain) UINavigationItem *navigationItem; 50 | @property (nonatomic, copy) NSString *title; 51 | 52 | @end -------------------------------------------------------------------------------- /JTRevealSidebar/JTNavigationView.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | 10 | #import "JTNavigationView.h" 11 | 12 | #define DEFAULT_NAVIGATION_BAR_HEIGHT 44 13 | 14 | 15 | @interface JTNavigationView () 16 | @end 17 | 18 | @implementation JTNavigationView 19 | 20 | @synthesize rootView = _rootView; 21 | 22 | - (id)initWithFrame:(CGRect)frame { 23 | self = [self initWithFrame:frame animationStyle:JTNavigationViewAnimationStylePush]; 24 | return self; 25 | } 26 | 27 | - (id)initWithFrame:(CGRect)frame animationStyle:(JTNavigationViewAnimationStyle)style { 28 | self = [super initWithFrame:frame]; 29 | if (self) { 30 | _views = [[NSMutableArray alloc] init]; 31 | _animationStyle = style; 32 | 33 | // We will need to have 34 | _navigationBar = [[JTNavigationBar alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(frame), DEFAULT_NAVIGATION_BAR_HEIGHT)]; 35 | _navigationBar.delegate = self; 36 | _navigationBar.autoresizingMask = UIViewAutoresizingFlexibleWidth; 37 | [self addSubview:_navigationBar]; 38 | 39 | UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:self.title]; 40 | [_navigationBar pushNavigationItem:item animated:NO]; 41 | _navigationBar.delegate = self; 42 | _navigationItem = item; 43 | [item release]; 44 | 45 | _navigationViewFlags.isNavigationBarHidden = NO; 46 | } 47 | return self; 48 | } 49 | 50 | - (void)dealloc { 51 | [_navigationBar release]; 52 | [_views release]; 53 | [super dealloc]; 54 | } 55 | 56 | #pragma mark Instance method 57 | 58 | - (void)pushView:(UIView *)view animated:(BOOL)animated { 59 | UIView *existView = [_views lastObject]; 60 | view.transform = CGAffineTransformMakeTranslation(CGRectGetWidth(self.frame), 0); 61 | [self addSubview:view]; 62 | [_views addObject:view]; 63 | 64 | if (animated) { 65 | [UIView beginAnimations:@"pushView" context:view]; 66 | } 67 | 68 | view.transform = CGAffineTransformMakeTranslation(0, 0); 69 | if (existView) { 70 | if (_animationStyle == JTNavigationViewAnimationStylePush) { 71 | existView.transform = CGAffineTransformMakeTranslation(-CGRectGetWidth(self.frame), 0); 72 | } 73 | } 74 | 75 | UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:view.title]; 76 | item.leftBarButtonItem = view.navigationItem.leftBarButtonItem; 77 | item.rightBarButtonItem = view.navigationItem.rightBarButtonItem; 78 | [_navigationBar pushNavigationItem:item animated:animated]; 79 | 80 | [item release]; 81 | 82 | if (animated) { 83 | [UIView commitAnimations]; 84 | } 85 | 86 | [self setNeedsLayout]; 87 | } 88 | 89 | 90 | - (UIView *)popViewAnimated:(BOOL)animated shouldPopNavigationItem:(BOOL)popNavigationItem { 91 | UIView *view = [_views lastObject]; 92 | [_views removeLastObject]; 93 | UIView *previousView = [_views lastObject]; 94 | 95 | if (animated) { 96 | [UIView beginAnimations:@"popView" context:view]; 97 | } 98 | 99 | view.transform = CGAffineTransformMakeTranslation(CGRectGetWidth(self.frame), 0); 100 | if (previousView) { 101 | if (_animationStyle == JTNavigationViewAnimationStylePush) { 102 | previousView.transform = CGAffineTransformMakeTranslation(0, 0); 103 | } 104 | } 105 | 106 | if (animated) { 107 | [UIView commitAnimations]; 108 | } 109 | 110 | [view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.3]; 111 | return view; 112 | } 113 | 114 | - (UIView *)popViewAnimated:(BOOL)animated { 115 | return [self popViewAnimated:animated shouldPopNavigationItem:YES]; 116 | } 117 | 118 | - (UIView *)topView { 119 | return [_views lastObject]; 120 | } 121 | 122 | - (NSArray *)views { 123 | return _views; 124 | } 125 | 126 | - (void)setRootView:(UIView *)rootView { 127 | [_rootView removeFromSuperview], [_rootView autorelease], _rootView = nil; 128 | _rootView = [rootView retain]; 129 | 130 | for (UIView *view in _views) { 131 | [self popViewAnimated:NO]; 132 | } 133 | [_navigationBar setItems:[NSArray arrayWithObject:_navigationItem]]; 134 | 135 | _navigationItem.title = _rootView.title; 136 | // Insert root view to be the bottom most index. 137 | [self insertSubview:_rootView atIndex:0]; 138 | } 139 | 140 | // Auto stretching the views to fit the visible bounds 141 | - (void)layoutSubviews { 142 | int yOffset = _navigationViewFlags.isNavigationBarHidden ? 0 : DEFAULT_NAVIGATION_BAR_HEIGHT; 143 | CGRect bounds = CGRectMake(0, yOffset, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame) - yOffset); 144 | _rootView.frame = bounds; 145 | ((UIView *)[_views lastObject]).frame = bounds; 146 | } 147 | 148 | // Navigation Bar 149 | 150 | - (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated { 151 | if (_navigationViewFlags.isNavigationBarHidden != hidden) { 152 | // Only change state when the state is different 153 | 154 | if (animated) { 155 | [UIView beginAnimations:@"" context:nil]; 156 | } 157 | _navigationBar.transform = CGAffineTransformMakeTranslation(0, hidden ? -DEFAULT_NAVIGATION_BAR_HEIGHT : 0); 158 | 159 | if (animated) { 160 | [UIView commitAnimations]; 161 | } 162 | 163 | _navigationViewFlags.isNavigationBarHidden = hidden; 164 | } 165 | } 166 | 167 | - (UINavigationItem *)navigationItem { 168 | return _navigationItem; 169 | } 170 | 171 | #pragma mark JTNavigationBarDelegate 172 | 173 | - (void)willPopNavigationItemAnimated:(BOOL)animated { 174 | [self popViewAnimated:animated shouldPopNavigationItem:NO]; 175 | } 176 | 177 | @end 178 | 179 | 180 | #import 181 | 182 | @implementation UIView (UINavigationControllerItem) 183 | 184 | static char *navigationItemKey; 185 | 186 | - (UINavigationItem *)navigationItem { 187 | UINavigationItem *item = objc_getAssociatedObject(self, &navigationItemKey); 188 | return item; 189 | } 190 | 191 | - (void)setNavigationItem:(UINavigationItem *)navigationItem { 192 | objc_setAssociatedObject(self, &navigationItemKey, navigationItem, OBJC_ASSOCIATION_RETAIN); 193 | } 194 | 195 | static char *titleKey; 196 | 197 | - (NSString *)title { 198 | NSString *title = objc_getAssociatedObject(self, &titleKey); 199 | return title; 200 | } 201 | 202 | - (void)setTitle:(NSString *)title { 203 | objc_setAssociatedObject(self, &titleKey, title, OBJC_ASSOCIATION_COPY); 204 | } 205 | 206 | @end -------------------------------------------------------------------------------- /JTRevealSidebar/JTRevealSidebar-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'JTRevealSidebarDemo' target in the 'JTRevealSidebarDemo' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTRevealSidebarView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | 10 | #import 11 | 12 | @class JTNavigationView; 13 | 14 | @interface JTRevealSidebarView : UIView { 15 | struct { 16 | unsigned int isShowing:1; 17 | } _state; 18 | } 19 | 20 | @property (nonatomic, retain) JTNavigationView *sidebarView; 21 | @property (nonatomic, retain) JTNavigationView *contentView; 22 | 23 | - (void)revealSidebar:(BOOL)shouldReveal; 24 | - (BOOL)isSidebarShowing; 25 | 26 | + (JTRevealSidebarView *)defaultViewWithFrame:(CGRect)frame; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTRevealSidebarView.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "JTRevealSidebarView.h" 10 | #import "JTNavigationView.h" 11 | 12 | @implementation JTRevealSidebarView 13 | 14 | @synthesize sidebarView, contentView; 15 | 16 | - (id)initWithFrame:(CGRect)frame 17 | { 18 | self = [super initWithFrame:frame]; 19 | if (self) { 20 | // Initialization code 21 | _state.isShowing = 0; 22 | } 23 | return self; 24 | } 25 | 26 | #pragma mark Properties 27 | 28 | - (void)setContentView:(JTNavigationView *)aContentView { 29 | [contentView removeFromSuperview]; 30 | [contentView autorelease], contentView = nil; 31 | contentView = [aContentView retain]; 32 | [self addSubview:aContentView]; 33 | } 34 | 35 | - (void)setSidebarView:(JTNavigationView *)aSidebarView { 36 | [sidebarView removeFromSuperview]; 37 | [sidebarView autorelease], sidebarView = nil; 38 | sidebarView = [aSidebarView retain]; 39 | [self insertSubview:sidebarView atIndex:0]; 40 | } 41 | 42 | - (BOOL)isSidebarShowing { 43 | return _state.isShowing == 1 ? YES : NO; 44 | } 45 | 46 | #pragma mark Instance method 47 | 48 | - (void)revealSidebar:(BOOL)shouldReveal { 49 | [UIView beginAnimations:@"" context:nil]; 50 | [UIView setAnimationDuration:0.3]; 51 | if (shouldReveal) { 52 | contentView.frame = CGRectOffset(contentView.bounds, CGRectGetWidth(sidebarView.frame), 0); 53 | } else { 54 | contentView.frame = contentView.bounds; 55 | } 56 | [UIView commitAnimations]; 57 | _state.isShowing = shouldReveal ? 1 : 0; 58 | } 59 | 60 | #pragma mark Class method 61 | 62 | + (JTRevealSidebarView *)defaultViewWithFrame:(CGRect)frame { 63 | JTRevealSidebarView *revealView = [[JTRevealSidebarView alloc] initWithFrame:frame]; 64 | revealView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 65 | 66 | JTNavigationView *sidebarView = [[[JTNavigationView alloc] initWithFrame:CGRectMake(0, 0, 270, CGRectGetHeight(frame))] autorelease]; 67 | { 68 | [sidebarView setNavigationBarHidden:YES animated:NO]; 69 | sidebarView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleRightMargin; 70 | revealView.sidebarView = sidebarView; 71 | } 72 | 73 | JTNavigationView *contentView = [[[JTNavigationView alloc] initWithFrame:(CGRect){CGPointZero, frame.size} animationStyle:JTNavigationViewAnimationStyleCoverUp] autorelease]; 74 | { 75 | contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 76 | contentView.backgroundColor = [UIColor lightGrayColor]; 77 | revealView.contentView = contentView; 78 | } 79 | 80 | return [revealView autorelease]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTTableViewCellFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @interface JTTableViewCellFactory : NSObject 12 | + (UITableViewCell *)loaderCellWithIdentifier:(NSString *)reuseIdentifier; 13 | @end 14 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTTableViewCellFactory.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "JTTableViewCellFactory.h" 10 | 11 | @implementation JTTableViewCellFactory 12 | 13 | + (UITableViewCell *)loaderCellWithIdentifier:(NSString *)reuseIdentifier { 14 | UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 15 | reuseIdentifier:reuseIdentifier]; 16 | UIActivityIndicatorView *activityIndicator = [[[UIActivityIndicatorView alloc] 17 | initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease]; 18 | [activityIndicator hidesWhenStopped]; 19 | activityIndicator.frame = cell.bounds; 20 | activityIndicator.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 21 | activityIndicator.contentMode = UIViewContentModeCenter; 22 | activityIndicator.backgroundColor = [UIColor clearColor]; 23 | [cell.contentView addSubview:activityIndicator]; 24 | [activityIndicator startAnimating]; 25 | return cell; 26 | } 27 | @end 28 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTTableViewCellModal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | 12 | @protocol JTTableViewCellModal 13 | - (NSString *)title; 14 | @end 15 | 16 | @interface JTTableViewCellModal : NSObject 17 | @property (nonatomic, copy) NSString *title; 18 | + (id)modalWithTitle:(NSString *)title; 19 | @end 20 | 21 | @interface NSString (JTTableViewCellModal) 22 | @end 23 | 24 | 25 | #pragma mark - 26 | @protocol JTTableViewCellModalSimpleType 27 | - (NSInteger)type; 28 | @end 29 | 30 | @interface JTTableViewCellModalSimpleType : JTTableViewCellModal 31 | @property (nonatomic, assign) NSInteger type; 32 | + (id)modalWithTitle:(NSString *)title type:(NSInteger)type; 33 | @end 34 | 35 | 36 | #pragma mark - 37 | 38 | @protocol JTTableViewCellModalLoadingIndicator 39 | @end 40 | 41 | @interface JTTableViewCellModalLoadingIndicator : NSObject 42 | + (id)modal; 43 | @end 44 | 45 | 46 | #pragma mark - 47 | 48 | @protocol JTTableViewCellModalCustom 49 | - (NSDictionary *)info; 50 | @end 51 | 52 | @interface JTTableViewCellModalCustom : NSObject 53 | @property (nonatomic, retain) NSDictionary *info; 54 | + (id)modalWithInfo:(NSDictionary *)info; 55 | @end -------------------------------------------------------------------------------- /JTRevealSidebar/JTTableViewCellModal.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "JTTableViewCellModal.h" 10 | 11 | @implementation JTTableViewCellModal 12 | @synthesize title; 13 | 14 | - (void)dealloc { 15 | [title release]; 16 | [super dealloc]; 17 | } 18 | 19 | + (id)modalWithTitle:(NSString *)title { 20 | JTTableViewCellModal *modal = [[[[self class] alloc] init] autorelease]; 21 | modal.title = title; 22 | return modal; 23 | } 24 | 25 | @end 26 | 27 | @implementation NSString (JTTableViewCellModal) 28 | - (NSString *)title { 29 | return self; 30 | } 31 | @end 32 | 33 | 34 | #pragma mark - 35 | 36 | @implementation JTTableViewCellModalSimpleType 37 | @synthesize type; 38 | + (id)modalWithTitle:(NSString *)title type:(NSInteger)type { 39 | JTTableViewCellModalSimpleType *modal = [[self class] modalWithTitle:title]; 40 | modal.type = type; 41 | return modal; 42 | } 43 | @end 44 | 45 | 46 | #pragma mark - 47 | 48 | @implementation JTTableViewCellModalLoadingIndicator 49 | 50 | + (id)modal { 51 | JTTableViewCellModalLoadingIndicator *modal = [[[[self class] alloc] init] autorelease]; 52 | return modal; 53 | } 54 | 55 | @end 56 | 57 | 58 | #pragma mark - 59 | 60 | @implementation JTTableViewCellModalCustom 61 | @synthesize info; 62 | 63 | - (void)dealloc { 64 | [info release]; 65 | [super dealloc]; 66 | } 67 | 68 | + (id)modalWithInfo:(NSDictionary *)info { 69 | JTTableViewCellModalCustom *modal = [[[[self class] alloc] init] autorelease]; 70 | modal.info = info; 71 | return modal; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTTableViewDatasource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | @protocol JTTableViewCellTypeLoader; 11 | @protocol JTTableViewDatasourceDelegate; 12 | 13 | @interface JTTableViewDatasource : NSObject 14 | 15 | @property (nonatomic, assign) id delegate; 16 | @property (nonatomic, retain) NSDictionary *sourceInfo; 17 | @property (nonatomic, retain) NSArray *sections; 18 | 19 | + (JTTableViewDatasource *)dynamicDatasourceWithDelegate:(id )delegate sourceInfo:(NSDictionary *)sourceInfo; 20 | 21 | //- (void)replaceLoader:(id )loader withObjects:(NSArray *)objects; 22 | 23 | - (void)configureSingleSectionWithArray:(NSArray *)objects; 24 | 25 | @end 26 | 27 | 28 | 29 | @protocol JTTableViewDatasourceDelegate 30 | 31 | - (void)datasource:(JTTableViewDatasource *)datasource 32 | tableView:(UITableView *)tableView 33 | didSelectObject:(NSObject *)object; 34 | 35 | - (UITableViewCell *)datasource:(JTTableViewDatasource *)datasource 36 | tableView:(UITableView *)tableView 37 | cellForObject:(NSObject *)object; 38 | 39 | - (BOOL)datasourceShouldLoad:(JTTableViewDatasource *)datasource; 40 | - (void)datasource:(JTTableViewDatasource *)datasource sectionsDidChanged:(NSArray *)oldSections; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /JTRevealSidebar/JTTableViewDatasource.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "JTTableViewDatasource.h" 10 | //#import "JTTableViewCellTypes.h" 11 | #import "JTTableViewCellModal.h" 12 | 13 | @implementation JTTableViewDatasource 14 | 15 | @synthesize sections, delegate, sourceInfo; 16 | 17 | - (void)dealloc { 18 | [sections release]; 19 | delegate = nil; 20 | [sourceInfo release]; 21 | [super dealloc]; 22 | } 23 | 24 | #pragma mark Instance method 25 | 26 | - (NSObject *)objectAtIndexPath:(NSIndexPath *)indexPath { 27 | return [[self.sections objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; 28 | } 29 | 30 | - (NSArray *)sections { 31 | if ( ! sections) { 32 | BOOL shouldLoad = [self.delegate datasourceShouldLoad:self]; 33 | 34 | if (shouldLoad) { 35 | sections = [[NSArray arrayWithObject: 36 | [NSArray arrayWithObject: 37 | [JTTableViewCellModalLoadingIndicator modal] 38 | ]] 39 | retain]; 40 | } else { 41 | sections = [[NSArray arrayWithObject:[NSArray array]] retain]; 42 | } 43 | } 44 | return sections; 45 | } 46 | 47 | //- (void)replaceLoader:(id )loader withObjects:(NSArray *)objects { 48 | // NSUInteger section = 0; 49 | // NSUInteger row = 0; 50 | // NSUInteger sectionCount = [self.sections count]; 51 | // for (section = 0; section < sectionCount; section++) { 52 | // NSArray *array = [self.sections objectAtIndex:section]; 53 | // row = [array indexOfObject:loader]; 54 | // if (row != NSNotFound) { 55 | // break; 56 | // } 57 | // } 58 | // if (row != NSNotFound) { 59 | // NSMutableArray *copied = [[self.sections mutableCopy] autorelease]; 60 | // NSMutableArray *targetSection = [[[copied objectAtIndex:section] mutableCopy] autorelease]; 61 | // [targetSection removeObjectAtIndex:row]; 62 | // [targetSection insertObjects:objects atIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(row, [objects count])]]; 63 | // 64 | // [copied replaceObjectAtIndex:section withObject:targetSection]; 65 | // 66 | // self.sections = copied; 67 | // } 68 | //} 69 | 70 | 71 | - (void)configureSingleSectionWithArray:(NSArray *)objects { 72 | NSArray *oldSections = sections; 73 | sections = [[NSArray alloc] initWithObjects:objects, nil]; 74 | [self.delegate datasource:self sectionsDidChanged:oldSections]; 75 | } 76 | 77 | #pragma mark UITableViewDatasource 78 | 79 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 80 | return [self.sections count]; 81 | } 82 | 83 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 84 | return [[self.sections objectAtIndex:section] count]; 85 | } 86 | 87 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 88 | UITableViewCell *cell = [self.delegate datasource:self 89 | tableView:tableView 90 | cellForObject:[self objectAtIndexPath:indexPath]]; 91 | // if ([[self objectAtIndexPath:indexPath] conformsToProtocol:@protocol(JTTableViewCellTypeLoader)]) { 92 | // if ([(id )[self objectAtIndexPath:indexPath] datasource]) { 93 | // [self.delegate datasource:self shouldFetchLoader:(id)[self objectAtIndexPath:indexPath]]; 94 | // } 95 | // } 96 | return cell; 97 | } 98 | 99 | #pragma mark UITableViewDelegate 100 | 101 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 102 | [self.delegate datasource:self tableView:tableView didSelectObject:[self objectAtIndexPath:indexPath]]; 103 | } 104 | 105 | #pragma mark NSProxy 106 | 107 | - (void)forwardInvocation:(NSInvocation *)anInvocation { 108 | [anInvocation invokeWithTarget:self.delegate]; 109 | } 110 | 111 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 112 | return [[self.delegate class] instanceMethodSignatureForSelector:aSelector]; 113 | } 114 | 115 | - (BOOL)respondsToSelector:(SEL)aSelector { 116 | if ([self.delegate respondsToSelector:aSelector]) { 117 | return YES; 118 | } 119 | // Use class method for determine whether self response to selector to prevent infinite loop 120 | return [[self class] instancesRespondToSelector:aSelector]; 121 | } 122 | 123 | #pragma mark Class 124 | 125 | + (JTTableViewDatasource *)dynamicDatasourceWithDelegate:(id )delegate sourceInfo:(NSDictionary *)sourceInfo { 126 | JTTableViewDatasource *datasource = [[JTTableViewDatasource alloc] init]; 127 | datasource.delegate = delegate; 128 | datasource.sourceInfo = sourceInfo; 129 | return [datasource autorelease]; 130 | } 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'JTRevealSidebarDemo' 3 | s.version = '2.2.1' 4 | s.license = 'MIT' 5 | s.summary = 'A carefully implemented iOS objective-c library to mimic the sidebar layout of the new Facebook app and Path 2.0 app.' 6 | s.homepage = 'https://github.com/mystcolor/JTRevealSidebarDemo' 7 | s.author = { 'James Tang' => 'mystcolor@gmail.com' } 8 | s.source = { :git => 'https://github.com/mystcolor/JTRevealSidebarDemo.git', :tag => '2.2.1' } 9 | s.description = 'An iOS objective-c library template for mimic the sidebar layout of the new Facebook app and the Path app. JTRevealSidebarV2 is aimed to be a truly flexible and reusable solution for this which has been carefully implemented. It has been developed under iOS 4.3 and 5.0 devices, sample code has been built using ARC, but the library itself should be both ARC and non-ARC compatible.' 10 | s.platform = :ios 11 | s.source_files = 'JTRevealSidebarV2/*.{h,m}' 12 | s.frameworks = 'QuartzCore' 13 | s.requires_arc = true 14 | end 15 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A057B6E1495400F0069D7AD /* NewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A057B6D1495400F0069D7AD /* NewViewController.m */; }; 11 | 1A057B7A149547F20069D7AD /* ButtonMenu.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A057B78149547F10069D7AD /* ButtonMenu.png */; }; 12 | 1A057B7B149547F20069D7AD /* ButtonMenu@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A057B79149547F10069D7AD /* ButtonMenu@2x.png */; }; 13 | 1A0883FC14D6FEB500628D99 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0883FB14D6FEB500628D99 /* QuartzCore.framework */; }; 14 | 1A617E8D148FC4A6005EC465 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708514446391002EE1B0 /* UIKit.framework */; }; 15 | 1A617E8E148FC4A6005EC465 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708714446391002EE1B0 /* Foundation.framework */; }; 16 | 1A617E8F148FC4A6005EC465 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708914446392002EE1B0 /* CoreGraphics.framework */; }; 17 | 1A617E95148FC4A7005EC465 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A617E93148FC4A7005EC465 /* InfoPlist.strings */; }; 18 | 1A617E97148FC4A7005EC465 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A617E96148FC4A7005EC465 /* main.m */; }; 19 | 1A617E9B148FC4A7005EC465 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A617E9A148FC4A7005EC465 /* AppDelegate.m */; }; 20 | 1A617EA2148FC4A7005EC465 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD470A614446392002EE1B0 /* SenTestingKit.framework */; }; 21 | 1A617EA3148FC4A7005EC465 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708514446391002EE1B0 /* UIKit.framework */; }; 22 | 1A617EA4148FC4A7005EC465 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708714446391002EE1B0 /* Foundation.framework */; }; 23 | 1A617EAC148FC4A7005EC465 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A617EAA148FC4A7005EC465 /* InfoPlist.strings */; }; 24 | 1A617EAF148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A617EAE148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.m */; }; 25 | 1A617EB9148FC4DB005EC465 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A617EB8148FC4DB005EC465 /* ViewController.m */; }; 26 | 1A81A5D814951CEF00BF03B8 /* SidebarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A81A5D714951CEE00BF03B8 /* SidebarViewController.m */; }; 27 | 1AD4708614446391002EE1B0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708514446391002EE1B0 /* UIKit.framework */; }; 28 | 1AD4708814446392002EE1B0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708714446391002EE1B0 /* Foundation.framework */; }; 29 | 1AD4708A14446392002EE1B0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708914446392002EE1B0 /* CoreGraphics.framework */; }; 30 | 1AD4709014446392002EE1B0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1AD4708E14446392002EE1B0 /* InfoPlist.strings */; }; 31 | 1AD4709214446392002EE1B0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD4709114446392002EE1B0 /* main.m */; }; 32 | 1AD4709614446392002EE1B0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD4709514446392002EE1B0 /* AppDelegate.m */; }; 33 | 1AD4709914446392002EE1B0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD4709814446392002EE1B0 /* ViewController.m */; }; 34 | 1AD4709C14446392002EE1B0 /* ViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1AD4709A14446392002EE1B0 /* ViewController_iPhone.xib */; }; 35 | 1AD4709F14446392002EE1B0 /* ViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1AD4709D14446392002EE1B0 /* ViewController_iPad.xib */; }; 36 | 1AD470A714446392002EE1B0 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD470A614446392002EE1B0 /* SenTestingKit.framework */; }; 37 | 1AD470A814446392002EE1B0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708514446391002EE1B0 /* UIKit.framework */; }; 38 | 1AD470A914446392002EE1B0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708714446391002EE1B0 /* Foundation.framework */; }; 39 | 1AD470B114446392002EE1B0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1AD470AF14446392002EE1B0 /* InfoPlist.strings */; }; 40 | 1AD470B414446392002EE1B0 /* JTRevealSidebarDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD470B314446392002EE1B0 /* JTRevealSidebarDemoTests.m */; }; 41 | 37E67F211591080200043822 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708714446391002EE1B0 /* Foundation.framework */; }; 42 | 37E67F2B1591086200043822 /* UINavigationItem+JTRevealSidebarV2.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A617EC0148FC612005EC465 /* UINavigationItem+JTRevealSidebarV2.m */; }; 43 | 37E67F2C1591086200043822 /* UIViewController+JTRevealSidebarV2.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A617EC3148FC706005EC465 /* UIViewController+JTRevealSidebarV2.m */; }; 44 | 37E67F2D1591088A00043822 /* JTRevealSidebarV2Delegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A617EBB148FC5B4005EC465 /* JTRevealSidebarV2Delegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 45 | 37E67F2E1591088A00043822 /* UINavigationItem+JTRevealSidebarV2.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A617EBF148FC612005EC465 /* UINavigationItem+JTRevealSidebarV2.h */; settings = {ATTRIBUTES = (Public, ); }; }; 46 | 37E67F2F1591088A00043822 /* UIViewController+JTRevealSidebarV2.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A617EC2148FC706005EC465 /* UIViewController+JTRevealSidebarV2.h */; settings = {ATTRIBUTES = (Public, ); }; }; 47 | 37E67F30159108A900043822 /* libJTRevealSidebarV2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 37E67F201591080200043822 /* libJTRevealSidebarV2.a */; }; 48 | 37E67F38159109C500043822 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708714446391002EE1B0 /* Foundation.framework */; }; 49 | 37E67F4215910A0600043822 /* JTRevealSidebarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD470BF144463B4002EE1B0 /* JTRevealSidebarView.m */; }; 50 | 37E67F4315910A0600043822 /* JTNavigationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A89988C1445FBDB001C5FFB /* JTNavigationView.m */; }; 51 | 37E67F4415910A0600043822 /* JTNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ACADFF9145720F4000F5E15 /* JTNavigationBar.m */; }; 52 | 37E67F4515910A0600043822 /* JTTableViewDatasource.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AE7FCB3144F43020050B97E /* JTTableViewDatasource.m */; }; 53 | 37E67F4615910A0600043822 /* JTTableViewCellFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AE7FCB7144F461C0050B97E /* JTTableViewCellFactory.m */; }; 54 | 37E67F4715910A0600043822 /* JTTableViewCellModal.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AE7FCBA144F4BAD0050B97E /* JTTableViewCellModal.m */; }; 55 | 37E67F4815910A0F00043822 /* libJTRevealSidebar.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 37E67F37159109C500043822 /* libJTRevealSidebar.a */; }; 56 | 37E67F4B15910A3800043822 /* JTRevealSidebarView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD470BE144463B4002EE1B0 /* JTRevealSidebarView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 57 | 37E67F4C15910A3800043822 /* JTNavigationView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A89988B1445FBDB001C5FFB /* JTNavigationView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 58 | 37E67F4D15910A3800043822 /* JTNavigationBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACADFF8145720F4000F5E15 /* JTNavigationBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; 59 | 37E67F4E15910A3800043822 /* JTTableViewDatasource.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE7FCB2144F43020050B97E /* JTTableViewDatasource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 60 | 37E67F4F15910A3800043822 /* JTTableViewCellFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE7FCB6144F461C0050B97E /* JTTableViewCellFactory.h */; settings = {ATTRIBUTES = (Public, ); }; }; 61 | 37E67F5015910A3800043822 /* JTTableViewCellModal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE7FCB9144F4BAD0050B97E /* JTTableViewCellModal.h */; settings = {ATTRIBUTES = (Public, ); }; }; 62 | 37E67F5115910A8800043822 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708514446391002EE1B0 /* UIKit.framework */; }; 63 | 37E67F5215910AE200043822 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AD4708914446392002EE1B0 /* CoreGraphics.framework */; }; 64 | 37E67F5415910B6E00043822 /* JTRevealSidebar-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 37E67F5315910B6E00043822 /* JTRevealSidebar-Prefix.pch */; }; 65 | /* End PBXBuildFile section */ 66 | 67 | /* Begin PBXContainerItemProxy section */ 68 | 1A617EA5148FC4A7005EC465 /* PBXContainerItemProxy */ = { 69 | isa = PBXContainerItemProxy; 70 | containerPortal = 1AD4707814446391002EE1B0 /* Project object */; 71 | proxyType = 1; 72 | remoteGlobalIDString = 1A617E8A148FC4A6005EC465; 73 | remoteInfo = JTRevealSidebarDemoV2; 74 | }; 75 | 1AD470AA14446392002EE1B0 /* PBXContainerItemProxy */ = { 76 | isa = PBXContainerItemProxy; 77 | containerPortal = 1AD4707814446391002EE1B0 /* Project object */; 78 | proxyType = 1; 79 | remoteGlobalIDString = 1AD4708014446391002EE1B0; 80 | remoteInfo = JTRevealSidebarDemo; 81 | }; 82 | 37E67F311591094900043822 /* PBXContainerItemProxy */ = { 83 | isa = PBXContainerItemProxy; 84 | containerPortal = 1AD4707814446391002EE1B0 /* Project object */; 85 | proxyType = 1; 86 | remoteGlobalIDString = 37E67F1F1591080200043822; 87 | remoteInfo = JTRevealSidebarV2; 88 | }; 89 | 37E67F4915910A1300043822 /* PBXContainerItemProxy */ = { 90 | isa = PBXContainerItemProxy; 91 | containerPortal = 1AD4707814446391002EE1B0 /* Project object */; 92 | proxyType = 1; 93 | remoteGlobalIDString = 37E67F36159109C500043822; 94 | remoteInfo = JTRevealSidebar; 95 | }; 96 | /* End PBXContainerItemProxy section */ 97 | 98 | /* Begin PBXFileReference section */ 99 | 1A057B6C1495400F0069D7AD /* NewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewViewController.h; sourceTree = ""; }; 100 | 1A057B6D1495400F0069D7AD /* NewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewViewController.m; sourceTree = ""; }; 101 | 1A057B78149547F10069D7AD /* ButtonMenu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ButtonMenu.png; sourceTree = ""; }; 102 | 1A057B79149547F10069D7AD /* ButtonMenu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ButtonMenu@2x.png"; sourceTree = ""; }; 103 | 1A0883FB14D6FEB500628D99 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 104 | 1A617E8B148FC4A6005EC465 /* JTRevealSidebarDemoV2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JTRevealSidebarDemoV2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 105 | 1A617E92148FC4A7005EC465 /* JTRevealSidebarDemoV2-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JTRevealSidebarDemoV2-Info.plist"; sourceTree = ""; }; 106 | 1A617E94148FC4A7005EC465 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 107 | 1A617E96148FC4A7005EC465 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 108 | 1A617E98148FC4A7005EC465 /* JTRevealSidebarDemoV2-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JTRevealSidebarDemoV2-Prefix.pch"; sourceTree = ""; }; 109 | 1A617E99148FC4A7005EC465 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 110 | 1A617E9A148FC4A7005EC465 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 111 | 1A617EA1148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JTRevealSidebarDemoV2Tests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 112 | 1A617EA9148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JTRevealSidebarDemoV2Tests-Info.plist"; sourceTree = ""; }; 113 | 1A617EAB148FC4A7005EC465 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 114 | 1A617EAD148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JTRevealSidebarDemoV2Tests.h; sourceTree = ""; }; 115 | 1A617EAE148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JTRevealSidebarDemoV2Tests.m; sourceTree = ""; }; 116 | 1A617EB7148FC4DB005EC465 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 117 | 1A617EB8148FC4DB005EC465 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 118 | 1A617EBB148FC5B4005EC465 /* JTRevealSidebarV2Delegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JTRevealSidebarV2Delegate.h; sourceTree = ""; }; 119 | 1A617EBF148FC612005EC465 /* UINavigationItem+JTRevealSidebarV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationItem+JTRevealSidebarV2.h"; sourceTree = ""; }; 120 | 1A617EC0148FC612005EC465 /* UINavigationItem+JTRevealSidebarV2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationItem+JTRevealSidebarV2.m"; sourceTree = ""; }; 121 | 1A617EC2148FC706005EC465 /* UIViewController+JTRevealSidebarV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+JTRevealSidebarV2.h"; sourceTree = ""; }; 122 | 1A617EC3148FC706005EC465 /* UIViewController+JTRevealSidebarV2.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+JTRevealSidebarV2.m"; sourceTree = ""; }; 123 | 1A81A5D614951CEE00BF03B8 /* SidebarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SidebarViewController.h; sourceTree = ""; }; 124 | 1A81A5D714951CEE00BF03B8 /* SidebarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SidebarViewController.m; sourceTree = ""; }; 125 | 1A89988B1445FBDB001C5FFB /* JTNavigationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JTNavigationView.h; sourceTree = ""; }; 126 | 1A89988C1445FBDB001C5FFB /* JTNavigationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JTNavigationView.m; sourceTree = ""; }; 127 | 1ACADFF8145720F4000F5E15 /* JTNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JTNavigationBar.h; sourceTree = ""; }; 128 | 1ACADFF9145720F4000F5E15 /* JTNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JTNavigationBar.m; sourceTree = ""; }; 129 | 1AD4708114446391002EE1B0 /* JTRevealSidebarDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JTRevealSidebarDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 130 | 1AD4708514446391002EE1B0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 131 | 1AD4708714446391002EE1B0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 132 | 1AD4708914446392002EE1B0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 133 | 1AD4708D14446392002EE1B0 /* JTRevealSidebarDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JTRevealSidebarDemo-Info.plist"; sourceTree = ""; }; 134 | 1AD4708F14446392002EE1B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 135 | 1AD4709114446392002EE1B0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 136 | 1AD4709414446392002EE1B0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 137 | 1AD4709514446392002EE1B0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 138 | 1AD4709714446392002EE1B0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 139 | 1AD4709814446392002EE1B0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 140 | 1AD4709B14446392002EE1B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPhone.xib; sourceTree = ""; }; 141 | 1AD4709E14446392002EE1B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/ViewController_iPad.xib; sourceTree = ""; }; 142 | 1AD470A514446392002EE1B0 /* JTRevealSidebarDemoTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JTRevealSidebarDemoTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 143 | 1AD470A614446392002EE1B0 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 144 | 1AD470AE14446392002EE1B0 /* JTRevealSidebarDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JTRevealSidebarDemoTests-Info.plist"; sourceTree = ""; }; 145 | 1AD470B014446392002EE1B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 146 | 1AD470B214446392002EE1B0 /* JTRevealSidebarDemoTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JTRevealSidebarDemoTests.h; sourceTree = ""; }; 147 | 1AD470B314446392002EE1B0 /* JTRevealSidebarDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JTRevealSidebarDemoTests.m; sourceTree = ""; }; 148 | 1AD470BE144463B4002EE1B0 /* JTRevealSidebarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JTRevealSidebarView.h; sourceTree = ""; }; 149 | 1AD470BF144463B4002EE1B0 /* JTRevealSidebarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JTRevealSidebarView.m; sourceTree = ""; }; 150 | 1AE7FCB2144F43020050B97E /* JTTableViewDatasource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JTTableViewDatasource.h; sourceTree = ""; }; 151 | 1AE7FCB3144F43020050B97E /* JTTableViewDatasource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JTTableViewDatasource.m; sourceTree = ""; }; 152 | 1AE7FCB6144F461C0050B97E /* JTTableViewCellFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JTTableViewCellFactory.h; sourceTree = ""; }; 153 | 1AE7FCB7144F461C0050B97E /* JTTableViewCellFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JTTableViewCellFactory.m; sourceTree = ""; }; 154 | 1AE7FCB9144F4BAD0050B97E /* JTTableViewCellModal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JTTableViewCellModal.h; sourceTree = ""; }; 155 | 1AE7FCBA144F4BAD0050B97E /* JTTableViewCellModal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JTTableViewCellModal.m; sourceTree = ""; }; 156 | 37E67F201591080200043822 /* libJTRevealSidebarV2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJTRevealSidebarV2.a; sourceTree = BUILT_PRODUCTS_DIR; }; 157 | 37E67F37159109C500043822 /* libJTRevealSidebar.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJTRevealSidebar.a; sourceTree = BUILT_PRODUCTS_DIR; }; 158 | 37E67F5315910B6E00043822 /* JTRevealSidebar-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JTRevealSidebar-Prefix.pch"; sourceTree = ""; }; 159 | /* End PBXFileReference section */ 160 | 161 | /* Begin PBXFrameworksBuildPhase section */ 162 | 1A617E88148FC4A6005EC465 /* Frameworks */ = { 163 | isa = PBXFrameworksBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | 37E67F30159108A900043822 /* libJTRevealSidebarV2.a in Frameworks */, 167 | 1A0883FC14D6FEB500628D99 /* QuartzCore.framework in Frameworks */, 168 | 1A617E8D148FC4A6005EC465 /* UIKit.framework in Frameworks */, 169 | 1A617E8E148FC4A6005EC465 /* Foundation.framework in Frameworks */, 170 | 1A617E8F148FC4A6005EC465 /* CoreGraphics.framework in Frameworks */, 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | 1A617E9D148FC4A7005EC465 /* Frameworks */ = { 175 | isa = PBXFrameworksBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 1A617EA2148FC4A7005EC465 /* SenTestingKit.framework in Frameworks */, 179 | 1A617EA3148FC4A7005EC465 /* UIKit.framework in Frameworks */, 180 | 1A617EA4148FC4A7005EC465 /* Foundation.framework in Frameworks */, 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | 1AD4707E14446391002EE1B0 /* Frameworks */ = { 185 | isa = PBXFrameworksBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | 37E67F4815910A0F00043822 /* libJTRevealSidebar.a in Frameworks */, 189 | 1AD4708614446391002EE1B0 /* UIKit.framework in Frameworks */, 190 | 1AD4708814446392002EE1B0 /* Foundation.framework in Frameworks */, 191 | 1AD4708A14446392002EE1B0 /* CoreGraphics.framework in Frameworks */, 192 | ); 193 | runOnlyForDeploymentPostprocessing = 0; 194 | }; 195 | 1AD470A114446392002EE1B0 /* Frameworks */ = { 196 | isa = PBXFrameworksBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | 1AD470A714446392002EE1B0 /* SenTestingKit.framework in Frameworks */, 200 | 1AD470A814446392002EE1B0 /* UIKit.framework in Frameworks */, 201 | 1AD470A914446392002EE1B0 /* Foundation.framework in Frameworks */, 202 | ); 203 | runOnlyForDeploymentPostprocessing = 0; 204 | }; 205 | 37E67F1D1591080200043822 /* Frameworks */ = { 206 | isa = PBXFrameworksBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 37E67F211591080200043822 /* Foundation.framework in Frameworks */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | 37E67F34159109C500043822 /* Frameworks */ = { 214 | isa = PBXFrameworksBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | 37E67F5215910AE200043822 /* CoreGraphics.framework in Frameworks */, 218 | 37E67F5115910A8800043822 /* UIKit.framework in Frameworks */, 219 | 37E67F38159109C500043822 /* Foundation.framework in Frameworks */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXFrameworksBuildPhase section */ 224 | 225 | /* Begin PBXGroup section */ 226 | 1A617E90148FC4A6005EC465 /* JTRevealSidebarDemoV2 */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | 1A617E99148FC4A7005EC465 /* AppDelegate.h */, 230 | 1A617E9A148FC4A7005EC465 /* AppDelegate.m */, 231 | 1A617EB7148FC4DB005EC465 /* ViewController.h */, 232 | 1A617EB8148FC4DB005EC465 /* ViewController.m */, 233 | 1A81A5D614951CEE00BF03B8 /* SidebarViewController.h */, 234 | 1A81A5D714951CEE00BF03B8 /* SidebarViewController.m */, 235 | 1A057B6C1495400F0069D7AD /* NewViewController.h */, 236 | 1A057B6D1495400F0069D7AD /* NewViewController.m */, 237 | 1A617E91148FC4A7005EC465 /* Supporting Files */, 238 | ); 239 | path = JTRevealSidebarDemoV2; 240 | sourceTree = ""; 241 | }; 242 | 1A617E91148FC4A7005EC465 /* Supporting Files */ = { 243 | isa = PBXGroup; 244 | children = ( 245 | 1A057B78149547F10069D7AD /* ButtonMenu.png */, 246 | 1A057B79149547F10069D7AD /* ButtonMenu@2x.png */, 247 | 1A617E92148FC4A7005EC465 /* JTRevealSidebarDemoV2-Info.plist */, 248 | 1A617E93148FC4A7005EC465 /* InfoPlist.strings */, 249 | 1A617E96148FC4A7005EC465 /* main.m */, 250 | 1A617E98148FC4A7005EC465 /* JTRevealSidebarDemoV2-Prefix.pch */, 251 | ); 252 | name = "Supporting Files"; 253 | sourceTree = ""; 254 | }; 255 | 1A617EA7148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests */ = { 256 | isa = PBXGroup; 257 | children = ( 258 | 1A617EAD148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.h */, 259 | 1A617EAE148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.m */, 260 | 1A617EA8148FC4A7005EC465 /* Supporting Files */, 261 | ); 262 | path = JTRevealSidebarDemoV2Tests; 263 | sourceTree = ""; 264 | }; 265 | 1A617EA8148FC4A7005EC465 /* Supporting Files */ = { 266 | isa = PBXGroup; 267 | children = ( 268 | 1A617EA9148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests-Info.plist */, 269 | 1A617EAA148FC4A7005EC465 /* InfoPlist.strings */, 270 | ); 271 | name = "Supporting Files"; 272 | sourceTree = ""; 273 | }; 274 | 1A617EBA148FC4FB005EC465 /* JTRevealSidebarV2 */ = { 275 | isa = PBXGroup; 276 | children = ( 277 | 1A617EBB148FC5B4005EC465 /* JTRevealSidebarV2Delegate.h */, 278 | 1A617EBF148FC612005EC465 /* UINavigationItem+JTRevealSidebarV2.h */, 279 | 1A617EC0148FC612005EC465 /* UINavigationItem+JTRevealSidebarV2.m */, 280 | 1A617EC2148FC706005EC465 /* UIViewController+JTRevealSidebarV2.h */, 281 | 1A617EC3148FC706005EC465 /* UIViewController+JTRevealSidebarV2.m */, 282 | ); 283 | path = JTRevealSidebarV2; 284 | sourceTree = ""; 285 | }; 286 | 1AD4707614446391002EE1B0 = { 287 | isa = PBXGroup; 288 | children = ( 289 | 1AD470BD144463B4002EE1B0 /* JTRevealSidebar */, 290 | 1AD4708B14446392002EE1B0 /* JTRevealSidebarDemo */, 291 | 1AD470AC14446392002EE1B0 /* JTRevealSidebarDemoTests */, 292 | 1A617EBA148FC4FB005EC465 /* JTRevealSidebarV2 */, 293 | 1A617E90148FC4A6005EC465 /* JTRevealSidebarDemoV2 */, 294 | 1A617EA7148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests */, 295 | 1AD4708414446391002EE1B0 /* Frameworks */, 296 | 1AD4708214446391002EE1B0 /* Products */, 297 | ); 298 | sourceTree = ""; 299 | }; 300 | 1AD4708214446391002EE1B0 /* Products */ = { 301 | isa = PBXGroup; 302 | children = ( 303 | 1AD4708114446391002EE1B0 /* JTRevealSidebarDemo.app */, 304 | 1AD470A514446392002EE1B0 /* JTRevealSidebarDemoTests.octest */, 305 | 1A617E8B148FC4A6005EC465 /* JTRevealSidebarDemoV2.app */, 306 | 1A617EA1148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.octest */, 307 | 37E67F201591080200043822 /* libJTRevealSidebarV2.a */, 308 | 37E67F37159109C500043822 /* libJTRevealSidebar.a */, 309 | ); 310 | name = Products; 311 | sourceTree = ""; 312 | }; 313 | 1AD4708414446391002EE1B0 /* Frameworks */ = { 314 | isa = PBXGroup; 315 | children = ( 316 | 1A0883FB14D6FEB500628D99 /* QuartzCore.framework */, 317 | 1AD4708514446391002EE1B0 /* UIKit.framework */, 318 | 1AD4708714446391002EE1B0 /* Foundation.framework */, 319 | 1AD4708914446392002EE1B0 /* CoreGraphics.framework */, 320 | 1AD470A614446392002EE1B0 /* SenTestingKit.framework */, 321 | ); 322 | name = Frameworks; 323 | sourceTree = ""; 324 | }; 325 | 1AD4708B14446392002EE1B0 /* JTRevealSidebarDemo */ = { 326 | isa = PBXGroup; 327 | children = ( 328 | 1AD4709414446392002EE1B0 /* AppDelegate.h */, 329 | 1AD4709514446392002EE1B0 /* AppDelegate.m */, 330 | 1AD4709714446392002EE1B0 /* ViewController.h */, 331 | 1AD4709814446392002EE1B0 /* ViewController.m */, 332 | 1AD4709A14446392002EE1B0 /* ViewController_iPhone.xib */, 333 | 1AD4709D14446392002EE1B0 /* ViewController_iPad.xib */, 334 | 1AD4708C14446392002EE1B0 /* Supporting Files */, 335 | ); 336 | path = JTRevealSidebarDemo; 337 | sourceTree = ""; 338 | }; 339 | 1AD4708C14446392002EE1B0 /* Supporting Files */ = { 340 | isa = PBXGroup; 341 | children = ( 342 | 1AD4708D14446392002EE1B0 /* JTRevealSidebarDemo-Info.plist */, 343 | 1AD4708E14446392002EE1B0 /* InfoPlist.strings */, 344 | 1AD4709114446392002EE1B0 /* main.m */, 345 | ); 346 | name = "Supporting Files"; 347 | sourceTree = ""; 348 | }; 349 | 1AD470AC14446392002EE1B0 /* JTRevealSidebarDemoTests */ = { 350 | isa = PBXGroup; 351 | children = ( 352 | 1AD470B214446392002EE1B0 /* JTRevealSidebarDemoTests.h */, 353 | 1AD470B314446392002EE1B0 /* JTRevealSidebarDemoTests.m */, 354 | 1AD470AD14446392002EE1B0 /* Supporting Files */, 355 | ); 356 | path = JTRevealSidebarDemoTests; 357 | sourceTree = ""; 358 | }; 359 | 1AD470AD14446392002EE1B0 /* Supporting Files */ = { 360 | isa = PBXGroup; 361 | children = ( 362 | 1AD470AE14446392002EE1B0 /* JTRevealSidebarDemoTests-Info.plist */, 363 | 1AD470AF14446392002EE1B0 /* InfoPlist.strings */, 364 | ); 365 | name = "Supporting Files"; 366 | sourceTree = ""; 367 | }; 368 | 1AD470BD144463B4002EE1B0 /* JTRevealSidebar */ = { 369 | isa = PBXGroup; 370 | children = ( 371 | 37E67F5315910B6E00043822 /* JTRevealSidebar-Prefix.pch */, 372 | 1AD470BE144463B4002EE1B0 /* JTRevealSidebarView.h */, 373 | 1AD470BF144463B4002EE1B0 /* JTRevealSidebarView.m */, 374 | 1A89988B1445FBDB001C5FFB /* JTNavigationView.h */, 375 | 1A89988C1445FBDB001C5FFB /* JTNavigationView.m */, 376 | 1ACADFF8145720F4000F5E15 /* JTNavigationBar.h */, 377 | 1ACADFF9145720F4000F5E15 /* JTNavigationBar.m */, 378 | 1AE7FCB2144F43020050B97E /* JTTableViewDatasource.h */, 379 | 1AE7FCB3144F43020050B97E /* JTTableViewDatasource.m */, 380 | 1AE7FCB6144F461C0050B97E /* JTTableViewCellFactory.h */, 381 | 1AE7FCB7144F461C0050B97E /* JTTableViewCellFactory.m */, 382 | 1AE7FCB9144F4BAD0050B97E /* JTTableViewCellModal.h */, 383 | 1AE7FCBA144F4BAD0050B97E /* JTTableViewCellModal.m */, 384 | ); 385 | path = JTRevealSidebar; 386 | sourceTree = ""; 387 | }; 388 | /* End PBXGroup section */ 389 | 390 | /* Begin PBXHeadersBuildPhase section */ 391 | 37E67F1E1591080200043822 /* Headers */ = { 392 | isa = PBXHeadersBuildPhase; 393 | buildActionMask = 2147483647; 394 | files = ( 395 | 37E67F2D1591088A00043822 /* JTRevealSidebarV2Delegate.h in Headers */, 396 | 37E67F2E1591088A00043822 /* UINavigationItem+JTRevealSidebarV2.h in Headers */, 397 | 37E67F2F1591088A00043822 /* UIViewController+JTRevealSidebarV2.h in Headers */, 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | }; 401 | 37E67F35159109C500043822 /* Headers */ = { 402 | isa = PBXHeadersBuildPhase; 403 | buildActionMask = 2147483647; 404 | files = ( 405 | 37E67F4B15910A3800043822 /* JTRevealSidebarView.h in Headers */, 406 | 37E67F4C15910A3800043822 /* JTNavigationView.h in Headers */, 407 | 37E67F4D15910A3800043822 /* JTNavigationBar.h in Headers */, 408 | 37E67F4E15910A3800043822 /* JTTableViewDatasource.h in Headers */, 409 | 37E67F4F15910A3800043822 /* JTTableViewCellFactory.h in Headers */, 410 | 37E67F5015910A3800043822 /* JTTableViewCellModal.h in Headers */, 411 | 37E67F5415910B6E00043822 /* JTRevealSidebar-Prefix.pch in Headers */, 412 | ); 413 | runOnlyForDeploymentPostprocessing = 0; 414 | }; 415 | /* End PBXHeadersBuildPhase section */ 416 | 417 | /* Begin PBXNativeTarget section */ 418 | 1A617E8A148FC4A6005EC465 /* JTRevealSidebarDemoV2 */ = { 419 | isa = PBXNativeTarget; 420 | buildConfigurationList = 1A617EB4148FC4A7005EC465 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemoV2" */; 421 | buildPhases = ( 422 | 1A617E87148FC4A6005EC465 /* Sources */, 423 | 1A617E88148FC4A6005EC465 /* Frameworks */, 424 | 1A617E89148FC4A6005EC465 /* Resources */, 425 | ); 426 | buildRules = ( 427 | ); 428 | dependencies = ( 429 | 37E67F321591094900043822 /* PBXTargetDependency */, 430 | ); 431 | name = JTRevealSidebarDemoV2; 432 | productName = JTRevealSidebarDemoV2; 433 | productReference = 1A617E8B148FC4A6005EC465 /* JTRevealSidebarDemoV2.app */; 434 | productType = "com.apple.product-type.application"; 435 | }; 436 | 1A617EA0148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests */ = { 437 | isa = PBXNativeTarget; 438 | buildConfigurationList = 1A617EB5148FC4A7005EC465 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemoV2Tests" */; 439 | buildPhases = ( 440 | 1A617E9C148FC4A7005EC465 /* Sources */, 441 | 1A617E9D148FC4A7005EC465 /* Frameworks */, 442 | 1A617E9E148FC4A7005EC465 /* Resources */, 443 | 1A617E9F148FC4A7005EC465 /* ShellScript */, 444 | ); 445 | buildRules = ( 446 | ); 447 | dependencies = ( 448 | 1A617EA6148FC4A7005EC465 /* PBXTargetDependency */, 449 | ); 450 | name = JTRevealSidebarDemoV2Tests; 451 | productName = JTRevealSidebarDemoV2Tests; 452 | productReference = 1A617EA1148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.octest */; 453 | productType = "com.apple.product-type.bundle"; 454 | }; 455 | 1AD4708014446391002EE1B0 /* JTRevealSidebarDemo */ = { 456 | isa = PBXNativeTarget; 457 | buildConfigurationList = 1AD470B714446392002EE1B0 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemo" */; 458 | buildPhases = ( 459 | 1AD4707D14446391002EE1B0 /* Sources */, 460 | 1AD4707E14446391002EE1B0 /* Frameworks */, 461 | 1AD4707F14446391002EE1B0 /* Resources */, 462 | ); 463 | buildRules = ( 464 | ); 465 | dependencies = ( 466 | 37E67F4A15910A1300043822 /* PBXTargetDependency */, 467 | ); 468 | name = JTRevealSidebarDemo; 469 | productName = JTRevealSidebarDemo; 470 | productReference = 1AD4708114446391002EE1B0 /* JTRevealSidebarDemo.app */; 471 | productType = "com.apple.product-type.application"; 472 | }; 473 | 1AD470A414446392002EE1B0 /* JTRevealSidebarDemoTests */ = { 474 | isa = PBXNativeTarget; 475 | buildConfigurationList = 1AD470BA14446392002EE1B0 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemoTests" */; 476 | buildPhases = ( 477 | 1AD470A014446392002EE1B0 /* Sources */, 478 | 1AD470A114446392002EE1B0 /* Frameworks */, 479 | 1AD470A214446392002EE1B0 /* Resources */, 480 | 1AD470A314446392002EE1B0 /* ShellScript */, 481 | ); 482 | buildRules = ( 483 | ); 484 | dependencies = ( 485 | 1AD470AB14446392002EE1B0 /* PBXTargetDependency */, 486 | ); 487 | name = JTRevealSidebarDemoTests; 488 | productName = JTRevealSidebarDemoTests; 489 | productReference = 1AD470A514446392002EE1B0 /* JTRevealSidebarDemoTests.octest */; 490 | productType = "com.apple.product-type.bundle"; 491 | }; 492 | 37E67F1F1591080200043822 /* JTRevealSidebarV2 */ = { 493 | isa = PBXNativeTarget; 494 | buildConfigurationList = 37E67F281591080200043822 /* Build configuration list for PBXNativeTarget "JTRevealSidebarV2" */; 495 | buildPhases = ( 496 | 37E67F1C1591080200043822 /* Sources */, 497 | 37E67F1D1591080200043822 /* Frameworks */, 498 | 37E67F1E1591080200043822 /* Headers */, 499 | ); 500 | buildRules = ( 501 | ); 502 | dependencies = ( 503 | ); 504 | name = JTRevealSidebarV2; 505 | productName = JTRevealSidebarV2; 506 | productReference = 37E67F201591080200043822 /* libJTRevealSidebarV2.a */; 507 | productType = "com.apple.product-type.library.static"; 508 | }; 509 | 37E67F36159109C500043822 /* JTRevealSidebar */ = { 510 | isa = PBXNativeTarget; 511 | buildConfigurationList = 37E67F3F159109C500043822 /* Build configuration list for PBXNativeTarget "JTRevealSidebar" */; 512 | buildPhases = ( 513 | 37E67F33159109C500043822 /* Sources */, 514 | 37E67F34159109C500043822 /* Frameworks */, 515 | 37E67F35159109C500043822 /* Headers */, 516 | ); 517 | buildRules = ( 518 | ); 519 | dependencies = ( 520 | ); 521 | name = JTRevealSidebar; 522 | productName = JTRevealSidebar; 523 | productReference = 37E67F37159109C500043822 /* libJTRevealSidebar.a */; 524 | productType = "com.apple.product-type.library.static"; 525 | }; 526 | /* End PBXNativeTarget section */ 527 | 528 | /* Begin PBXProject section */ 529 | 1AD4707814446391002EE1B0 /* Project object */ = { 530 | isa = PBXProject; 531 | attributes = { 532 | LastUpgradeCheck = 0420; 533 | }; 534 | buildConfigurationList = 1AD4707B14446391002EE1B0 /* Build configuration list for PBXProject "JTRevealSidebarDemo" */; 535 | compatibilityVersion = "Xcode 3.2"; 536 | developmentRegion = English; 537 | hasScannedForEncodings = 0; 538 | knownRegions = ( 539 | en, 540 | ); 541 | mainGroup = 1AD4707614446391002EE1B0; 542 | productRefGroup = 1AD4708214446391002EE1B0 /* Products */; 543 | projectDirPath = ""; 544 | projectRoot = ""; 545 | targets = ( 546 | 37E67F36159109C500043822 /* JTRevealSidebar */, 547 | 37E67F1F1591080200043822 /* JTRevealSidebarV2 */, 548 | 1AD4708014446391002EE1B0 /* JTRevealSidebarDemo */, 549 | 1AD470A414446392002EE1B0 /* JTRevealSidebarDemoTests */, 550 | 1A617E8A148FC4A6005EC465 /* JTRevealSidebarDemoV2 */, 551 | 1A617EA0148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests */, 552 | ); 553 | }; 554 | /* End PBXProject section */ 555 | 556 | /* Begin PBXResourcesBuildPhase section */ 557 | 1A617E89148FC4A6005EC465 /* Resources */ = { 558 | isa = PBXResourcesBuildPhase; 559 | buildActionMask = 2147483647; 560 | files = ( 561 | 1A617E95148FC4A7005EC465 /* InfoPlist.strings in Resources */, 562 | 1A057B7A149547F20069D7AD /* ButtonMenu.png in Resources */, 563 | 1A057B7B149547F20069D7AD /* ButtonMenu@2x.png in Resources */, 564 | ); 565 | runOnlyForDeploymentPostprocessing = 0; 566 | }; 567 | 1A617E9E148FC4A7005EC465 /* Resources */ = { 568 | isa = PBXResourcesBuildPhase; 569 | buildActionMask = 2147483647; 570 | files = ( 571 | 1A617EAC148FC4A7005EC465 /* InfoPlist.strings in Resources */, 572 | ); 573 | runOnlyForDeploymentPostprocessing = 0; 574 | }; 575 | 1AD4707F14446391002EE1B0 /* Resources */ = { 576 | isa = PBXResourcesBuildPhase; 577 | buildActionMask = 2147483647; 578 | files = ( 579 | 1AD4709014446392002EE1B0 /* InfoPlist.strings in Resources */, 580 | 1AD4709C14446392002EE1B0 /* ViewController_iPhone.xib in Resources */, 581 | 1AD4709F14446392002EE1B0 /* ViewController_iPad.xib in Resources */, 582 | ); 583 | runOnlyForDeploymentPostprocessing = 0; 584 | }; 585 | 1AD470A214446392002EE1B0 /* Resources */ = { 586 | isa = PBXResourcesBuildPhase; 587 | buildActionMask = 2147483647; 588 | files = ( 589 | 1AD470B114446392002EE1B0 /* InfoPlist.strings in Resources */, 590 | ); 591 | runOnlyForDeploymentPostprocessing = 0; 592 | }; 593 | /* End PBXResourcesBuildPhase section */ 594 | 595 | /* Begin PBXShellScriptBuildPhase section */ 596 | 1A617E9F148FC4A7005EC465 /* ShellScript */ = { 597 | isa = PBXShellScriptBuildPhase; 598 | buildActionMask = 2147483647; 599 | files = ( 600 | ); 601 | inputPaths = ( 602 | ); 603 | outputPaths = ( 604 | ); 605 | runOnlyForDeploymentPostprocessing = 0; 606 | shellPath = /bin/sh; 607 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 608 | }; 609 | 1AD470A314446392002EE1B0 /* ShellScript */ = { 610 | isa = PBXShellScriptBuildPhase; 611 | buildActionMask = 2147483647; 612 | files = ( 613 | ); 614 | inputPaths = ( 615 | ); 616 | outputPaths = ( 617 | ); 618 | runOnlyForDeploymentPostprocessing = 0; 619 | shellPath = /bin/sh; 620 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 621 | }; 622 | /* End PBXShellScriptBuildPhase section */ 623 | 624 | /* Begin PBXSourcesBuildPhase section */ 625 | 1A617E87148FC4A6005EC465 /* Sources */ = { 626 | isa = PBXSourcesBuildPhase; 627 | buildActionMask = 2147483647; 628 | files = ( 629 | 1A617E97148FC4A7005EC465 /* main.m in Sources */, 630 | 1A617E9B148FC4A7005EC465 /* AppDelegate.m in Sources */, 631 | 1A617EB9148FC4DB005EC465 /* ViewController.m in Sources */, 632 | 1A81A5D814951CEF00BF03B8 /* SidebarViewController.m in Sources */, 633 | 1A057B6E1495400F0069D7AD /* NewViewController.m in Sources */, 634 | ); 635 | runOnlyForDeploymentPostprocessing = 0; 636 | }; 637 | 1A617E9C148FC4A7005EC465 /* Sources */ = { 638 | isa = PBXSourcesBuildPhase; 639 | buildActionMask = 2147483647; 640 | files = ( 641 | 1A617EAF148FC4A7005EC465 /* JTRevealSidebarDemoV2Tests.m in Sources */, 642 | ); 643 | runOnlyForDeploymentPostprocessing = 0; 644 | }; 645 | 1AD4707D14446391002EE1B0 /* Sources */ = { 646 | isa = PBXSourcesBuildPhase; 647 | buildActionMask = 2147483647; 648 | files = ( 649 | 1AD4709214446392002EE1B0 /* main.m in Sources */, 650 | 1AD4709614446392002EE1B0 /* AppDelegate.m in Sources */, 651 | 1AD4709914446392002EE1B0 /* ViewController.m in Sources */, 652 | ); 653 | runOnlyForDeploymentPostprocessing = 0; 654 | }; 655 | 1AD470A014446392002EE1B0 /* Sources */ = { 656 | isa = PBXSourcesBuildPhase; 657 | buildActionMask = 2147483647; 658 | files = ( 659 | 1AD470B414446392002EE1B0 /* JTRevealSidebarDemoTests.m in Sources */, 660 | ); 661 | runOnlyForDeploymentPostprocessing = 0; 662 | }; 663 | 37E67F1C1591080200043822 /* Sources */ = { 664 | isa = PBXSourcesBuildPhase; 665 | buildActionMask = 2147483647; 666 | files = ( 667 | 37E67F2B1591086200043822 /* UINavigationItem+JTRevealSidebarV2.m in Sources */, 668 | 37E67F2C1591086200043822 /* UIViewController+JTRevealSidebarV2.m in Sources */, 669 | ); 670 | runOnlyForDeploymentPostprocessing = 0; 671 | }; 672 | 37E67F33159109C500043822 /* Sources */ = { 673 | isa = PBXSourcesBuildPhase; 674 | buildActionMask = 2147483647; 675 | files = ( 676 | 37E67F4215910A0600043822 /* JTRevealSidebarView.m in Sources */, 677 | 37E67F4315910A0600043822 /* JTNavigationView.m in Sources */, 678 | 37E67F4415910A0600043822 /* JTNavigationBar.m in Sources */, 679 | 37E67F4515910A0600043822 /* JTTableViewDatasource.m in Sources */, 680 | 37E67F4615910A0600043822 /* JTTableViewCellFactory.m in Sources */, 681 | 37E67F4715910A0600043822 /* JTTableViewCellModal.m in Sources */, 682 | ); 683 | runOnlyForDeploymentPostprocessing = 0; 684 | }; 685 | /* End PBXSourcesBuildPhase section */ 686 | 687 | /* Begin PBXTargetDependency section */ 688 | 1A617EA6148FC4A7005EC465 /* PBXTargetDependency */ = { 689 | isa = PBXTargetDependency; 690 | target = 1A617E8A148FC4A6005EC465 /* JTRevealSidebarDemoV2 */; 691 | targetProxy = 1A617EA5148FC4A7005EC465 /* PBXContainerItemProxy */; 692 | }; 693 | 1AD470AB14446392002EE1B0 /* PBXTargetDependency */ = { 694 | isa = PBXTargetDependency; 695 | target = 1AD4708014446391002EE1B0 /* JTRevealSidebarDemo */; 696 | targetProxy = 1AD470AA14446392002EE1B0 /* PBXContainerItemProxy */; 697 | }; 698 | 37E67F321591094900043822 /* PBXTargetDependency */ = { 699 | isa = PBXTargetDependency; 700 | target = 37E67F1F1591080200043822 /* JTRevealSidebarV2 */; 701 | targetProxy = 37E67F311591094900043822 /* PBXContainerItemProxy */; 702 | }; 703 | 37E67F4A15910A1300043822 /* PBXTargetDependency */ = { 704 | isa = PBXTargetDependency; 705 | target = 37E67F36159109C500043822 /* JTRevealSidebar */; 706 | targetProxy = 37E67F4915910A1300043822 /* PBXContainerItemProxy */; 707 | }; 708 | /* End PBXTargetDependency section */ 709 | 710 | /* Begin PBXVariantGroup section */ 711 | 1A617E93148FC4A7005EC465 /* InfoPlist.strings */ = { 712 | isa = PBXVariantGroup; 713 | children = ( 714 | 1A617E94148FC4A7005EC465 /* en */, 715 | ); 716 | name = InfoPlist.strings; 717 | sourceTree = ""; 718 | }; 719 | 1A617EAA148FC4A7005EC465 /* InfoPlist.strings */ = { 720 | isa = PBXVariantGroup; 721 | children = ( 722 | 1A617EAB148FC4A7005EC465 /* en */, 723 | ); 724 | name = InfoPlist.strings; 725 | sourceTree = ""; 726 | }; 727 | 1AD4708E14446392002EE1B0 /* InfoPlist.strings */ = { 728 | isa = PBXVariantGroup; 729 | children = ( 730 | 1AD4708F14446392002EE1B0 /* en */, 731 | ); 732 | name = InfoPlist.strings; 733 | sourceTree = ""; 734 | }; 735 | 1AD4709A14446392002EE1B0 /* ViewController_iPhone.xib */ = { 736 | isa = PBXVariantGroup; 737 | children = ( 738 | 1AD4709B14446392002EE1B0 /* en */, 739 | ); 740 | name = ViewController_iPhone.xib; 741 | sourceTree = ""; 742 | }; 743 | 1AD4709D14446392002EE1B0 /* ViewController_iPad.xib */ = { 744 | isa = PBXVariantGroup; 745 | children = ( 746 | 1AD4709E14446392002EE1B0 /* en */, 747 | ); 748 | name = ViewController_iPad.xib; 749 | sourceTree = ""; 750 | }; 751 | 1AD470AF14446392002EE1B0 /* InfoPlist.strings */ = { 752 | isa = PBXVariantGroup; 753 | children = ( 754 | 1AD470B014446392002EE1B0 /* en */, 755 | ); 756 | name = InfoPlist.strings; 757 | sourceTree = ""; 758 | }; 759 | /* End PBXVariantGroup section */ 760 | 761 | /* Begin XCBuildConfiguration section */ 762 | 1A617EB0148FC4A7005EC465 /* Debug */ = { 763 | isa = XCBuildConfiguration; 764 | buildSettings = { 765 | CLANG_ENABLE_OBJC_ARC = YES; 766 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 767 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 768 | GCC_PREFIX_HEADER = "JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Prefix.pch"; 769 | INFOPLIST_FILE = "JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Info.plist"; 770 | OTHER_LDFLAGS = "-ObjC"; 771 | PRODUCT_NAME = "$(TARGET_NAME)"; 772 | WRAPPER_EXTENSION = app; 773 | }; 774 | name = Debug; 775 | }; 776 | 1A617EB1148FC4A7005EC465 /* Release */ = { 777 | isa = XCBuildConfiguration; 778 | buildSettings = { 779 | CLANG_ENABLE_OBJC_ARC = YES; 780 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 781 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 782 | GCC_PREFIX_HEADER = "JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Prefix.pch"; 783 | INFOPLIST_FILE = "JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Info.plist"; 784 | OTHER_LDFLAGS = "-ObjC"; 785 | PRODUCT_NAME = "$(TARGET_NAME)"; 786 | WRAPPER_EXTENSION = app; 787 | }; 788 | name = Release; 789 | }; 790 | 1A617EB2148FC4A7005EC465 /* Debug */ = { 791 | isa = XCBuildConfiguration; 792 | buildSettings = { 793 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JTRevealSidebarDemoV2.app/JTRevealSidebarDemoV2"; 794 | CLANG_ENABLE_OBJC_ARC = YES; 795 | FRAMEWORK_SEARCH_PATHS = ( 796 | "$(SDKROOT)/Developer/Library/Frameworks", 797 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 798 | ); 799 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 800 | GCC_PREFIX_HEADER = "JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Prefix.pch"; 801 | INFOPLIST_FILE = "JTRevealSidebarDemoV2Tests/JTRevealSidebarDemoV2Tests-Info.plist"; 802 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 803 | PRODUCT_NAME = "$(TARGET_NAME)"; 804 | TEST_HOST = "$(BUNDLE_LOADER)"; 805 | WRAPPER_EXTENSION = octest; 806 | }; 807 | name = Debug; 808 | }; 809 | 1A617EB3148FC4A7005EC465 /* Release */ = { 810 | isa = XCBuildConfiguration; 811 | buildSettings = { 812 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JTRevealSidebarDemoV2.app/JTRevealSidebarDemoV2"; 813 | CLANG_ENABLE_OBJC_ARC = YES; 814 | FRAMEWORK_SEARCH_PATHS = ( 815 | "$(SDKROOT)/Developer/Library/Frameworks", 816 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 817 | ); 818 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 819 | GCC_PREFIX_HEADER = "JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Prefix.pch"; 820 | INFOPLIST_FILE = "JTRevealSidebarDemoV2Tests/JTRevealSidebarDemoV2Tests-Info.plist"; 821 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 822 | PRODUCT_NAME = "$(TARGET_NAME)"; 823 | TEST_HOST = "$(BUNDLE_LOADER)"; 824 | WRAPPER_EXTENSION = octest; 825 | }; 826 | name = Release; 827 | }; 828 | 1AD470B514446392002EE1B0 /* Debug */ = { 829 | isa = XCBuildConfiguration; 830 | buildSettings = { 831 | ALWAYS_SEARCH_USER_PATHS = NO; 832 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 833 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 834 | COPY_PHASE_STRIP = NO; 835 | GCC_C_LANGUAGE_STANDARD = gnu99; 836 | GCC_DYNAMIC_NO_PIC = NO; 837 | GCC_OPTIMIZATION_LEVEL = 0; 838 | GCC_PREPROCESSOR_DEFINITIONS = ( 839 | "DEBUG=1", 840 | "$(inherited)", 841 | ); 842 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 843 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 844 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 845 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 846 | GCC_WARN_UNUSED_VARIABLE = YES; 847 | IPHONEOS_DEPLOYMENT_TARGET = 4.0; 848 | SDKROOT = iphoneos; 849 | TARGETED_DEVICE_FAMILY = "1,2"; 850 | }; 851 | name = Debug; 852 | }; 853 | 1AD470B614446392002EE1B0 /* Release */ = { 854 | isa = XCBuildConfiguration; 855 | buildSettings = { 856 | ALWAYS_SEARCH_USER_PATHS = NO; 857 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 858 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 859 | COPY_PHASE_STRIP = YES; 860 | GCC_C_LANGUAGE_STANDARD = gnu99; 861 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 862 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 863 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 864 | GCC_WARN_UNUSED_VARIABLE = YES; 865 | IPHONEOS_DEPLOYMENT_TARGET = 4.0; 866 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 867 | SDKROOT = iphoneos; 868 | TARGETED_DEVICE_FAMILY = "1,2"; 869 | VALIDATE_PRODUCT = YES; 870 | }; 871 | name = Release; 872 | }; 873 | 1AD470B814446392002EE1B0 /* Debug */ = { 874 | isa = XCBuildConfiguration; 875 | buildSettings = { 876 | INFOPLIST_FILE = "JTRevealSidebarDemo/JTRevealSidebarDemo-Info.plist"; 877 | OTHER_LDFLAGS = "-ObjC"; 878 | PRODUCT_NAME = "$(TARGET_NAME)"; 879 | WRAPPER_EXTENSION = app; 880 | }; 881 | name = Debug; 882 | }; 883 | 1AD470B914446392002EE1B0 /* Release */ = { 884 | isa = XCBuildConfiguration; 885 | buildSettings = { 886 | INFOPLIST_FILE = "JTRevealSidebarDemo/JTRevealSidebarDemo-Info.plist"; 887 | OTHER_LDFLAGS = "-ObjC"; 888 | PRODUCT_NAME = "$(TARGET_NAME)"; 889 | WRAPPER_EXTENSION = app; 890 | }; 891 | name = Release; 892 | }; 893 | 1AD470BB14446392002EE1B0 /* Debug */ = { 894 | isa = XCBuildConfiguration; 895 | buildSettings = { 896 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JTRevealSidebarDemo.app/JTRevealSidebarDemo"; 897 | FRAMEWORK_SEARCH_PATHS = ( 898 | "$(SDKROOT)/Developer/Library/Frameworks", 899 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 900 | ); 901 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 902 | GCC_PREFIX_HEADER = "JTRevealSidebarDemo/JTRevealSidebarDemo-Prefix.pch"; 903 | INFOPLIST_FILE = "JTRevealSidebarDemoTests/JTRevealSidebarDemoTests-Info.plist"; 904 | PRODUCT_NAME = "$(TARGET_NAME)"; 905 | TEST_HOST = "$(BUNDLE_LOADER)"; 906 | WRAPPER_EXTENSION = octest; 907 | }; 908 | name = Debug; 909 | }; 910 | 1AD470BC14446392002EE1B0 /* Release */ = { 911 | isa = XCBuildConfiguration; 912 | buildSettings = { 913 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JTRevealSidebarDemo.app/JTRevealSidebarDemo"; 914 | FRAMEWORK_SEARCH_PATHS = ( 915 | "$(SDKROOT)/Developer/Library/Frameworks", 916 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 917 | ); 918 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 919 | GCC_PREFIX_HEADER = "JTRevealSidebarDemo/JTRevealSidebarDemo-Prefix.pch"; 920 | INFOPLIST_FILE = "JTRevealSidebarDemoTests/JTRevealSidebarDemoTests-Info.plist"; 921 | PRODUCT_NAME = "$(TARGET_NAME)"; 922 | TEST_HOST = "$(BUNDLE_LOADER)"; 923 | WRAPPER_EXTENSION = octest; 924 | }; 925 | name = Release; 926 | }; 927 | 37E67F291591080200043822 /* Debug */ = { 928 | isa = XCBuildConfiguration; 929 | buildSettings = { 930 | DSTROOT = /tmp/JTRevealSidebarV2.dst; 931 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 932 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 933 | OTHER_LDFLAGS = "-ObjC"; 934 | PRODUCT_NAME = "$(TARGET_NAME)"; 935 | PUBLIC_HEADERS_FOLDER_PATH = include/JTRevealSidebarV2; 936 | SKIP_INSTALL = YES; 937 | }; 938 | name = Debug; 939 | }; 940 | 37E67F2A1591080200043822 /* Release */ = { 941 | isa = XCBuildConfiguration; 942 | buildSettings = { 943 | DSTROOT = /tmp/JTRevealSidebarV2.dst; 944 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 945 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 946 | OTHER_LDFLAGS = "-ObjC"; 947 | PRODUCT_NAME = "$(TARGET_NAME)"; 948 | PUBLIC_HEADERS_FOLDER_PATH = include/JTRevealSidebarV2; 949 | SKIP_INSTALL = YES; 950 | }; 951 | name = Release; 952 | }; 953 | 37E67F40159109C500043822 /* Debug */ = { 954 | isa = XCBuildConfiguration; 955 | buildSettings = { 956 | DSTROOT = /tmp/JTRevealSidebar.dst; 957 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 958 | GCC_PREFIX_HEADER = "JTRevealSidebar/JTRevealSidebar-Prefix.pch"; 959 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 960 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 961 | OTHER_LDFLAGS = "-ObjC"; 962 | PRODUCT_NAME = "$(TARGET_NAME)"; 963 | PUBLIC_HEADERS_FOLDER_PATH = include/JTRevealSidebar; 964 | SKIP_INSTALL = YES; 965 | }; 966 | name = Debug; 967 | }; 968 | 37E67F41159109C500043822 /* Release */ = { 969 | isa = XCBuildConfiguration; 970 | buildSettings = { 971 | DSTROOT = /tmp/JTRevealSidebar.dst; 972 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 973 | GCC_PREFIX_HEADER = "JTRevealSidebar/JTRevealSidebar-Prefix.pch"; 974 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 975 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 976 | OTHER_LDFLAGS = "-ObjC"; 977 | PRODUCT_NAME = "$(TARGET_NAME)"; 978 | PUBLIC_HEADERS_FOLDER_PATH = include/JTRevealSidebar; 979 | SKIP_INSTALL = YES; 980 | }; 981 | name = Release; 982 | }; 983 | /* End XCBuildConfiguration section */ 984 | 985 | /* Begin XCConfigurationList section */ 986 | 1A617EB4148FC4A7005EC465 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemoV2" */ = { 987 | isa = XCConfigurationList; 988 | buildConfigurations = ( 989 | 1A617EB0148FC4A7005EC465 /* Debug */, 990 | 1A617EB1148FC4A7005EC465 /* Release */, 991 | ); 992 | defaultConfigurationIsVisible = 0; 993 | defaultConfigurationName = Release; 994 | }; 995 | 1A617EB5148FC4A7005EC465 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemoV2Tests" */ = { 996 | isa = XCConfigurationList; 997 | buildConfigurations = ( 998 | 1A617EB2148FC4A7005EC465 /* Debug */, 999 | 1A617EB3148FC4A7005EC465 /* Release */, 1000 | ); 1001 | defaultConfigurationIsVisible = 0; 1002 | defaultConfigurationName = Release; 1003 | }; 1004 | 1AD4707B14446391002EE1B0 /* Build configuration list for PBXProject "JTRevealSidebarDemo" */ = { 1005 | isa = XCConfigurationList; 1006 | buildConfigurations = ( 1007 | 1AD470B514446392002EE1B0 /* Debug */, 1008 | 1AD470B614446392002EE1B0 /* Release */, 1009 | ); 1010 | defaultConfigurationIsVisible = 0; 1011 | defaultConfigurationName = Release; 1012 | }; 1013 | 1AD470B714446392002EE1B0 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemo" */ = { 1014 | isa = XCConfigurationList; 1015 | buildConfigurations = ( 1016 | 1AD470B814446392002EE1B0 /* Debug */, 1017 | 1AD470B914446392002EE1B0 /* Release */, 1018 | ); 1019 | defaultConfigurationIsVisible = 0; 1020 | defaultConfigurationName = Release; 1021 | }; 1022 | 1AD470BA14446392002EE1B0 /* Build configuration list for PBXNativeTarget "JTRevealSidebarDemoTests" */ = { 1023 | isa = XCConfigurationList; 1024 | buildConfigurations = ( 1025 | 1AD470BB14446392002EE1B0 /* Debug */, 1026 | 1AD470BC14446392002EE1B0 /* Release */, 1027 | ); 1028 | defaultConfigurationIsVisible = 0; 1029 | defaultConfigurationName = Release; 1030 | }; 1031 | 37E67F281591080200043822 /* Build configuration list for PBXNativeTarget "JTRevealSidebarV2" */ = { 1032 | isa = XCConfigurationList; 1033 | buildConfigurations = ( 1034 | 37E67F291591080200043822 /* Debug */, 1035 | 37E67F2A1591080200043822 /* Release */, 1036 | ); 1037 | defaultConfigurationIsVisible = 0; 1038 | defaultConfigurationName = Release; 1039 | }; 1040 | 37E67F3F159109C500043822 /* Build configuration list for PBXNativeTarget "JTRevealSidebar" */ = { 1041 | isa = XCConfigurationList; 1042 | buildConfigurations = ( 1043 | 37E67F40159109C500043822 /* Debug */, 1044 | 37E67F41159109C500043822 /* Release */, 1045 | ); 1046 | defaultConfigurationIsVisible = 0; 1047 | defaultConfigurationName = Release; 1048 | }; 1049 | /* End XCConfigurationList section */ 1050 | }; 1051 | rootObject = 1AD4707814446391002EE1B0 /* Project object */; 1052 | } 1053 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by james on 10/11/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by james on 10/11/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | @synthesize window = _window; 16 | @synthesize viewController = _viewController; 17 | 18 | - (void)dealloc 19 | { 20 | [_window release]; 21 | [_viewController release]; 22 | [super dealloc]; 23 | } 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 26 | { 27 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 28 | // Override point for customization after application launch. 29 | if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { 30 | self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease]; 31 | } else { 32 | self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease]; 33 | } 34 | self.window.rootViewController = self.viewController; 35 | [self.window makeKeyAndVisible]; 36 | return YES; 37 | } 38 | 39 | - (void)applicationWillResignActive:(UIApplication *)application 40 | { 41 | /* 42 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 43 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 44 | */ 45 | } 46 | 47 | - (void)applicationDidEnterBackground:(UIApplication *)application 48 | { 49 | /* 50 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 51 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 52 | */ 53 | } 54 | 55 | - (void)applicationWillEnterForeground:(UIApplication *)application 56 | { 57 | /* 58 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 59 | */ 60 | } 61 | 62 | - (void)applicationDidBecomeActive:(UIApplication *)application 63 | { 64 | /* 65 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 66 | */ 67 | } 68 | 69 | - (void)applicationWillTerminate:(UIApplication *)application 70 | { 71 | /* 72 | Called when the application is about to terminate. 73 | Save data if appropriate. 74 | See also applicationDidEnterBackground:. 75 | */ 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/JTRevealSidebarDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | com.stepcase.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by james on 10/11/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class JTRevealSidebarView; 12 | @class JTTableViewDatasource; 13 | 14 | @interface ViewController : UIViewController { 15 | JTRevealSidebarView *_revealView; 16 | JTTableViewDatasource *_datasource; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by james on 10/11/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "JTRevealSidebarView.h" 11 | #import "JTNavigationView.h" 12 | #import "JTTableViewDatasource.h" 13 | #import "JTTableViewCellModal.h" 14 | #import "JTTableViewCellFactory.h" 15 | 16 | typedef enum { 17 | JTTableRowTypeBack, 18 | JTTableRowTypePushContentView, 19 | } JTTableRowTypes; 20 | 21 | @interface ViewController (UITableView) 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 27 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 28 | if (self) { 29 | _datasource = [[JTTableViewDatasource alloc] init]; 30 | _datasource.sourceInfo = [NSDictionary dictionaryWithObjectsAndKeys:@"root", @"url", nil]; 31 | _datasource.delegate = self; 32 | } 33 | return self; 34 | } 35 | 36 | - (void)dealloc { 37 | [_revealView release]; 38 | [super dealloc]; 39 | } 40 | 41 | #pragma mark - View lifecycle 42 | 43 | - (void)viewDidLoad 44 | { 45 | [super viewDidLoad]; 46 | 47 | // Create a default style RevealSidebarView 48 | _revealView = [[JTRevealSidebarView defaultViewWithFrame:self.view.bounds] retain]; 49 | 50 | // Setup a view to be the rootView of the sidebar 51 | UITableView *tableView = [[[UITableView alloc] initWithFrame:_revealView.sidebarView.bounds] autorelease]; 52 | tableView.delegate = _datasource; 53 | tableView.dataSource = _datasource; 54 | tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 55 | [_revealView.sidebarView pushView:tableView animated:NO]; 56 | 57 | // Construct a toggle button for our contentView and add into it 58 | // UIButton *toggleButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 59 | // { 60 | // [toggleButton setTitle:@"Toggle" forState:UIControlStateNormal]; 61 | // [toggleButton sizeToFit]; 62 | // toggleButton.frame = CGRectOffset(toggleButton.frame, 4, 50); 63 | // [toggleButton addTarget:self action:@selector(toggleButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 64 | // } 65 | // [_revealView.contentView addSubview:toggleButton]; 66 | 67 | _revealView.contentView.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(toggleButtonPressed:)] autorelease]; 68 | 69 | [self.view addSubview:_revealView]; 70 | } 71 | 72 | - (void)viewDidUnload 73 | { 74 | [super viewDidUnload]; 75 | // Release any retained subviews of the main view. 76 | // e.g. self.myOutlet = nil; 77 | } 78 | 79 | #pragma mark Actions 80 | 81 | - (void)toggleButtonPressed:(id)sender { 82 | [_revealView revealSidebar: ! [_revealView isSidebarShowing]]; 83 | } 84 | 85 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 86 | return YES; 87 | } 88 | 89 | - (void)pushContentView:(id)sender { 90 | UIView *subview = [[UIView alloc] initWithFrame:CGRectZero]; 91 | subview.backgroundColor = [UIColor blueColor]; 92 | subview.title = @"Pushed Subview"; 93 | [_revealView.contentView pushView:subview animated:YES]; 94 | [subview release]; 95 | } 96 | 97 | #pragma mark Helper 98 | 99 | - (void)simulateDidSucceedFetchingDatasource:(JTTableViewDatasource *)datasource { 100 | NSString *url = [datasource.sourceInfo objectForKey:@"url"]; 101 | if ([url isEqualToString:@"root"]) { 102 | [datasource configureSingleSectionWithArray: 103 | [NSArray arrayWithObjects: 104 | [JTTableViewCellModalCustom modalWithInfo: 105 | [NSDictionary dictionaryWithObjectsAndKeys: 106 | @"Push", @"title", 107 | [JTTableViewDatasource dynamicDatasourceWithDelegate:self 108 | sourceInfo: 109 | [NSDictionary dictionaryWithObjectsAndKeys:@"push", @"url", nil]], @"datasource", nil]], 110 | 111 | [JTTableViewCellModalSimpleType modalWithTitle:@"ContentView1" type:JTTableRowTypePushContentView], 112 | [JTTableViewCellModalSimpleType modalWithTitle:@"ContentView2" type:JTTableRowTypePushContentView], 113 | 114 | nil] 115 | ]; 116 | } else if ([url isEqualToString:@"push"]) { 117 | [datasource configureSingleSectionWithArray: 118 | [NSArray arrayWithObject: 119 | [JTTableViewCellModalSimpleType modalWithTitle:@"Back" type:JTTableRowTypeBack] 120 | ] 121 | ]; 122 | } else { 123 | NSAssert(NO, @"not handled!", nil); 124 | } 125 | } 126 | 127 | - (void)loadDatasourceSection:(JTTableViewDatasource *)datasource { 128 | [self performSelector:@selector(simulateDidSucceedFetchingDatasource:) 129 | withObject:datasource 130 | afterDelay:1]; 131 | } 132 | 133 | @end 134 | 135 | 136 | @implementation ViewController (UITableView) 137 | 138 | - (BOOL)datasourceShouldLoad:(JTTableViewDatasource *)datasource { 139 | if ([datasource.sourceInfo objectForKey:@"url"]) { 140 | [self loadDatasourceSection:datasource]; 141 | return YES; 142 | } else { 143 | return NO; 144 | } 145 | } 146 | 147 | - (UITableViewCell *)datasource:(JTTableViewDatasource *)datasource tableView:(UITableView *)tableView cellForObject:(NSObject *)object { 148 | if ([object conformsToProtocol:@protocol(JTTableViewCellModalLoadingIndicator)]) { 149 | static NSString *cellIdentifier = @"loadingCell"; 150 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 151 | if (cell == nil) { 152 | cell = [JTTableViewCellFactory loaderCellWithIdentifier:cellIdentifier]; 153 | } 154 | return cell; 155 | } else if ([object conformsToProtocol:@protocol(JTTableViewCellModal)]) { 156 | static NSString *cellIdentifier = @"titleCell"; 157 | 158 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 159 | if (cell == nil) { 160 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease]; 161 | } 162 | cell.textLabel.text = [(id )object title]; 163 | return cell; 164 | } else if ([object conformsToProtocol:@protocol(JTTableViewCellModalCustom)]) { 165 | id custom = (id)object; 166 | JTTableViewDatasource *datasource = (JTTableViewDatasource *)[[custom info] objectForKey:@"datasource"]; 167 | if (datasource) { 168 | static NSString *cellIdentifier = @"datasourceCell"; 169 | 170 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 171 | if (cell == nil) { 172 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease]; 173 | } 174 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 175 | cell.textLabel.text = [[custom info] objectForKey:@"title"]; 176 | return cell; 177 | } 178 | } 179 | return nil; 180 | } 181 | 182 | - (void)datasource:(JTTableViewDatasource *)datasource tableView:(UITableView *)tableView didSelectObject:(NSObject *)object { 183 | if ([object conformsToProtocol:@protocol(JTTableViewCellModalCustom)]) { 184 | id custom = (id)object; 185 | JTTableViewDatasource *datasource = (JTTableViewDatasource *)[[custom info] objectForKey:@"datasource"]; 186 | if (datasource) { 187 | UITableView *tableView = [[[UITableView alloc] initWithFrame:_revealView.sidebarView.bounds] autorelease]; 188 | tableView.delegate = datasource; 189 | tableView.dataSource = datasource; 190 | tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 191 | [_revealView.sidebarView pushView:tableView animated:YES]; 192 | } 193 | } else if ([object conformsToProtocol:@protocol(JTTableViewCellModalSimpleType)]) { 194 | switch ([(JTTableViewCellModalSimpleType *)object type]) { 195 | case JTTableRowTypeBack: 196 | [_revealView.sidebarView popViewAnimated:YES]; 197 | UITableView *tableView = (UITableView *)[_revealView.sidebarView topView]; 198 | [tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:YES]; 199 | break; 200 | case JTTableRowTypePushContentView: 201 | { 202 | UIView *view = [[UIView alloc] init]; 203 | view.backgroundColor = [UIColor redColor]; 204 | 205 | // Create a push button to demonstrate pushing subviews in the main content view 206 | UIButton *pushButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 207 | [pushButton setTitle:@"Push" forState:UIControlStateNormal]; 208 | [pushButton addTarget:self action:@selector(pushContentView:) forControlEvents:UIControlEventTouchUpInside]; 209 | [pushButton sizeToFit]; 210 | [view addSubview:pushButton]; 211 | 212 | view.title = [(JTTableViewCellModalSimpleType *)object title]; 213 | [_revealView.contentView setRootView:view]; 214 | [view release]; 215 | [_revealView revealSidebar:NO]; 216 | } 217 | default: 218 | break; 219 | } 220 | } 221 | } 222 | 223 | - (void)datasource:(JTTableViewDatasource *)datasource sectionsDidChanged:(NSArray *)oldSections { 224 | [(UITableView *)[_revealView.sidebarView topView] reloadData]; 225 | } 226 | 227 | @end -------------------------------------------------------------------------------- /JTRevealSidebarDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/en.lproj/ViewController_iPad.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C25 6 | 1919 7 | 1138.11 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 916 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBIPadFramework 28 | 29 | 30 | IBFirstResponder 31 | IBIPadFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {768, 1004}} 37 | 38 | 39 | 40 | 3 41 | MQA 42 | 43 | 2 44 | 45 | 46 | 47 | 2 48 | 49 | IBIPadFramework 50 | 51 | 52 | 53 | 54 | 55 | 56 | view 57 | 58 | 59 | 60 | 3 61 | 62 | 63 | 64 | 65 | 66 | 0 67 | 68 | 69 | 70 | 71 | 72 | -1 73 | 74 | 75 | File's Owner 76 | 77 | 78 | -2 79 | 80 | 81 | 82 | 83 | 2 84 | 85 | 86 | 87 | 88 | 89 | 90 | ViewController 91 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 92 | UIResponder 93 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 94 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 95 | 96 | 97 | 98 | 99 | 100 | 3 101 | 102 | 103 | 104 | 105 | ViewController 106 | UIViewController 107 | 108 | IBProjectSource 109 | ./Classes/ViewController.h 110 | 111 | 112 | 113 | 114 | 0 115 | IBIPadFramework 116 | YES 117 | 3 118 | 916 119 | 120 | 121 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/en.lproj/ViewController_iPhone.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C25 6 | 1919 7 | 1138.11 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 916 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {320, 460}} 37 | 38 | 39 | 40 | 3 41 | MC43NQA 42 | 43 | 2 44 | 45 | 46 | NO 47 | 48 | IBCocoaTouchFramework 49 | 50 | 51 | 52 | 53 | 54 | 55 | view 56 | 57 | 58 | 59 | 7 60 | 61 | 62 | 63 | 64 | 65 | 0 66 | 67 | 68 | 69 | 70 | 71 | -1 72 | 73 | 74 | File's Owner 75 | 76 | 77 | -2 78 | 79 | 80 | 81 | 82 | 6 83 | 84 | 85 | 86 | 87 | 88 | 89 | ViewController 90 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 91 | UIResponder 92 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 93 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 94 | 95 | 96 | 97 | 98 | 99 | 7 100 | 101 | 102 | 103 | 104 | ViewController 105 | UIViewController 106 | 107 | IBProjectSource 108 | ./Classes/ViewController.h 109 | 110 | 111 | 112 | 113 | 0 114 | IBCocoaTouchFramework 115 | YES 116 | 3 117 | 916 118 | 119 | 120 | -------------------------------------------------------------------------------- /JTRevealSidebarDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by james on 10/11/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoTests/JTRevealSidebarDemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.stepcase.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoTests/JTRevealSidebarDemoTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // JTRevealSidebarDemoTests.h 3 | // JTRevealSidebarDemoTests 4 | // 5 | // Created by james on 10/11/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JTRevealSidebarDemoTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoTests/JTRevealSidebarDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JTRevealSidebarDemoTests.m 3 | // JTRevealSidebarDemoTests 4 | // 5 | // Created by james on 10/11/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "JTRevealSidebarDemoTests.h" 10 | 11 | @implementation JTRevealSidebarDemoTests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in JTRevealSidebarDemoTests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JTRevealSidebarDemoV2 4 | // 5 | // Created by James Apple Tang on 7/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JTRevealSidebarDemoV2 4 | // 5 | // Created by James Apple Tang on 7/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | @synthesize window = _window; 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | // Override point for customization after application launch. 20 | self.window.backgroundColor = [UIColor whiteColor]; 21 | 22 | ViewController *controller = [[ViewController alloc] init]; 23 | controller.title = @"ViewController"; 24 | UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller]; 25 | 26 | #if EXPERIEMENTAL_ORIENTATION_SUPPORT 27 | UINavigationController *container = [[UINavigationController alloc] init]; 28 | [container setNavigationBarHidden:YES animated:NO]; 29 | [container setViewControllers:[NSArray arrayWithObject:navController] animated:NO]; 30 | self.window.rootViewController = container; 31 | #else 32 | self.window.rootViewController = navController; 33 | #endif 34 | 35 | [self.window makeKeyAndVisible]; 36 | return YES; 37 | } 38 | 39 | - (void)applicationWillResignActive:(UIApplication *)application 40 | { 41 | /* 42 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 43 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 44 | */ 45 | } 46 | 47 | - (void)applicationDidEnterBackground:(UIApplication *)application 48 | { 49 | /* 50 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 51 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 52 | */ 53 | } 54 | 55 | - (void)applicationWillEnterForeground:(UIApplication *)application 56 | { 57 | /* 58 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 59 | */ 60 | } 61 | 62 | - (void)applicationDidBecomeActive:(UIApplication *)application 63 | { 64 | /* 65 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 66 | */ 67 | } 68 | 69 | - (void)applicationWillTerminate:(UIApplication *)application 70 | { 71 | /* 72 | Called when the application is about to terminate. 73 | Save data if appropriate. 74 | See also applicationDidEnterBackground:. 75 | */ 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/ButtonMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/JTRevealSidebarDemoV2/ButtonMenu.png -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/ButtonMenu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/JTRevealSidebarDemoV2/ButtonMenu@2x.png -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | com.mystcolor.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/JTRevealSidebarDemoV2-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'JTRevealSidebarDemoV2' target in the 'JTRevealSidebarDemoV2' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/NewViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NewViewController.h 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by James Apple Tang on 12/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NewViewController : UIViewController 12 | 13 | @property (nonatomic, strong) UILabel *label; 14 | @property (nonatomic, strong) UITableView *rightSidebarView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/NewViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NewViewController.m 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by James Apple Tang on 12/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "NewViewController.h" 10 | #import "UINavigationItem+JTRevealSidebarV2.h" 11 | #import "UIViewController+JTRevealSidebarV2.h" 12 | #import "JTRevealSidebarV2Delegate.h" 13 | 14 | @interface NewViewController () 15 | @end 16 | 17 | @implementation NewViewController 18 | @synthesize label; 19 | @synthesize rightSidebarView; 20 | #pragma mark - View lifecycle 21 | 22 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | self.label = [[UILabel alloc] initWithFrame:CGRectMake(30, 30, 290, 30)]; 27 | [self.view addSubview:self.label]; 28 | 29 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(revealRightSidebar:)]; 30 | 31 | self.navigationItem.revealSidebarDelegate = self; 32 | } 33 | 34 | - (void)viewDidUnload 35 | { 36 | [super viewDidUnload]; 37 | // Release any retained subviews of the main view. 38 | // e.g. self.myOutlet = nil; 39 | } 40 | 41 | #pragma mark Action 42 | 43 | - (void)revealRightSidebar:(id)sender { 44 | JTRevealedState state = JTRevealedStateRight; 45 | if (self.navigationController.revealedState == JTRevealedStateRight) { 46 | state = JTRevealedStateNo; 47 | } 48 | [self.navigationController setRevealedState:state]; 49 | } 50 | 51 | 52 | #pragma mark UITableViewDatasource 53 | 54 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 55 | return 8; 56 | } 57 | 58 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 59 | return 1; 60 | } 61 | 62 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 63 | static NSString *cellIdentifier = @"CellIdentifier"; 64 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 65 | if ( ! cell) { 66 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 67 | cell.selectionStyle = UITableViewCellSelectionStyleGray; 68 | } 69 | cell.textLabel.text = [NSString stringWithFormat:@"%d", indexPath.row]; 70 | return cell; 71 | } 72 | 73 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 74 | if (tableView == self.rightSidebarView) { 75 | return @"RightSidebar"; 76 | } 77 | return nil; 78 | } 79 | 80 | #pragma mark UITableViewDelegate 81 | 82 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 83 | [self.navigationController setRevealedState:JTRevealedStateNo]; 84 | if (tableView == self.rightSidebarView) { 85 | self.label.text = [NSString stringWithFormat:@"Selected %d at RightSidebarView", indexPath.row]; 86 | } 87 | } 88 | 89 | 90 | #pragma mark JTRevealSidebarV2Delegate 91 | 92 | - (UIView *)viewForRightSidebar { 93 | CGRect mainFrame = [[UIScreen mainScreen] applicationFrame]; 94 | UITableView *view = self.rightSidebarView; 95 | if ( ! view) { 96 | view = self.rightSidebarView = [[UITableView alloc] initWithFrame:CGRectMake(160, mainFrame.origin.y, 160, mainFrame.size.height) style:UITableViewStyleGrouped]; 97 | view.dataSource = self; 98 | view.delegate = self; 99 | view.backgroundColor = [UIColor groupTableViewBackgroundColor]; 100 | } 101 | return view; 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/SidebarViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LeftSidebarViewController.h 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by James Apple Tang on 12/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol SidebarViewControllerDelegate; 12 | 13 | @interface SidebarViewController : UITableViewController 14 | 15 | @property (nonatomic, assign) id sidebarDelegate; 16 | 17 | @end 18 | 19 | @protocol SidebarViewControllerDelegate 20 | 21 | - (void)sidebarViewController:(SidebarViewController *)sidebarViewController didSelectObject:(NSObject *)object atIndexPath:(NSIndexPath *)indexPath; 22 | 23 | @optional 24 | - (NSIndexPath *)lastSelectedIndexPathForSidebarViewController:(SidebarViewController *)sidebarViewController; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/SidebarViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LeftSidebarViewController.m 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by James Apple Tang on 12/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "SidebarViewController.h" 10 | 11 | 12 | @implementation SidebarViewController 13 | @synthesize sidebarDelegate; 14 | 15 | - (id)initWithStyle:(UITableViewStyle)style 16 | { 17 | self = [super initWithStyle:style]; 18 | if (self) { 19 | // Custom initialization 20 | } 21 | return self; 22 | } 23 | 24 | #pragma mark - View lifecycle 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | } 30 | 31 | - (void)viewWillAppear:(BOOL)animated { 32 | [super viewWillAppear:animated]; 33 | 34 | if ([self.sidebarDelegate respondsToSelector:@selector(lastSelectedIndexPathForSidebarViewController:)]) { 35 | NSIndexPath *indexPath = [self.sidebarDelegate lastSelectedIndexPathForSidebarViewController:self]; 36 | [self.tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; 37 | } 38 | } 39 | 40 | - (void)viewDidUnload 41 | { 42 | [super viewDidUnload]; 43 | // Release any retained subviews of the main view. 44 | // e.g. self.myOutlet = nil; 45 | } 46 | 47 | #pragma mark - Table view data source 48 | 49 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 50 | { 51 | return 1; 52 | } 53 | 54 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 55 | { 56 | return 5; 57 | } 58 | 59 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 60 | { 61 | static NSString *CellIdentifier = @"Cell"; 62 | 63 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 64 | if (cell == nil) { 65 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 66 | } 67 | 68 | cell.textLabel.text = [NSString stringWithFormat:@"ViewController%d", indexPath.row]; 69 | 70 | return cell; 71 | } 72 | 73 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 74 | return self.title; 75 | } 76 | 77 | #pragma mark - Table view delegate 78 | 79 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 80 | if (self.sidebarDelegate) { 81 | NSObject *object = [NSString stringWithFormat:@"ViewController%d", indexPath.row]; 82 | [self.sidebarDelegate sidebarViewController:self didSelectObject:object atIndexPath:indexPath]; 83 | } 84 | } 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by James Apple Tang on 7/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JTRevealSidebarV2Delegate.h" 11 | 12 | // Orientation changing is not an officially completed feature, 13 | // The main thing to fix is the rotation animation and the 14 | // necessarity of the container created in AppDelegate. Please let 15 | // me know if you've got any elegant solution and send me a pull request! 16 | // You can change EXPERIEMENTAL_ORIENTATION_SUPPORT to 1 for testing purpose 17 | #define EXPERIEMENTAL_ORIENTATION_SUPPORT 1 18 | 19 | @class SidebarViewController; 20 | 21 | @interface ViewController : UIViewController { 22 | #if EXPERIEMENTAL_ORIENTATION_SUPPORT 23 | CGPoint _containerOrigin; 24 | #endif 25 | } 26 | 27 | @property (nonatomic, strong) SidebarViewController *leftSidebarViewController; 28 | @property (nonatomic, strong) UITableView *rightSidebarView; 29 | @property (nonatomic, strong) NSIndexPath *leftSelectedIndexPath; 30 | @property (nonatomic, strong) UILabel *label; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JTRevealSidebarDemo 4 | // 5 | // Created by James Apple Tang on 7/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UIViewController+JTRevealSidebarV2.h" 11 | #import "UINavigationItem+JTRevealSidebarV2.h" 12 | #import "SidebarViewController.h" 13 | #import "NewViewController.h" 14 | #import "JTRevealSidebarV2Delegate.h" 15 | 16 | #if EXPERIEMENTAL_ORIENTATION_SUPPORT 17 | #import 18 | #endif 19 | 20 | @interface ViewController (Private) 21 | @end 22 | 23 | @implementation ViewController 24 | 25 | @synthesize leftSidebarViewController; 26 | @synthesize rightSidebarView; 27 | @synthesize leftSelectedIndexPath; 28 | @synthesize label; 29 | 30 | - (id)init { 31 | self = [super init]; 32 | return self; 33 | } 34 | 35 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 36 | - (void)viewDidLoad 37 | { 38 | [super viewDidLoad]; 39 | 40 | self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; 41 | 42 | 43 | self.label = [[UILabel alloc] initWithFrame:CGRectMake(30, 50, 260, 60)]; 44 | self.label.backgroundColor = [UIColor clearColor]; 45 | self.label.textColor = [UIColor whiteColor]; 46 | self.label.textAlignment = UITextAlignmentCenter; 47 | self.label.numberOfLines = 2; 48 | [self.view addSubview:self.label]; 49 | 50 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"ButtonMenu.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(revealLeftSidebar:)]; 51 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemOrganize target:self action:@selector(revealRightSidebar:)]; 52 | 53 | UIButton *pushButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 54 | [pushButton setTitle:@"Push NewViewController" forState:UIControlStateNormal]; 55 | [pushButton sizeToFit]; 56 | [pushButton addTarget:self action:@selector(pushNewViewController:) forControlEvents:UIControlEventTouchUpInside]; 57 | pushButton.frame = (CGRect){10, 150, self.view.frame.size.width - 20, pushButton.frame.size.height}; 58 | [self.view addSubview:pushButton]; 59 | 60 | self.navigationItem.revealSidebarDelegate = self; 61 | } 62 | 63 | - (void)viewDidUnload 64 | { 65 | [super viewDidUnload]; 66 | 67 | self.label = nil; 68 | self.rightSidebarView = nil; 69 | } 70 | 71 | #if EXPERIEMENTAL_ORIENTATION_SUPPORT 72 | 73 | // Doesn't support rotating to other orientation at this moment 74 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 75 | { 76 | // Return YES for supported orientations 77 | return YES; 78 | } 79 | 80 | - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 81 | _containerOrigin = self.navigationController.view.frame.origin; 82 | } 83 | 84 | - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 85 | self.navigationController.view.layer.bounds = (CGRect){-_containerOrigin.x, _containerOrigin.y, self.navigationController.view.frame.size}; 86 | } 87 | 88 | - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { 89 | self.navigationController.view.layer.bounds = (CGRect){CGPointZero, self.navigationController.view.frame.size}; 90 | self.navigationController.view.frame = (CGRect){_containerOrigin, self.navigationController.view.frame.size}; 91 | 92 | NSLog(@"%@", self); 93 | } 94 | 95 | - (NSString *)description { 96 | NSString *logMessage = [NSString stringWithFormat:@"ViewController {"]; 97 | logMessage = [logMessage stringByAppendingFormat:@"\n\t%@", self.view]; 98 | logMessage = [logMessage stringByAppendingFormat:@"\n\t%@", self.navigationController.view]; 99 | logMessage = [logMessage stringByAppendingFormat:@"\n\t%@", self.leftSidebarViewController.view]; 100 | logMessage = [logMessage stringByAppendingFormat:@"\n\t%@", self.rightSidebarView]; 101 | logMessage = [logMessage stringByAppendingFormat:@"\n\t%@", self.navigationController.navigationBar]; 102 | logMessage = [logMessage stringByAppendingFormat:@"\n\t %@", NSStringFromCGRect([[UIApplication sharedApplication] statusBarFrame])]; 103 | logMessage = [logMessage stringByAppendingFormat:@"\n\t %@", NSStringFromCGRect([[UIScreen mainScreen] applicationFrame])]; 104 | logMessage = [logMessage stringByAppendingFormat:@"\n\t %@", NSStringFromCGRect(self.navigationController.applicationViewFrame)]; 105 | logMessage = [logMessage stringByAppendingFormat:@"\n}"]; 106 | return logMessage; 107 | } 108 | 109 | #endif 110 | 111 | #pragma mark Action 112 | 113 | - (void)revealLeftSidebar:(id)sender { 114 | [self.navigationController toggleRevealState:JTRevealedStateLeft]; 115 | } 116 | 117 | - (void)revealRightSidebar:(id)sender { 118 | [self.navigationController toggleRevealState:JTRevealedStateRight]; 119 | } 120 | 121 | - (void)pushNewViewController:(id)sender { 122 | NewViewController *controller = [[NewViewController alloc] init]; 123 | controller.view.backgroundColor = [UIColor whiteColor]; 124 | controller.title = @"NewViewController"; 125 | controller.label.text = @"Pushed NewViewController"; 126 | [self.navigationController pushViewController:controller animated:YES]; 127 | } 128 | 129 | #pragma mark JTRevealSidebarDelegate 130 | 131 | // This is an examle to configure your sidebar view through a custom UIViewController 132 | - (UIView *)viewForLeftSidebar { 133 | // Use applicationViewFrame to get the correctly calculated view's frame 134 | // for use as a reference to our sidebar's view 135 | CGRect viewFrame = self.navigationController.applicationViewFrame; 136 | UITableViewController *controller = self.leftSidebarViewController; 137 | if ( ! controller) { 138 | self.leftSidebarViewController = [[SidebarViewController alloc] init]; 139 | self.leftSidebarViewController.sidebarDelegate = self; 140 | controller = self.leftSidebarViewController; 141 | controller.title = @"LeftSidebarViewController"; 142 | } 143 | controller.view.frame = CGRectMake(0, viewFrame.origin.y, 270, viewFrame.size.height); 144 | controller.view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight; 145 | return controller.view; 146 | } 147 | 148 | // This is an examle to configure your sidebar view without a UIViewController 149 | - (UIView *)viewForRightSidebar { 150 | // Use applicationViewFrame to get the correctly calculated view's frame 151 | // for use as a reference to our sidebar's view 152 | CGRect viewFrame = self.navigationController.applicationViewFrame; 153 | UITableView *view = self.rightSidebarView; 154 | if ( ! view) { 155 | view = self.rightSidebarView = [[UITableView alloc] initWithFrame:CGRectZero]; 156 | view.dataSource = self; 157 | view.delegate = self; 158 | } 159 | view.frame = CGRectMake(self.navigationController.view.frame.size.width - 270, viewFrame.origin.y, 270, viewFrame.size.height); 160 | view.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; 161 | return view; 162 | } 163 | 164 | // Optional delegate methods for additional configuration after reveal state changed 165 | - (void)didChangeRevealedStateForViewController:(UIViewController *)viewController { 166 | // Example to disable userInteraction on content view while sidebar is revealing 167 | if (viewController.revealedState == JTRevealedStateNo) { 168 | self.view.userInteractionEnabled = YES; 169 | } else { 170 | self.view.userInteractionEnabled = NO; 171 | } 172 | } 173 | 174 | @end 175 | 176 | 177 | @implementation ViewController (Private) 178 | 179 | #pragma mark UITableViewDatasource 180 | 181 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 182 | return 20; 183 | } 184 | 185 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 186 | return 1; 187 | } 188 | 189 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 190 | static NSString *cellIdentifier = @"CellIdentifier"; 191 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 192 | if ( ! cell) { 193 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 194 | } 195 | cell.textLabel.text = [NSString stringWithFormat:@"%d", indexPath.row]; 196 | return cell; 197 | } 198 | 199 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 200 | if (tableView == self.rightSidebarView) { 201 | return @"RightSidebar"; 202 | } 203 | return nil; 204 | } 205 | 206 | #pragma mark UITableViewDelegate 207 | 208 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 209 | [self.navigationController setRevealedState:JTRevealedStateNo]; 210 | if (tableView == self.rightSidebarView) { 211 | self.label.text = [NSString stringWithFormat:@"Selected %d at RightSidebarView", indexPath.row]; 212 | } 213 | } 214 | 215 | #pragma mark SidebarViewControllerDelegate 216 | 217 | - (void)sidebarViewController:(SidebarViewController *)sidebarViewController didSelectObject:(NSObject *)object atIndexPath:(NSIndexPath *)indexPath { 218 | 219 | [self.navigationController setRevealedState:JTRevealedStateNo]; 220 | 221 | ViewController *controller = [[ViewController alloc] init]; 222 | controller.view.backgroundColor = [UIColor viewFlipsideBackgroundColor]; 223 | controller.title = (NSString *)object; 224 | controller.leftSidebarViewController = sidebarViewController; 225 | controller.leftSelectedIndexPath = indexPath; 226 | controller.label.text = [NSString stringWithFormat:@"Selected %@ from LeftSidebarViewController", (NSString *)object]; 227 | sidebarViewController.sidebarDelegate = controller; 228 | [self.navigationController setViewControllers:[NSArray arrayWithObject:controller] animated:NO]; 229 | 230 | } 231 | 232 | - (NSIndexPath *)lastSelectedIndexPathForSidebarViewController:(SidebarViewController *)sidebarViewController { 233 | return self.leftSelectedIndexPath; 234 | } 235 | 236 | @end -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JTRevealSidebarDemoV2 4 | // 5 | // Created by James Apple Tang on 7/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2Tests/JTRevealSidebarDemoV2Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.mystcolor.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2Tests/JTRevealSidebarDemoV2Tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // JTRevealSidebarDemoV2Tests.h 3 | // JTRevealSidebarDemoV2Tests 4 | // 5 | // Created by James Apple Tang on 7/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JTRevealSidebarDemoV2Tests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2Tests/JTRevealSidebarDemoV2Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JTRevealSidebarDemoV2Tests.m 3 | // JTRevealSidebarDemoV2Tests 4 | // 5 | // Created by James Apple Tang on 7/12/11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "JTRevealSidebarDemoV2Tests.h" 10 | 11 | @implementation JTRevealSidebarDemoV2Tests 12 | 13 | - (void)setUp 14 | { 15 | [super setUp]; 16 | 17 | // Set-up code here. 18 | } 19 | 20 | - (void)tearDown 21 | { 22 | // Tear-down code here. 23 | 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample 28 | { 29 | STFail(@"Unit tests are not implemented yet in JTRevealSidebarDemoV2Tests"); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /JTRevealSidebarDemoV2Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /JTRevealSidebarV2/JTRevealSidebarV2Delegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol JTRevealSidebarV2Delegate 12 | 13 | @optional 14 | - (UIView *)viewForLeftSidebar; 15 | - (UIView *)viewForRightSidebar; 16 | - (void)willChangeRevealedStateForViewController:(UIViewController *)viewController; 17 | - (void)didChangeRevealedStateForViewController:(UIViewController *)viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /JTRevealSidebarV2/UINavigationItem+JTRevealSidebarV2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol JTRevealSidebarV2Delegate; 12 | 13 | @interface UINavigationItem (JTRevealSidebarV2) 14 | 15 | @property (nonatomic, assign) id revealSidebarDelegate; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /JTRevealSidebarV2/UINavigationItem+JTRevealSidebarV2.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UINavigationItem+JTRevealSidebarV2.h" 10 | #import 11 | 12 | @implementation UINavigationItem (JTRevealSidebarV2) 13 | 14 | static char *revealSidebarDelegateKey; 15 | 16 | - (void)setRevealSidebarDelegate:(id)revealSidebarDelegate { 17 | objc_setAssociatedObject(self, &revealSidebarDelegateKey, revealSidebarDelegate, OBJC_ASSOCIATION_ASSIGN); 18 | } 19 | 20 | - (id )revealSidebarDelegate { 21 | return (id )objc_getAssociatedObject(self, &revealSidebarDelegateKey); 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /JTRevealSidebarV2/UIViewController+JTRevealSidebarV2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | typedef enum { 12 | JTRevealedStateNo, 13 | JTRevealedStateLeft, 14 | JTRevealedStateRight, 15 | } JTRevealedState; 16 | 17 | @interface UIViewController (JTRevealSidebarV2) 18 | 19 | @property (nonatomic, assign) JTRevealedState revealedState; 20 | //- (CGAffineTransform)baseTransform; Not used currently 21 | 22 | // Use applicationViewFrame to get the correctly calculated view's frame 23 | // for use as a reference to our sidebar's view 24 | - (CGRect)applicationViewFrame; 25 | 26 | 27 | // Handy method for toggling between "opening" and JTRevealedStateNo 28 | - (void)toggleRevealState:(JTRevealedState)openingState; 29 | 30 | @end 31 | 32 | 33 | @interface UINavigationController (JTRevealSidebarV2) 34 | - (UIViewController *)selectedViewController; 35 | @end 36 | 37 | -------------------------------------------------------------------------------- /JTRevealSidebarV2/UIViewController+JTRevealSidebarV2.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the JTRevealSidebar package. 3 | * (c) James Tang 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIViewController+JTRevealSidebarV2.h" 10 | #import "UINavigationItem+JTRevealSidebarV2.h" 11 | #import "JTRevealSidebarV2Delegate.h" 12 | #import 13 | 14 | @interface UIViewController (JTRevealSidebarV2Private) 15 | 16 | - (UIViewController *)selectedViewController; 17 | - (void)revealLeftSidebar:(BOOL)showLeftSidebar; 18 | - (void)revealRightSidebar:(BOOL)showRightSidebar; 19 | 20 | @end 21 | 22 | @implementation UIViewController (JTRevealSidebarV2) 23 | 24 | static char *revealedStateKey; 25 | 26 | - (void)setRevealedState:(JTRevealedState)revealedState { 27 | JTRevealedState currentState = self.revealedState; 28 | 29 | if (revealedState == currentState) { 30 | return; 31 | } 32 | 33 | id delegate = [self selectedViewController].navigationItem.revealSidebarDelegate; 34 | // notify delegate for controller will change state 35 | if ([delegate respondsToSelector:@selector(willChangeRevealedStateForViewController:)]) { 36 | [delegate willChangeRevealedStateForViewController:self]; 37 | } 38 | 39 | objc_setAssociatedObject(self, &revealedStateKey, [NSNumber numberWithInt:revealedState], OBJC_ASSOCIATION_RETAIN); 40 | 41 | switch (currentState) { 42 | case JTRevealedStateNo: 43 | if (revealedState == JTRevealedStateLeft) { 44 | [self revealLeftSidebar:YES]; 45 | } else if (revealedState == JTRevealedStateRight) { 46 | [self revealRightSidebar:YES]; 47 | } else { 48 | // Do Nothing 49 | } 50 | break; 51 | case JTRevealedStateLeft: 52 | if (revealedState == JTRevealedStateNo) { 53 | [self revealLeftSidebar:NO]; 54 | } else if (revealedState == JTRevealedStateRight) { 55 | [self revealLeftSidebar:NO]; 56 | [self revealRightSidebar:YES]; 57 | } else { 58 | [self revealLeftSidebar:YES]; 59 | } 60 | break; 61 | case JTRevealedStateRight: 62 | if (revealedState == JTRevealedStateNo) { 63 | [self revealRightSidebar:NO]; 64 | } else if (revealedState == JTRevealedStateLeft) { 65 | [self revealRightSidebar:NO]; 66 | [self revealLeftSidebar:YES]; 67 | } else { 68 | [self revealRightSidebar:YES]; 69 | } 70 | default: 71 | break; 72 | } 73 | } 74 | 75 | - (JTRevealedState)revealedState { 76 | return (JTRevealedState)[objc_getAssociatedObject(self, &revealedStateKey) intValue]; 77 | } 78 | 79 | - (CGAffineTransform)baseTransform { 80 | CGAffineTransform baseTransform; 81 | 82 | return self.view.transform; 83 | switch (self.interfaceOrientation) { 84 | case UIInterfaceOrientationPortrait: 85 | baseTransform = CGAffineTransformIdentity; 86 | break; 87 | case UIInterfaceOrientationLandscapeLeft: 88 | baseTransform = CGAffineTransformMakeRotation(-M_PI/2); 89 | break; 90 | case UIInterfaceOrientationLandscapeRight: 91 | baseTransform = CGAffineTransformMakeRotation(M_PI/2); 92 | break; 93 | default: 94 | baseTransform = CGAffineTransformMakeRotation(M_PI); 95 | break; 96 | } 97 | return baseTransform; 98 | } 99 | 100 | // Converting the applicationFrame from UIWindow is founded to be always correct 101 | - (CGRect)applicationViewFrame { 102 | CGRect appFrame = [[UIScreen mainScreen] applicationFrame]; 103 | CGRect expectedFrame = [self.view convertRect:appFrame fromView:nil]; 104 | return expectedFrame; 105 | } 106 | 107 | - (void)toggleRevealState:(JTRevealedState)openingState { 108 | JTRevealedState state = openingState; 109 | if (self.revealedState == openingState) { 110 | state = JTRevealedStateNo; 111 | } 112 | [self setRevealedState:state]; 113 | } 114 | 115 | @end 116 | 117 | #define SIDEBAR_VIEW_TAG 10000 118 | 119 | @implementation UIViewController (JTRevealSidebarV2Private) 120 | 121 | - (UIViewController *)selectedViewController { 122 | return self; 123 | } 124 | 125 | // Looks like we collasped with the official animationDidStop:finished:context: 126 | // implementation in the default UITabBarController here, that makes us never 127 | // getting the callback we wanted. So we renamed the callback method here. 128 | - (void)animationDidStop2:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { 129 | if ([animationID isEqualToString:@"hideSidebarView"]) { 130 | // Remove the sidebar view after the sidebar closes. 131 | UIView *view = [self.view.superview viewWithTag:(int)context]; 132 | [view removeFromSuperview]; 133 | } 134 | 135 | // notify delegate for controller changed state 136 | id delegate = 137 | [self selectedViewController].navigationItem.revealSidebarDelegate; 138 | if ([delegate respondsToSelector:@selector(didChangeRevealedStateForViewController:)]) { 139 | [delegate didChangeRevealedStateForViewController:self]; 140 | } 141 | } 142 | 143 | - (void)revealLeftSidebar:(BOOL)showLeftSidebar { 144 | 145 | id delegate = [self selectedViewController].navigationItem.revealSidebarDelegate; 146 | 147 | if ( ! [delegate respondsToSelector:@selector(viewForLeftSidebar)]) { 148 | return; 149 | } 150 | 151 | UIView *revealedView = [delegate viewForLeftSidebar]; 152 | revealedView.tag = SIDEBAR_VIEW_TAG; 153 | CGFloat width = CGRectGetWidth(revealedView.frame); 154 | 155 | if (showLeftSidebar) { 156 | [self.view.superview insertSubview:revealedView belowSubview:self.view]; 157 | 158 | [UIView beginAnimations:@"" context:nil]; 159 | // self.view.transform = CGAffineTransformTranslate([self baseTransform], width, 0); 160 | 161 | self.view.frame = CGRectOffset(self.view.frame, width, 0); 162 | 163 | } else { 164 | [UIView beginAnimations:@"hideSidebarView" context:(void *)SIDEBAR_VIEW_TAG]; 165 | // self.view.transform = CGAffineTransformTranslate([self baseTransform], -width, 0); 166 | 167 | self.view.frame = CGRectOffset(self.view.frame, -width, 0); 168 | } 169 | 170 | [UIView setAnimationDidStopSelector:@selector(animationDidStop2:finished:context:)]; 171 | [UIView setAnimationDelegate:self]; 172 | 173 | NSLog(@"%@", NSStringFromCGAffineTransform(self.view.transform)); 174 | 175 | 176 | [UIView commitAnimations]; 177 | } 178 | 179 | - (void)revealRightSidebar:(BOOL)showRightSidebar { 180 | 181 | id delegate = [self selectedViewController].navigationItem.revealSidebarDelegate; 182 | 183 | if ( ! [delegate respondsToSelector:@selector(viewForRightSidebar)]) { 184 | return; 185 | } 186 | 187 | UIView *revealedView = [delegate viewForRightSidebar]; 188 | revealedView.tag = SIDEBAR_VIEW_TAG; 189 | CGFloat width = CGRectGetWidth(revealedView.frame); 190 | revealedView.frame = (CGRect){self.view.frame.size.width - width, revealedView.frame.origin.y, revealedView.frame.size}; 191 | 192 | if (showRightSidebar) { 193 | [self.view.superview insertSubview:revealedView belowSubview:self.view]; 194 | 195 | [UIView beginAnimations:@"" context:nil]; 196 | // self.view.transform = CGAffineTransformTranslate([self baseTransform], -width, 0); 197 | 198 | self.view.frame = CGRectOffset(self.view.frame, -width, 0); 199 | } else { 200 | [UIView beginAnimations:@"hideSidebarView" context:(void *)SIDEBAR_VIEW_TAG]; 201 | // self.view.transform = CGAffineTransformTranslate([self baseTransform], width, 0); 202 | self.view.frame = CGRectOffset(self.view.frame, width, 0); 203 | } 204 | 205 | [UIView setAnimationDidStopSelector:@selector(animationDidStop2:finished:context:)]; 206 | [UIView setAnimationDelegate:self]; 207 | 208 | NSLog(@"%@", NSStringFromCGAffineTransform(self.view.transform)); 209 | 210 | [UIView commitAnimations]; 211 | } 212 | 213 | @end 214 | 215 | 216 | @implementation UINavigationController (JTRevealSidebarV2) 217 | 218 | - (UIViewController *)selectedViewController { 219 | return self.topViewController; 220 | } 221 | 222 | @end -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 James Tang 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JTRevealSidebarV2 (discontinued) 2 | ================= 3 | 4 | _Updated (20 June 2014)_ 5 | 6 | Apple explicitly discourage the "Hamburger Menu". Watch [WWDC 2014 - 211 Designing User Intuitive User Experience](https://developer.apple.com/videos/wwdc/2014/?id=211). 7 | 8 | 9 | - 10 | 11 | Apple isn't encouraging the sidebar pattern, we can see that throughout all the official updated 12 | on iOS 7, they can potentially put it in the Mail app, the AppStore app, but it never gets actually adopted. 13 | 14 | So it's better for me to make this explicitly discontinued than leaving it open. 15 | If you're not convinced, at the mean time you may want to use other libraries 16 | like [ViewDeck](https://github.com/Inferis/ViewDeck), 17 | [PKRevealController](https://github.com/pkluz/PKRevealController), or browse the 18 | [bit.ly bundle](http://bitly.com/bundles/o_27ukkruo5l/1). 19 | 20 | Cheers, 21 | James 22 | 23 | -------------- 24 | 25 | An iOS objective-c library template for mimic the sidebar layout of the new Facebook app and the Path app. 26 | JTRevealSidebarV2 is aimed to be a truly flexible and reusable solution for this which has been carefully implemented. 27 | 28 | It has been developed under iOS 4.3 and 5.0 devices, sample code has been built using ARC, but the library itself should be both ARC and non-ARC compatible. 29 | 30 | Demo 31 | ---- 32 | ![Initialized](https://github.com/mystcolor/JTRevealSidebarDemo/raw/JTRevealSidebarV2/demo1.png) 33 | ![Left Revealed](https://github.com/mystcolor/JTRevealSidebarDemo/raw/JTRevealSidebarV2/demo2.png) 34 | ![Left Selected](https://github.com/mystcolor/JTRevealSidebarDemo/raw/JTRevealSidebarV2/demo3.png) 35 | ![Right Revealed](https://github.com/mystcolor/JTRevealSidebarDemo/raw/JTRevealSidebarV2/demo4.png) 36 | ![New Pushed](https://github.com/mystcolor/JTRevealSidebarDemo/raw/JTRevealSidebarV2/demo5.png) 37 | ![New Right Revealed](https://github.com/mystcolor/JTRevealSidebarDemo/raw/JTRevealSidebarV2/demo6.png) 38 | 39 | Abstract 40 | -------- 41 | 42 | In JTRevealSidebarV2, all sidebars should be considered as navigation items, each sidebar is expected to be able to configure directly through the current view controller. 43 | It is designed to be used with UINavigationController, but technically it should work on other subclasses of UIViewControllers. 44 | 45 | How To Use It 46 | ------------- 47 | 48 | ### Installation 49 | 50 | Method 1: 51 | Include all header and implementation files in JTRevealSidebarV2/ into your project. 52 | 53 | Method 2: 54 | Using [CocoaPods](https://github.com/CocoaPods/CocoaPods). 55 | 56 | Method 3: (Thanks for [gpascale](https://github.com/gpascale)) 57 | Include as static library into your project. [View the instructions](http://mystcolor.me/post/25785144262/getting-static-libraries-into-your-ios-project) 58 | 59 | ### Setting up your first sidebar, configure your viewController and conform to the JTRevealSidebarV2Delegate 60 | 61 | @interface ViewController () 62 | @end 63 | 64 | @implementation ViewController 65 | 66 | - (void)viewDidLoad 67 | { 68 | [super viewDidLoad]; 69 | 70 | self.navigationItem.revealSidebarDelegate = self; 71 | } 72 | /* 73 | : 74 | : 75 | */ 76 | #pragma mark JTRevealSidebarDelegate 77 | 78 | // This is an examle to configure your sidebar view through a custom UIViewController 79 | - (UIView *)viewForLeftSidebar { 80 | // Use applicationViewFrame to get the correctly calculated view's frame 81 | // for use as a reference to our sidebar's view 82 | CGRect viewFrame = self.navigationController.applicationViewFrame; 83 | UITableViewController *controller = self.leftSidebarViewController; 84 | if ( ! controller) { 85 | self.leftSidebarViewController = [[SidebarViewController alloc] init]; 86 | self.leftSidebarViewController.sidebarDelegate = self; 87 | controller = self.leftSidebarViewController; 88 | controller.title = @"LeftSidebarViewController"; 89 | } 90 | controller.view.frame = CGRectMake(0, viewFrame.origin.y, 270, viewFrame.size.height); 91 | controller.view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight; 92 | return controller.view; 93 | } 94 | 95 | // This is an examle to configure your sidebar view without a UIViewController 96 | - (UIView *)viewForRightSidebar { 97 | // Use applicationViewFrame to get the correctly calculated view's frame 98 | // for use as a reference to our sidebar's view 99 | CGRect viewFrame = self.navigationController.applicationViewFrame; 100 | UITableView *view = self.rightSidebarView; 101 | if ( ! view) { 102 | view = self.rightSidebarView = [[UITableView alloc] initWithFrame:CGRectZero]; 103 | view.dataSource = self; 104 | view.delegate = self; 105 | } 106 | view.frame = CGRectMake(self.navigationController.view.frame.size.width - 270, viewFrame.origin.y, 270, viewFrame.size.height); 107 | view.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight; 108 | return view; 109 | } 110 | 111 | // Optional delegate methods for additional configuration after reveal state changed 112 | - (void)didChangeRevealedStateForViewController:(UIViewController *)viewController { 113 | // Example to disable userInteraction on content view while sidebar is revealing 114 | if (viewController.revealedState == JTRevealedStateNo) { 115 | self.view.userInteractionEnabled = YES; 116 | } else { 117 | self.view.userInteractionEnabled = NO; 118 | } 119 | } 120 | 121 | ### Interacting and revealing your sidebar 122 | 123 | @implementation ViewController 124 | /* 125 | : 126 | : 127 | */ 128 | #pragma mark Action 129 | 130 | - (void)revealLeftSidebar:(id)sender { 131 | [self.navigationController toggleRevealState:JTRevealedStateLeft]; 132 | } 133 | 134 | - (void)revealRightSidebar:(id)sender { 135 | [self.navigationController toggleRevealState:JTRevealedStateRight]; 136 | } 137 | 138 | @end 139 | 140 | ### Known Issues 141 | 142 | Orientation changing is not an officially completed feature, the main thing to fix is the rotation animation and the necessarity of the container created in AppDelegate. Please let me know if you've got any elegant solution and send me a pull request! 143 | Go to JTRevealSidebarV2/ViewController.h and change EXPERIEMENTAL_ORIENTATION_SUPPORT to 1 for testing purpose. 144 | 145 | 29/3/2012 updated: 146 | Added handy method for toggling reveal state, also added example to disable user interaction while sidebar is revealing 147 | 148 | 31/1/2012 updated: 149 | Improved orientation support with a better animation, now you needed to #import <QuartzCore/QuartzCore.h> in your project for this sake 150 | 151 | 1/2/2012 update: 152 | Fixed #6 Wrong origin for sidebar views when first revealed in landscape mode (Experiental), the orientation support should be ready! 153 | 154 | 155 | ### Reminder 156 | 157 | Remember to check out the sample working code in JTRevealSidebarDemoV2/ViewController.m, feel free to provide feedback and pull requests. Thanks! 158 | 159 | James 160 | 161 | 162 | 163 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/jamztang/jtrevealsidebardemo/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 164 | 165 | -------------------------------------------------------------------------------- /demo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/demo1.png -------------------------------------------------------------------------------- /demo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/demo2.png -------------------------------------------------------------------------------- /demo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/demo3.png -------------------------------------------------------------------------------- /demo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/demo4.png -------------------------------------------------------------------------------- /demo5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/demo5.png -------------------------------------------------------------------------------- /demo6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamztang/JTRevealSidebarDemo/b91f29ffc683e78767e3454aa4691b84b4ffe504/demo6.png --------------------------------------------------------------------------------