├── .gitignore ├── Classes ├── JDSideMenu.h ├── JDSideMenu.m ├── UIViewController+JDSideMenu.h └── UIViewController+JDSideMenu.m ├── JDSideMenu.podspec ├── JDSideMenu.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── JDSideMenu ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon57x57.png │ │ ├── Icon57x57@2x.png │ │ ├── Icon60x60@2x.png │ │ ├── Icon72x72.png │ │ ├── Icon72x72@2x.png │ │ ├── Icon76x76.png │ │ └── Icon76x76@2x.png │ ├── LaunchImage.launchimage │ │ └── Contents.json │ └── menuwallpaper.imageset │ │ ├── Contents.json │ │ └── menuwallpaper@2x.png ├── JDAppDelegate.h ├── JDAppDelegate.m ├── JDMenuViewController.h ├── JDMenuViewController.m ├── JDMenuViewController.xib ├── JDSideMenu-Info.plist ├── JDSideMenu-Prefix.pch └── main.m ├── LICENCE ├── README.md └── gfx └── screenshots.png /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *~.nib 4 | 5 | build/ 6 | 7 | *.pbxuser 8 | *.perspective 9 | *.perspectivev3 10 | 11 | xcuserdata 12 | 13 | # CocoaPods 14 | Pods 15 | 16 | # IDE 17 | .idea/* 18 | -------------------------------------------------------------------------------- /Classes/JDSideMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // JDSideMenu.h 3 | // StatusBarTest 4 | // 5 | // Created by Markus Emrich on 11/11/13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JDSideMenu : UIViewController 12 | 13 | @property (nonatomic, readonly) UIViewController *contentController; 14 | @property (nonatomic, readonly) UIViewController *menuController; 15 | 16 | @property (nonatomic, assign) CGFloat menuWidth; 17 | @property (nonatomic, assign) BOOL tapGestureEnabled; 18 | @property (nonatomic, assign) BOOL panGestureEnabled; 19 | 20 | - (id)initWithContentController:(UIViewController*)contentController 21 | menuController:(UIViewController*)menuController; 22 | 23 | - (void)setContentController:(UIViewController*)contentController 24 | animated:(BOOL)animated; 25 | 26 | // show / hide manually 27 | - (void)showMenuAnimated:(BOOL)animated; 28 | - (void)hideMenuAnimated:(BOOL)animated; 29 | - (BOOL)isMenuVisible; 30 | 31 | // background 32 | - (void)setBackgroundImage:(UIImage*)image; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/JDSideMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // JDSideMenu.m 3 | // StatusBarTest 4 | // 5 | // Created by Markus Emrich on 11/11/13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import "JDSideMenu.h" 10 | 11 | // constants 12 | const CGFloat JDSideMenuMinimumRelativePanDistanceToOpen = 0.33; 13 | const CGFloat JDSideMenuDefaultMenuWidth = 260.0; 14 | const CGFloat JDSideMenuDefaultDamping = 0.5; 15 | 16 | // animation times 17 | const CGFloat JDSideMenuDefaultOpenAnimationTime = 1.0; 18 | const CGFloat JDSideMenuDefaultCloseAnimationTime = 0.3; 19 | 20 | @interface JDSideMenu () 21 | @property (nonatomic, strong) UIImageView *backgroundView; 22 | @property (nonatomic, strong) UIView *containerView; 23 | @property (nonatomic, strong) UITapGestureRecognizer *tapRecognizer; 24 | @property (nonatomic, strong) UIPanGestureRecognizer *panRecognizer; 25 | @end 26 | 27 | @implementation JDSideMenu 28 | 29 | - (id)initWithContentController:(UIViewController*)contentController 30 | menuController:(UIViewController*)menuController; 31 | { 32 | self = [super initWithNibName:nil bundle:nil]; 33 | if (self) { 34 | _contentController = contentController; 35 | _menuController = menuController; 36 | 37 | _menuWidth = JDSideMenuDefaultMenuWidth; 38 | _tapGestureEnabled = YES; 39 | _panGestureEnabled = YES; 40 | } 41 | return self; 42 | } 43 | 44 | #pragma mark UIViewController 45 | 46 | - (void)viewDidLoad; 47 | { 48 | [super viewDidLoad]; 49 | 50 | // add childcontroller 51 | [self addChildViewController:self.menuController]; 52 | [self.menuController didMoveToParentViewController:self]; 53 | [self addChildViewController:self.contentController]; 54 | [self.contentController didMoveToParentViewController:self]; 55 | 56 | // add subviews 57 | _containerView = [[UIView alloc] initWithFrame:self.view.bounds]; 58 | _containerView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight; 59 | [self.containerView addSubview:self.contentController.view]; 60 | self.contentController.view.frame = self.containerView.bounds; 61 | self.contentController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 62 | [self.view addSubview:_containerView]; 63 | 64 | // setup gesture recognizers 65 | self.tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized:)]; 66 | self.panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panRecognized:)]; 67 | [self.containerView addGestureRecognizer:self.tapRecognizer]; 68 | [self.containerView addGestureRecognizer:self.panRecognizer]; 69 | } 70 | 71 | - (void)setBackgroundImage:(UIImage*)image; 72 | { 73 | if (!self.backgroundView && image) { 74 | self.backgroundView = [[UIImageView alloc] initWithImage:image]; 75 | self.backgroundView.frame = self.view.bounds; 76 | self.backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 77 | [self.view insertSubview:self.backgroundView atIndex:0]; 78 | } else if (image == nil) { 79 | [self.backgroundView removeFromSuperview]; 80 | self.backgroundView = nil; 81 | } else { 82 | self.backgroundView.image = image; 83 | } 84 | } 85 | 86 | #pragma mark controller replacement 87 | 88 | - (void)setContentController:(UIViewController*)contentController 89 | animated:(BOOL)animated; 90 | { 91 | if (contentController == nil) return; 92 | UIViewController *previousController = self.contentController; 93 | _contentController = contentController; 94 | 95 | // add childcontroller 96 | [self addChildViewController:self.contentController]; 97 | 98 | // add subview 99 | self.contentController.view.frame = self.containerView.bounds; 100 | self.contentController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 101 | 102 | // animate in 103 | __weak typeof(self) blockSelf = self; 104 | CGFloat offset = JDSideMenuDefaultMenuWidth + (self.view.frame.size.width-JDSideMenuDefaultMenuWidth)/2.0; 105 | [UIView animateWithDuration:JDSideMenuDefaultCloseAnimationTime/2.0 animations:^{ 106 | blockSelf.containerView.transform = CGAffineTransformMakeTranslation(offset, 0); 107 | [blockSelf statusBarView].transform = blockSelf.containerView.transform; 108 | } completion:^(BOOL finished) { 109 | // move to container view 110 | [blockSelf.containerView addSubview:self.contentController.view]; 111 | [blockSelf.contentController didMoveToParentViewController:blockSelf]; 112 | 113 | // remove old controller 114 | [previousController willMoveToParentViewController:nil]; 115 | [previousController removeFromParentViewController]; 116 | [previousController.view removeFromSuperview]; 117 | 118 | [blockSelf hideMenuAnimated:YES]; 119 | }]; 120 | } 121 | 122 | #pragma mark Animation 123 | 124 | - (void)tapRecognized:(UITapGestureRecognizer*)recognizer 125 | { 126 | if (!self.tapGestureEnabled) return; 127 | 128 | if (![self isMenuVisible]) { 129 | [self showMenuAnimated:YES]; 130 | } else { 131 | [self hideMenuAnimated:YES]; 132 | } 133 | } 134 | 135 | - (void)panRecognized:(UIPanGestureRecognizer*)recognizer 136 | { 137 | if (!self.panGestureEnabled) return; 138 | 139 | CGPoint translation = [recognizer translationInView:recognizer.view]; 140 | CGPoint velocity = [recognizer velocityInView:recognizer.view]; 141 | 142 | switch (recognizer.state) { 143 | case UIGestureRecognizerStateBegan: { 144 | [self addMenuControllerView]; 145 | [recognizer setTranslation:CGPointMake(recognizer.view.frame.origin.x, 0) inView:recognizer.view]; 146 | break; 147 | } 148 | case UIGestureRecognizerStateChanged: { 149 | [recognizer.view setTransform:CGAffineTransformMakeTranslation(MAX(0,translation.x), 0)]; 150 | [self statusBarView].transform = recognizer.view.transform; 151 | break; 152 | } 153 | case UIGestureRecognizerStateEnded: 154 | case UIGestureRecognizerStateCancelled: { 155 | if (velocity.x > 5.0 || (velocity.x >= -1.0 && translation.x > JDSideMenuMinimumRelativePanDistanceToOpen*self.menuWidth)) { 156 | CGFloat transformedVelocity = velocity.x/ABS(self.menuWidth - translation.x); 157 | CGFloat duration = JDSideMenuDefaultOpenAnimationTime * 0.66; 158 | [self showMenuAnimated:YES duration:duration initialVelocity:transformedVelocity]; 159 | } else { 160 | [self hideMenuAnimated:YES]; 161 | } 162 | } 163 | default: 164 | break; 165 | } 166 | } 167 | 168 | - (void)addMenuControllerView; 169 | { 170 | if (self.menuController.view.superview == nil) { 171 | CGRect menuFrame, restFrame; 172 | CGRectDivide(self.view.bounds, &menuFrame, &restFrame, self.menuWidth, CGRectMinXEdge); 173 | self.menuController.view.frame = menuFrame; 174 | self.menuController.view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight; 175 | self.view.backgroundColor = self.menuController.view.backgroundColor; 176 | if (self.backgroundView) [self.view insertSubview:self.menuController.view aboveSubview:self.backgroundView]; 177 | else [self.view insertSubview:self.menuController.view atIndex:0]; 178 | } 179 | } 180 | 181 | - (void)showMenuAnimated:(BOOL)animated; 182 | { 183 | [self showMenuAnimated:animated duration:JDSideMenuDefaultOpenAnimationTime 184 | initialVelocity:1.0]; 185 | } 186 | 187 | - (void)showMenuAnimated:(BOOL)animated duration:(CGFloat)duration 188 | initialVelocity:(CGFloat)velocity; 189 | { 190 | // add menu view 191 | [self addMenuControllerView]; 192 | 193 | // animate 194 | __weak typeof(self) blockSelf = self; 195 | [UIView animateWithDuration:animated ? duration : 0.0 delay:0 196 | usingSpringWithDamping:JDSideMenuDefaultDamping initialSpringVelocity:velocity options:UIViewAnimationOptionAllowUserInteraction animations:^{ 197 | blockSelf.containerView.transform = CGAffineTransformMakeTranslation(self.menuWidth, 0); 198 | [self statusBarView].transform = blockSelf.containerView.transform; 199 | } completion:nil]; 200 | } 201 | 202 | - (void)hideMenuAnimated:(BOOL)animated; 203 | { 204 | __weak typeof(self) blockSelf = self; 205 | [UIView animateWithDuration:JDSideMenuDefaultCloseAnimationTime animations:^{ 206 | blockSelf.containerView.transform = CGAffineTransformIdentity; 207 | [self statusBarView].transform = blockSelf.containerView.transform; 208 | } completion:^(BOOL finished) { 209 | [blockSelf.menuController.view removeFromSuperview]; 210 | }]; 211 | } 212 | 213 | #pragma mark State 214 | 215 | - (BOOL)isMenuVisible; 216 | { 217 | return !CGAffineTransformEqualToTransform(self.containerView.transform, 218 | CGAffineTransformIdentity); 219 | } 220 | 221 | #pragma mark Statusbar 222 | 223 | - (UIView*)statusBarView; 224 | { 225 | UIView *statusBar = nil; 226 | NSData *data = [NSData dataWithBytes:(unsigned char []){0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x61, 0x72} length:9]; 227 | NSString *key = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; 228 | id object = [UIApplication sharedApplication]; 229 | if ([object respondsToSelector:NSSelectorFromString(key)]) statusBar = [object valueForKey:key]; 230 | return statusBar; 231 | } 232 | 233 | @end 234 | -------------------------------------------------------------------------------- /Classes/UIViewController+JDSideMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+JDSideMenu.h 3 | // JDSideMenu 4 | // 5 | // Created by Markus Emrich on 11.11.13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import "JDSideMenu.h" 10 | 11 | @interface UIViewController (JDSideMenu) 12 | 13 | - (JDSideMenu*)sideMenuController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/UIViewController+JDSideMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+JDSideMenu.m 3 | // JDSideMenu 4 | // 5 | // Created by Markus Emrich on 11.11.13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+JDSideMenu.h" 10 | 11 | @implementation UIViewController (JDSideMenu) 12 | 13 | - (JDSideMenu*)sideMenuController; 14 | { 15 | UIViewController *controller = self.parentViewController; 16 | while (controller) { 17 | if ([controller isKindOfClass:[JDSideMenu class]]) { 18 | return (JDSideMenu*)controller; 19 | } 20 | controller = controller.parentViewController; 21 | } 22 | return nil; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /JDSideMenu.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 4 | 5 | s.name = "JDSideMenu" 6 | s.version = "0.0.1" 7 | s.summary = "A short description of JDSideMenu." 8 | 9 | s.description = <<-DESC 10 | A longer description of JDSideMenu in Markdown format. 11 | DESC 12 | 13 | s.homepage = "http://EXAMPLE/JDSideMenu" 14 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" 15 | 16 | 17 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 18 | 19 | s.license = "MIT (example)" 20 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 21 | 22 | 23 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 24 | 25 | s.author = "Markus Emrich" 26 | s.social_media_url = "http://twitter.com/Markus Emrich" 27 | 28 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 29 | 30 | s.platform = :ios, "6.0" 31 | 32 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 33 | 34 | s.source = { :git => "https://github.com/jaydee3/JDSideMenu.git", :tag => "0.0.1" } 35 | 36 | 37 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 38 | 39 | s.source_files = "Classes/**/*.{h,m}" 40 | 41 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 42 | 43 | s.requires_arc = true 44 | 45 | end 46 | -------------------------------------------------------------------------------- /JDSideMenu.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D22E0F721848AA7800F7AAB7 /* JDMenuViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D22E0F711848AA7800F7AAB7 /* JDMenuViewController.xib */; }; 11 | D24FE86018490CCA0008B05D /* JDSideMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = D24FE85D18490CCA0008B05D /* JDSideMenu.m */; }; 12 | D24FE86118490CCA0008B05D /* UIViewController+JDSideMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = D24FE85F18490CCA0008B05D /* UIViewController+JDSideMenu.m */; }; 13 | D27F25131830594800F04515 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D27F25121830594800F04515 /* Foundation.framework */; }; 14 | D27F25151830594800F04515 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D27F25141830594800F04515 /* CoreGraphics.framework */; }; 15 | D27F25171830594800F04515 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D27F25161830594800F04515 /* UIKit.framework */; }; 16 | D27F251F1830594800F04515 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F251E1830594800F04515 /* main.m */; }; 17 | D27F25231830594800F04515 /* JDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F25221830594800F04515 /* JDAppDelegate.m */; }; 18 | D27F25251830594800F04515 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D27F25241830594800F04515 /* Images.xcassets */; }; 19 | D27F254718305C6B00F04515 /* JDMenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F254518305C6B00F04515 /* JDMenuViewController.m */; }; 20 | D27F254B18305E4000F04515 /* UIViewController+JDSideMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = D27F254A18305E4000F04515 /* UIViewController+JDSideMenu.m */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | D22E0F711848AA7800F7AAB7 /* JDMenuViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = JDMenuViewController.xib; sourceTree = ""; }; 25 | D24FE85C18490CCA0008B05D /* JDSideMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JDSideMenu.h; sourceTree = ""; }; 26 | D24FE85D18490CCA0008B05D /* JDSideMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JDSideMenu.m; sourceTree = ""; }; 27 | D24FE85E18490CCA0008B05D /* UIViewController+JDSideMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+JDSideMenu.h"; sourceTree = ""; }; 28 | D24FE85F18490CCA0008B05D /* UIViewController+JDSideMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+JDSideMenu.m"; sourceTree = ""; }; 29 | D27F250F1830594800F04515 /* JDSideMenu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JDSideMenu.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | D27F25121830594800F04515 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 31 | D27F25141830594800F04515 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 32 | D27F25161830594800F04515 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 33 | D27F251A1830594800F04515 /* JDSideMenu-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "JDSideMenu-Info.plist"; sourceTree = ""; }; 34 | D27F251E1830594800F04515 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | D27F25201830594800F04515 /* JDSideMenu-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JDSideMenu-Prefix.pch"; sourceTree = ""; }; 36 | D27F25211830594800F04515 /* JDAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JDAppDelegate.h; sourceTree = ""; }; 37 | D27F25221830594800F04515 /* JDAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JDAppDelegate.m; sourceTree = ""; }; 38 | D27F25241830594800F04515 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 39 | D27F252B1830594800F04515 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 40 | D27F254418305C6B00F04515 /* JDMenuViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JDMenuViewController.h; sourceTree = ""; }; 41 | D27F254518305C6B00F04515 /* JDMenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JDMenuViewController.m; sourceTree = ""; }; 42 | D27F254918305E4000F04515 /* UIViewController+JDSideMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+JDSideMenu.h"; path = "Classes/UIViewController+JDSideMenu.h"; sourceTree = SOURCE_ROOT; }; 43 | D27F254A18305E4000F04515 /* UIViewController+JDSideMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+JDSideMenu.m"; path = "Classes/UIViewController+JDSideMenu.m"; sourceTree = SOURCE_ROOT; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | D27F250C1830594800F04515 /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | D27F25151830594800F04515 /* CoreGraphics.framework in Frameworks */, 52 | D27F25171830594800F04515 /* UIKit.framework in Frameworks */, 53 | D27F25131830594800F04515 /* Foundation.framework in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | D24FE85B18490CCA0008B05D /* JDSideMenu */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | D24FE85C18490CCA0008B05D /* JDSideMenu.h */, 64 | D24FE85D18490CCA0008B05D /* JDSideMenu.m */, 65 | D24FE85E18490CCA0008B05D /* UIViewController+JDSideMenu.h */, 66 | D24FE85F18490CCA0008B05D /* UIViewController+JDSideMenu.m */, 67 | ); 68 | name = JDSideMenu; 69 | path = Classes; 70 | sourceTree = ""; 71 | }; 72 | D27F25061830594800F04515 = { 73 | isa = PBXGroup; 74 | children = ( 75 | D24FE85B18490CCA0008B05D /* JDSideMenu */, 76 | D27F25181830594800F04515 /* Example */, 77 | D27F25111830594800F04515 /* Frameworks */, 78 | D27F25101830594800F04515 /* Products */, 79 | ); 80 | sourceTree = ""; 81 | }; 82 | D27F25101830594800F04515 /* Products */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | D27F250F1830594800F04515 /* JDSideMenu.app */, 86 | ); 87 | name = Products; 88 | sourceTree = ""; 89 | }; 90 | D27F25111830594800F04515 /* Frameworks */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | D27F25121830594800F04515 /* Foundation.framework */, 94 | D27F25141830594800F04515 /* CoreGraphics.framework */, 95 | D27F25161830594800F04515 /* UIKit.framework */, 96 | D27F252B1830594800F04515 /* XCTest.framework */, 97 | ); 98 | name = Frameworks; 99 | sourceTree = ""; 100 | }; 101 | D27F25181830594800F04515 /* Example */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | D27F25211830594800F04515 /* JDAppDelegate.h */, 105 | D27F25221830594800F04515 /* JDAppDelegate.m */, 106 | D27F254418305C6B00F04515 /* JDMenuViewController.h */, 107 | D27F254518305C6B00F04515 /* JDMenuViewController.m */, 108 | D22E0F711848AA7800F7AAB7 /* JDMenuViewController.xib */, 109 | D27F254918305E4000F04515 /* UIViewController+JDSideMenu.h */, 110 | D27F254A18305E4000F04515 /* UIViewController+JDSideMenu.m */, 111 | D27F25241830594800F04515 /* Images.xcassets */, 112 | D27F25191830594800F04515 /* Supporting Files */, 113 | ); 114 | name = Example; 115 | path = JDSideMenu; 116 | sourceTree = ""; 117 | }; 118 | D27F25191830594800F04515 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | D27F251A1830594800F04515 /* JDSideMenu-Info.plist */, 122 | D27F251E1830594800F04515 /* main.m */, 123 | D27F25201830594800F04515 /* JDSideMenu-Prefix.pch */, 124 | ); 125 | name = "Supporting Files"; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | D27F250E1830594800F04515 /* JDSideMenu */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = D27F253B1830594800F04515 /* Build configuration list for PBXNativeTarget "JDSideMenu" */; 134 | buildPhases = ( 135 | D27F250B1830594800F04515 /* Sources */, 136 | D27F250C1830594800F04515 /* Frameworks */, 137 | D27F250D1830594800F04515 /* Resources */, 138 | ); 139 | buildRules = ( 140 | ); 141 | dependencies = ( 142 | ); 143 | name = JDSideMenu; 144 | productName = JDSideMenu; 145 | productReference = D27F250F1830594800F04515 /* JDSideMenu.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | D27F25071830594800F04515 /* Project object */ = { 152 | isa = PBXProject; 153 | attributes = { 154 | CLASSPREFIX = JD; 155 | LastUpgradeCheck = 0500; 156 | ORGANIZATIONNAME = "Markus Emrich"; 157 | }; 158 | buildConfigurationList = D27F250A1830594800F04515 /* Build configuration list for PBXProject "JDSideMenu" */; 159 | compatibilityVersion = "Xcode 3.2"; 160 | developmentRegion = English; 161 | hasScannedForEncodings = 0; 162 | knownRegions = ( 163 | en, 164 | ); 165 | mainGroup = D27F25061830594800F04515; 166 | productRefGroup = D27F25101830594800F04515 /* Products */; 167 | projectDirPath = ""; 168 | projectRoot = ""; 169 | targets = ( 170 | D27F250E1830594800F04515 /* JDSideMenu */, 171 | ); 172 | }; 173 | /* End PBXProject section */ 174 | 175 | /* Begin PBXResourcesBuildPhase section */ 176 | D27F250D1830594800F04515 /* Resources */ = { 177 | isa = PBXResourcesBuildPhase; 178 | buildActionMask = 2147483647; 179 | files = ( 180 | D27F25251830594800F04515 /* Images.xcassets in Resources */, 181 | D22E0F721848AA7800F7AAB7 /* JDMenuViewController.xib in Resources */, 182 | ); 183 | runOnlyForDeploymentPostprocessing = 0; 184 | }; 185 | /* End PBXResourcesBuildPhase section */ 186 | 187 | /* Begin PBXSourcesBuildPhase section */ 188 | D27F250B1830594800F04515 /* Sources */ = { 189 | isa = PBXSourcesBuildPhase; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | D27F25231830594800F04515 /* JDAppDelegate.m in Sources */, 193 | D24FE86018490CCA0008B05D /* JDSideMenu.m in Sources */, 194 | D27F251F1830594800F04515 /* main.m in Sources */, 195 | D24FE86118490CCA0008B05D /* UIViewController+JDSideMenu.m in Sources */, 196 | D27F254718305C6B00F04515 /* JDMenuViewController.m in Sources */, 197 | D27F254B18305E4000F04515 /* UIViewController+JDSideMenu.m in Sources */, 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | }; 201 | /* End PBXSourcesBuildPhase section */ 202 | 203 | /* Begin XCBuildConfiguration section */ 204 | D27F25391830594800F04515 /* Debug */ = { 205 | isa = XCBuildConfiguration; 206 | buildSettings = { 207 | ALWAYS_SEARCH_USER_PATHS = NO; 208 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 209 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 210 | CLANG_CXX_LIBRARY = "libc++"; 211 | CLANG_ENABLE_MODULES = YES; 212 | CLANG_ENABLE_OBJC_ARC = YES; 213 | CLANG_WARN_BOOL_CONVERSION = YES; 214 | CLANG_WARN_CONSTANT_CONVERSION = YES; 215 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 216 | CLANG_WARN_EMPTY_BODY = YES; 217 | CLANG_WARN_ENUM_CONVERSION = YES; 218 | CLANG_WARN_INT_CONVERSION = YES; 219 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 220 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 221 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 222 | COPY_PHASE_STRIP = NO; 223 | GCC_C_LANGUAGE_STANDARD = gnu99; 224 | GCC_DYNAMIC_NO_PIC = NO; 225 | GCC_OPTIMIZATION_LEVEL = 0; 226 | GCC_PREPROCESSOR_DEFINITIONS = ( 227 | "DEBUG=1", 228 | "$(inherited)", 229 | ); 230 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 231 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 232 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 233 | GCC_WARN_UNDECLARED_SELECTOR = YES; 234 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 235 | GCC_WARN_UNUSED_FUNCTION = YES; 236 | GCC_WARN_UNUSED_VARIABLE = YES; 237 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 238 | ONLY_ACTIVE_ARCH = YES; 239 | SDKROOT = iphoneos; 240 | TARGETED_DEVICE_FAMILY = "1,2"; 241 | }; 242 | name = Debug; 243 | }; 244 | D27F253A1830594800F04515 /* Release */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | ALWAYS_SEARCH_USER_PATHS = NO; 248 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 250 | CLANG_CXX_LIBRARY = "libc++"; 251 | CLANG_ENABLE_MODULES = YES; 252 | CLANG_ENABLE_OBJC_ARC = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_CONSTANT_CONVERSION = YES; 255 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 256 | CLANG_WARN_EMPTY_BODY = YES; 257 | CLANG_WARN_ENUM_CONVERSION = YES; 258 | CLANG_WARN_INT_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 261 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 262 | COPY_PHASE_STRIP = YES; 263 | ENABLE_NS_ASSERTIONS = NO; 264 | GCC_C_LANGUAGE_STANDARD = gnu99; 265 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 266 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 267 | GCC_WARN_UNDECLARED_SELECTOR = YES; 268 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 269 | GCC_WARN_UNUSED_FUNCTION = YES; 270 | GCC_WARN_UNUSED_VARIABLE = YES; 271 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 272 | SDKROOT = iphoneos; 273 | TARGETED_DEVICE_FAMILY = "1,2"; 274 | VALIDATE_PRODUCT = YES; 275 | }; 276 | name = Release; 277 | }; 278 | D27F253C1830594800F04515 /* Debug */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 282 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 283 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 284 | GCC_PREFIX_HEADER = "JDSideMenu/JDSideMenu-Prefix.pch"; 285 | INFOPLIST_FILE = "JDSideMenu/JDSideMenu-Info.plist"; 286 | PRODUCT_NAME = "$(TARGET_NAME)"; 287 | WRAPPER_EXTENSION = app; 288 | }; 289 | name = Debug; 290 | }; 291 | D27F253D1830594800F04515 /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 296 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 297 | GCC_PREFIX_HEADER = "JDSideMenu/JDSideMenu-Prefix.pch"; 298 | INFOPLIST_FILE = "JDSideMenu/JDSideMenu-Info.plist"; 299 | PRODUCT_NAME = "$(TARGET_NAME)"; 300 | WRAPPER_EXTENSION = app; 301 | }; 302 | name = Release; 303 | }; 304 | /* End XCBuildConfiguration section */ 305 | 306 | /* Begin XCConfigurationList section */ 307 | D27F250A1830594800F04515 /* Build configuration list for PBXProject "JDSideMenu" */ = { 308 | isa = XCConfigurationList; 309 | buildConfigurations = ( 310 | D27F25391830594800F04515 /* Debug */, 311 | D27F253A1830594800F04515 /* Release */, 312 | ); 313 | defaultConfigurationIsVisible = 0; 314 | defaultConfigurationName = Release; 315 | }; 316 | D27F253B1830594800F04515 /* Build configuration list for PBXNativeTarget "JDSideMenu" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | D27F253C1830594800F04515 /* Debug */, 320 | D27F253D1830594800F04515 /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | /* End XCConfigurationList section */ 326 | }; 327 | rootObject = D27F25071830594800F04515 /* Project object */; 328 | } 329 | -------------------------------------------------------------------------------- /JDSideMenu.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "size" : "57x57", 20 | "idiom" : "iphone", 21 | "filename" : "Icon57x57.png", 22 | "scale" : "1x" 23 | }, 24 | { 25 | "size" : "57x57", 26 | "idiom" : "iphone", 27 | "filename" : "Icon57x57@2x.png", 28 | "scale" : "2x" 29 | }, 30 | { 31 | "size" : "60x60", 32 | "idiom" : "iphone", 33 | "filename" : "Icon60x60@2x.png", 34 | "scale" : "2x" 35 | }, 36 | { 37 | "idiom" : "ipad", 38 | "size" : "29x29", 39 | "scale" : "1x" 40 | }, 41 | { 42 | "idiom" : "ipad", 43 | "size" : "29x29", 44 | "scale" : "2x" 45 | }, 46 | { 47 | "idiom" : "ipad", 48 | "size" : "40x40", 49 | "scale" : "1x" 50 | }, 51 | { 52 | "idiom" : "ipad", 53 | "size" : "40x40", 54 | "scale" : "2x" 55 | }, 56 | { 57 | "idiom" : "ipad", 58 | "size" : "50x50", 59 | "scale" : "1x" 60 | }, 61 | { 62 | "idiom" : "ipad", 63 | "size" : "50x50", 64 | "scale" : "2x" 65 | }, 66 | { 67 | "size" : "72x72", 68 | "idiom" : "ipad", 69 | "filename" : "Icon72x72.png", 70 | "scale" : "1x" 71 | }, 72 | { 73 | "size" : "72x72", 74 | "idiom" : "ipad", 75 | "filename" : "Icon72x72@2x.png", 76 | "scale" : "2x" 77 | }, 78 | { 79 | "size" : "76x76", 80 | "idiom" : "ipad", 81 | "filename" : "Icon76x76.png", 82 | "scale" : "1x" 83 | }, 84 | { 85 | "size" : "76x76", 86 | "idiom" : "ipad", 87 | "filename" : "Icon76x76@2x.png", 88 | "scale" : "2x" 89 | } 90 | ], 91 | "info" : { 92 | "version" : 1, 93 | "author" : "xcode" 94 | } 95 | } -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon57x57.png -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon57x57@2x.png -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon60x60@2x.png -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon72x72.png -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon72x72@2x.png -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon76x76.png -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/AppIcon.appiconset/Icon76x76@2x.png -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/menuwallpaper.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "menuwallpaper@2x.png" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /JDSideMenu/Images.xcassets/menuwallpaper.imageset/menuwallpaper@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/JDSideMenu/Images.xcassets/menuwallpaper.imageset/menuwallpaper@2x.png -------------------------------------------------------------------------------- /JDSideMenu/JDAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHAppDelegate.h 3 | // StatusBarTest 4 | // 5 | // Created by Markus Emrich on 11/11/13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JDAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /JDSideMenu/JDAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHAppDelegate.m 3 | // StatusBarTest 4 | // 5 | // Created by Markus Emrich on 11/11/13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import "JDSideMenu.h" 10 | #import "JDMenuViewController.h" 11 | 12 | #import "JDAppDelegate.h" 13 | 14 | @implementation JDAppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | [self.window makeKeyAndVisible]; 20 | 21 | UIViewController *menuController = [[JDMenuViewController alloc] init]; 22 | UIViewController *contentController = [[UIViewController alloc] init]; 23 | contentController.view.backgroundColor = [UIColor colorWithHue:0.5 saturation:1.0 brightness:1.0 alpha:1.0]; 24 | contentController.title = [NSString stringWithFormat: @"Hue: %.2f", 0.5]; 25 | 26 | UIViewController *navController = [[UINavigationController alloc] initWithRootViewController:contentController]; 27 | JDSideMenu *sideMenu = [[JDSideMenu alloc] initWithContentController:navController 28 | menuController:menuController]; 29 | [sideMenu setBackgroundImage:[UIImage imageNamed:@"menuwallpaper"]]; 30 | self.window.rootViewController = sideMenu; 31 | 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /JDSideMenu/JDMenuViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JDMenuViewController.h 3 | // JDSideMenu 4 | // 5 | // Created by Markus Emrich on 11.11.13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JDMenuViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JDSideMenu/JDMenuViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JDMenuViewController.m 3 | // JDSideMenu 4 | // 5 | // Created by Markus Emrich on 11.11.13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+JDSideMenu.h" 10 | 11 | #import "JDMenuViewController.h" 12 | 13 | @interface JDMenuViewController () 14 | @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; 15 | - (IBAction)switchController:(id)sender; 16 | @end 17 | 18 | @implementation JDMenuViewController 19 | 20 | - (void)viewDidLayoutSubviews; 21 | { 22 | [super viewDidLayoutSubviews]; 23 | self.scrollView.contentSize = CGRectInset(self.scrollView.bounds, 0, -1).size; 24 | } 25 | 26 | - (IBAction)switchController:(id)sender; 27 | { 28 | CGFloat randomHue = (arc4random()%256/256.0); 29 | UIViewController *viewController = [[UIViewController alloc] init]; 30 | viewController.view.backgroundColor = [UIColor colorWithHue:randomHue saturation:1.0 brightness:1.0 alpha:1.0]; 31 | viewController.title = [NSString stringWithFormat: @"Hue: %.2f", randomHue]; 32 | 33 | UIViewController *contentController = [[UINavigationController alloc] 34 | initWithRootViewController:viewController]; 35 | [self.sideMenuController setContentController:contentController animated:YES]; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /JDSideMenu/JDMenuViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 33 | 44 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /JDSideMenu/JDSideMenu-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | markusemrich.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /JDSideMenu/JDSideMenu-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /JDSideMenu/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JDSideMenu 4 | // 5 | // Created by Markus Emrich on 11.11.13. 6 | // Copyright (c) 2013 Markus Emrich. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "JDAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([JDAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | Copyright © 2013 Markus Emrich 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | 25 | (MIT License) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JDSideMenu 2 | ========== 3 | 4 | A basic implementation of a side menu Controller. 5 | It moves the ios7 Statusbar to the right toghether with the controller to reveal a menu underneath. 6 | 7 | ![Screenshots](gfx/screenshots.png) 8 | 9 | 10 | -------------------------------------------------------------------------------- /gfx/screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/calimarkus/JDSideMenu/2eb607e003fa958fd8f8b8ceaebed5850812b11c/gfx/screenshots.png --------------------------------------------------------------------------------