├── .gitignore ├── AUTHORS ├── AppledocSettings.plist ├── CodingConventions.md ├── FRLayeredNavigationController.podspec ├── FRLayeredNavigationController.xcodeproj └── project.pbxproj ├── FRLayeredNavigationController ├── FRDLog.h ├── FRLayerChromeView.h ├── FRLayerChromeView.m ├── FRLayerController+Protected.h ├── FRLayerController.h ├── FRLayerController.m ├── FRLayeredNavigation.h ├── FRLayeredNavigationController-Prefix.pch ├── FRLayeredNavigationController.h ├── FRLayeredNavigationController.m ├── FRLayeredNavigationItem+Protected.h ├── FRLayeredNavigationItem.h ├── FRLayeredNavigationItem.m ├── FRNavigationBar.h ├── FRNavigationBar.m ├── FRiOSVersion.h ├── FRiOSVersion.m ├── UIViewController+FRLayeredNavigationController.h ├── UIViewController+FRLayeredNavigationController.m ├── Utils.h └── Utils.m ├── FRLayeredNavigationControllerDemo ├── AppDelegate.h ├── AppDelegate.m ├── FRLayeredNavigationControllerDemo-Info.plist ├── FRLayeredNavigationControllerDemo-Prefix.pch ├── MainViewController.h ├── MainViewController.m ├── SampleContentViewController.h ├── SampleContentViewController.m ├── SampleListViewController.h ├── SampleListViewController.m ├── back.png ├── en.lproj │ └── InfoPlist.strings ├── main.m └── mandel.jpg ├── FRLayeredNavigationControllerRotation.png ├── FRLayeredNavigationControllerScreenshot-iOS7.png ├── FRLayeredNavigationControllerScreenshot1.png ├── FRLayeredNavigationControllerScreenshot2.png ├── LICENSE ├── README.md ├── VERSION ├── docs ├── .gitignore └── html │ ├── Categories │ └── UIViewController+FRLayeredNavigationController.html │ ├── Classes │ ├── FRLayeredNavigationController.html │ ├── FRLayeredNavigationItem.html │ └── FRNavigationBar.html │ ├── Protocols │ └── FRLayeredNavigationControllerDelegate.html │ ├── css │ ├── styles.css │ └── stylesPrint.css │ ├── hierarchy.html │ ├── img │ ├── button_bar_background.png │ ├── disclosure.png │ ├── disclosure_open.png │ ├── library_background.png │ └── title_background.png │ └── index.html ├── generate-html-documentation.sh └── syncheck.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | *.xcworkspace 12 | !default.xcworkspace 13 | xcuserdata 14 | profile 15 | *.moved-aside 16 | .DS_Store 17 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | ------- 3 | 4 | Johannes Weiß for factis research GmbH (http://factisresearch.com) and others. 5 | -------------------------------------------------------------------------------- /AppledocSettings.plist: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | --input 7 | 8 | FRLayeredNavigationController 9 | 10 | --project-name 11 | FRLayeredNavigationController 12 | --project-company 13 | factis research GmbH 14 | --company-id 15 | com.factisresearch 16 | --output 17 | docs 18 | 19 | 20 | -------------------------------------------------------------------------------- /CodingConventions.md: -------------------------------------------------------------------------------- 1 | Coding Conventions 2 | ================== 3 | 4 | - 120 characters per line 5 | - 4 spaces instead of tabs 6 | - no trailing whitespace (or other whitespace errors) 7 | - define methods like in the code sample below 8 | - Use autosynthesization (instead of old `@synthesize`) 9 | 10 | Sample code 11 | ----------- 12 | 13 | - (SomeType *)myMehodName 14 | { 15 | /* code */ 16 | } 17 | 18 | 19 | Check script 20 | ------------ 21 | 22 | Just run `./syncheck.sh` in the root directory of FRLayeredNavigationController. 23 | 24 | Automatic check when committing 25 | ------------------------------- 26 | 27 | Just paste the following in a terminal (being at the root directory of 28 | FRLayeredNavigationController). Paste it entirely (one-shot). This will give you 29 | automatic checking when committing. 30 | 31 | cat > .git/hooks/pre-commit < 'weiss@tux4u.de' } 8 | 9 | s.source = { :git => 'https://github.com/weissi/FRLayeredNavigationController.git', :tag => 'v0.4.4' } 10 | 11 | s.description = 'FRLayeredNavigationController gives iPad developers a simple drop-in replacement for UINavigationController for great UIs. It is a view controller compositor which enables you to develop -- as we think -- great iPad apps. Influenced by the UI of the Twitter and Soundcloud iPad apps.' 12 | 13 | s.platform = :ios, '5.0' 14 | 15 | s.ios.source_files = 'FRLayeredNavigationController/*.{h,m}' 16 | 17 | s.framework = 'UIKit' 18 | 19 | s.requires_arc = true 20 | end 21 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRDLog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* http://kuoi.com/~kamikaze/read.php?id=158 */ 30 | #ifdef DEBUG 31 | #define FRDLOG(fmt, ...) NSLog(@"%s: " fmt, __PRETTY_FUNCTION__, ##__VA_ARGS__) 32 | #else 33 | #define FRDLOG(...) 34 | #endif 35 | 36 | #define FRWLOG(fmt, ...) NSLog(@"%s: " fmt, __PRETTY_FUNCTION__, ##__VA_ARGS__) 37 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayerChromeView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | #import 31 | 32 | @interface FRLayerChromeView : UIView { 33 | CGGradientRef _savedGradient; 34 | } 35 | 36 | - (id)initWithFrame:(CGRect)frame titleView:(UIView *)titleView title:(NSString *)titleText yOffset:(CGFloat)yOffset; 37 | 38 | @property (nonatomic, strong) UIBarButtonItem *leftBarButtonItem; 39 | @property (nonatomic, strong) UIBarButtonItem *rightBarButtonItem; 40 | @property (nonatomic, readonly, strong) UIToolbar *toolbar; 41 | @property (nonatomic, strong) UIView *titleView; 42 | @property (nonatomic, strong) NSString *title; 43 | @property (nonatomic, readonly, assign) CGFloat yOffset; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayerChromeView.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | 31 | /* Local Imports */ 32 | #import "FRLayerChromeView.h" 33 | #import "Utils.h" 34 | #import "FRNavigationBar.h" 35 | #import "FRiOSVersion.h" 36 | 37 | @interface FRLayerChromeView () { 38 | UIView *_savedBackgroundView; 39 | } 40 | 41 | @property (nonatomic, readonly, strong) UIView *savedBackgroundView; 42 | @property (nonatomic, assign, readonly) BOOL iOS7OrNewer; 43 | 44 | @end 45 | 46 | @implementation FRLayerChromeView 47 | 48 | - (id)initWithFrame:(CGRect)frame titleView:(UIView *)titleView title:(NSString *)titleText yOffset:(CGFloat)yOffset 49 | { 50 | self = [super initWithFrame:frame]; 51 | if (self) { 52 | _savedGradient = nil; 53 | self.backgroundColor = [UIColor clearColor]; 54 | 55 | _toolbar = [[UIToolbar alloc] initWithFrame:CGRectZero]; 56 | _toolbar.clipsToBounds = YES; 57 | [_toolbar setBackgroundImage:[Utils transparentImage] 58 | forToolbarPosition:UIToolbarPositionAny 59 | barMetrics:UIBarMetricsDefault]; 60 | [self addSubview:_toolbar]; 61 | 62 | _title = titleText; 63 | _yOffset = yOffset; 64 | _iOS7OrNewer = [FRiOSVersion isIOS7OrNewer]; 65 | 66 | if (titleView == nil) { 67 | UILabel *titleLabel = [[UILabel alloc] init]; 68 | const NSDictionary *titleTextAttrs = [[FRNavigationBar appearance] titleTextAttributes]; 69 | 70 | titleLabel.backgroundColor = [UIColor clearColor]; 71 | titleLabel.text = titleText; 72 | titleLabel.textAlignment = UITextAlignmentCenter; 73 | 74 | 75 | titleLabel.font = titleTextAttrs[UITextAttributeFont]; 76 | 77 | titleLabel.textColor = titleTextAttrs[UITextAttributeTextColor]; 78 | 79 | titleLabel.shadowColor = titleTextAttrs[UITextAttributeTextShadowColor]; 80 | 81 | if (titleTextAttrs[UITextAttributeTextShadowOffset]){ 82 | titleLabel.shadowOffset = [titleTextAttrs[UITextAttributeTextShadowOffset] CGSizeValue]; 83 | } 84 | 85 | self.titleView = titleLabel; 86 | } else { 87 | self.titleView = titleView; 88 | } 89 | [self addSubview:self.titleView]; 90 | [self manageToolbar]; 91 | } 92 | return self; 93 | } 94 | 95 | - (void)dealloc 96 | { 97 | CGGradientRelease(self->_savedGradient); 98 | self->_savedGradient = NULL; 99 | } 100 | 101 | - (void)manageToolbar 102 | { 103 | UIBarButtonItem *flexibleSpace = 104 | [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace 105 | target:nil 106 | action:nil]; 107 | 108 | if (self.leftBarButtonItem && self.rightBarButtonItem) { 109 | [self.toolbar setItems:@[_leftBarButtonItem, flexibleSpace, _rightBarButtonItem]]; 110 | } else if (self.leftBarButtonItem) { 111 | [self.toolbar setItems:@[_leftBarButtonItem]]; 112 | } else if (self.rightBarButtonItem) { 113 | [self.toolbar setItems:@[flexibleSpace, _rightBarButtonItem]]; 114 | } 115 | 116 | [self setNeedsLayout]; 117 | } 118 | 119 | - (void)setLeftBarButtonItem:(UIBarButtonItem *)leftBarButtonItem 120 | { 121 | _leftBarButtonItem = leftBarButtonItem; 122 | [self manageToolbar]; 123 | } 124 | 125 | - (void)setRightBarButtonItem:(UIBarButtonItem *)rightBarButtonItem 126 | { 127 | _rightBarButtonItem = rightBarButtonItem; 128 | [self manageToolbar]; 129 | } 130 | 131 | - (void)setTitle:(NSString *)aTitle 132 | { 133 | if ([self.titleView isKindOfClass:[UILabel class]]) { 134 | UILabel *label = (UILabel *)self.titleView; 135 | label.text = aTitle; 136 | self->_title = aTitle; 137 | [self setNeedsLayout]; 138 | } 139 | } 140 | 141 | - (void)layoutSubviews 142 | { 143 | [super layoutSubviews]; 144 | 145 | CGFloat barButtonItemsSpace = (self.leftBarButtonItem!=nil?48:0) + (self.rightBarButtonItem!=nil?48:0); 146 | 147 | self.toolbar.frame = CGRectMake(0, 148 | self.yOffset, 149 | CGRectGetWidth(self.bounds), 150 | CGRectGetHeight(self.bounds)-self.yOffset); 151 | 152 | CGRect headerMiddleFrame = CGRectMake(10 + (barButtonItemsSpace/2), 153 | 0, 154 | CGRectGetWidth(self.bounds)-20-barButtonItemsSpace, 155 | CGRectGetHeight(self.bounds)-self.yOffset); 156 | 157 | CGSize titleFittingSize = [self.titleView sizeThatFits:headerMiddleFrame.size]; 158 | CGRect titleFrame = CGRectMake(0 /* irrelevant, will be overriden by centering it */, 159 | MAX((headerMiddleFrame.size.height - titleFittingSize.height)/2, 160 | headerMiddleFrame.origin.y), 161 | MIN(titleFittingSize.width, headerMiddleFrame.size.width), 162 | MIN(titleFittingSize.height, headerMiddleFrame.size.height)); 163 | 164 | self.titleView.frame = titleFrame; 165 | self.titleView.center = self.center; 166 | self.titleView.frame = CGRectMake(CGRectGetMinX(self.titleView.frame), 167 | CGRectGetMinY(self.titleView.frame)+(self.yOffset/2), 168 | CGRectGetWidth(self.titleView.frame), 169 | CGRectGetHeight(self.titleView.frame)); 170 | } 171 | 172 | - (CGGradientRef)gradientIOS6AndOlder 173 | { 174 | if (NULL == _savedGradient) { 175 | CGFloat colors[12] = { 176 | 244.0f/255.0f, 245.0f/255.0f, 247.0f/255.0f, 1.0, 177 | 223.0f/255.0f, 225.0f/255.0f, 230.0f/255.0f, 1.0, 178 | 167.0f/244.0f, 171.0f/255.0f, 184.0f/255.0f, 1.0, 179 | }; 180 | CGFloat locations[3] = { 0.05f, 0.45f, 0.95f }; 181 | 182 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 183 | 184 | _savedGradient = CGGradientCreateWithColorComponents(colorSpace, 185 | colors, 186 | locations, 187 | 3); 188 | 189 | CGColorSpaceRelease(colorSpace); 190 | } 191 | 192 | return _savedGradient; 193 | } 194 | 195 | - (CGGradientRef)gradientIOS7AndNewer 196 | { 197 | if (NULL == _savedGradient) { 198 | CGFloat colors[12] = { 199 | 248.0f/255.0f, 248.0f/255.0f, 248.0f/255.0f, 0.97f, 200 | 248.0f/255.0f, 248.0f/255.0f, 248.0f/255.0f, 0.97f, 201 | 248.0f/255.0f, 248.0f/255.0f, 248.0f/255.0f, 0.97f, 202 | }; 203 | CGFloat locations[3] = { 0.05f, 0.45f, 0.95f }; 204 | 205 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 206 | 207 | _savedGradient = CGGradientCreateWithColorComponents(colorSpace, 208 | colors, 209 | locations, 210 | 3); 211 | 212 | CGColorSpaceRelease(colorSpace); 213 | } 214 | 215 | return _savedGradient; 216 | } 217 | 218 | - (UIView *)savedBackgroundView 219 | { 220 | if (!_savedBackgroundView && [[FRNavigationBar appearance] backgroundImage] ){ 221 | _savedBackgroundView = [[UIImageView alloc] initWithImage:[[FRNavigationBar appearance] backgroundImage]]; 222 | _savedBackgroundView.frame = CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); 223 | _savedBackgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth; 224 | } 225 | 226 | return _savedBackgroundView; 227 | } 228 | 229 | - (void)drawRectIO6AndOlder:(__unused CGRect)rect 230 | { 231 | if (self.savedBackgroundView && self.savedBackgroundView.superview == nil) { 232 | [self insertSubview:self.savedBackgroundView atIndex:0]; 233 | } else { 234 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 235 | 236 | UIBezierPath *path = 237 | [UIBezierPath bezierPathWithRoundedRect:self.bounds 238 | byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight 239 | cornerRadii:CGSizeMake(10, 10)]; 240 | [path addClip]; 241 | 242 | CGPoint start = CGPointMake(CGRectGetMidX(self.bounds), 0); 243 | CGPoint end = CGPointMake(CGRectGetMidX(self.bounds), 244 | CGRectGetMaxY(self.bounds)); 245 | 246 | CGGradientRef gradient = [self gradientIOS6AndOlder]; 247 | 248 | CGContextDrawLinearGradient(ctx, gradient, start, end, 0); 249 | } 250 | } 251 | 252 | - (void)drawRectIO7AndNewer:(__unused CGRect)rect 253 | { 254 | if (self.savedBackgroundView && self.savedBackgroundView.superview == nil) { 255 | [self insertSubview:self.savedBackgroundView atIndex:0]; 256 | } else { 257 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 258 | 259 | CGPoint start = CGPointMake(CGRectGetMidX(self.bounds), 0); 260 | CGPoint end = CGPointMake(CGRectGetMidX(self.bounds), 261 | CGRectGetMaxY(self.bounds)); 262 | 263 | CGGradientRef gradient = [self gradientIOS7AndNewer]; 264 | 265 | CGContextDrawLinearGradient(ctx, gradient, start, end, 0); 266 | } 267 | } 268 | 269 | - (void)drawRect:(CGRect)rect 270 | { 271 | if (self.iOS7OrNewer) { 272 | [self drawRectIO7AndNewer:rect]; 273 | } else { 274 | [self drawRectIO6AndOlder:rect]; 275 | } 276 | } 277 | 278 | 279 | @end 280 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayerController+Protected.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Local Imports */ 30 | #import "FRLayerController.h" 31 | 32 | @interface FRLayerController (Protected) 33 | 34 | @property (nonatomic, strong) FRLayerChromeView *chromeView; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayerController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | #import 31 | 32 | @class FRLayerChromeView; 33 | @class FRLayeredNavigationItem; 34 | 35 | @interface FRLayerController : UIViewController { 36 | @private 37 | FRLayeredNavigationItem *_layeredNavigationItem; 38 | 39 | BOOL _maximumWidth; 40 | 41 | FRLayerChromeView *_chromeView; 42 | UIView *_borderView; 43 | UIView __weak *_contentView; 44 | 45 | UIViewController *_contentViewController; 46 | } 47 | 48 | - (id)initWithContentViewController:(UIViewController *)contentViewController maximumWidth:(BOOL)maxWidth; 49 | 50 | @property (nonatomic, readonly, strong) FRLayeredNavigationItem *layeredNavigationItem; 51 | @property (nonatomic, readonly, strong) UIViewController *contentViewController; 52 | @property (nonatomic, readonly) BOOL maximumWidth; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayerController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | #import 31 | 32 | /* Local Imports */ 33 | #import "FRDLog.h" 34 | #import "FRLayerController.h" 35 | #import "FRLayerChromeView.h" 36 | #import "FRLayeredNavigationItem+Protected.h" 37 | #import "FRiOSVersion.h" 38 | 39 | @interface FRLayerController () 40 | 41 | @property (nonatomic, readwrite, strong) UIViewController *contentViewController; 42 | @property (nonatomic, readwrite, strong) FRLayeredNavigationItem *layeredNavigationItem; 43 | @property (nonatomic, readwrite) BOOL maximumWidth; 44 | 45 | @property (nonatomic, strong) FRLayerChromeView *chromeView; 46 | @property (nonatomic, strong) UIView *borderView; 47 | @property (nonatomic, weak) UIView *contentView; 48 | 49 | @property (nonatomic, assign, readonly) BOOL isIOS7OrNewer; 50 | 51 | @end 52 | 53 | @implementation FRLayerController 54 | 55 | #pragma mark - init/dealloc 56 | 57 | - (id)initWithContentViewController:(UIViewController *)vc maximumWidth:(BOOL)maxWidth 58 | { 59 | if ((self = [super init])) { 60 | _layeredNavigationItem = [[FRLayeredNavigationItem alloc] init]; 61 | _layeredNavigationItem.layerController = self; 62 | _contentViewController = vc; 63 | _isIOS7OrNewer = [FRiOSVersion isIOS7OrNewer]; 64 | [_contentViewController addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:nil]; 65 | _maximumWidth = maxWidth; 66 | } 67 | 68 | return self; 69 | } 70 | 71 | - (void)observeValueForKeyPath:(NSString *)keyPath 72 | ofObject:(__unused id)object 73 | change:(NSDictionary *)change 74 | context:(__unused void *)context 75 | { 76 | if ([keyPath isEqualToString:@"title"]) { 77 | self.chromeView.title = change[@"new"]; 78 | } 79 | } 80 | 81 | - (void)dealloc 82 | { 83 | self.layeredNavigationItem.layerController = nil; 84 | [_contentViewController removeObserver:self forKeyPath:@"title"]; 85 | } 86 | 87 | #pragma mark - internal methods 88 | 89 | - (CGFloat)layerChromeHeight 90 | { 91 | return self.isIOS7OrNewer ? 64 : 44; 92 | } 93 | 94 | - (CGFloat)layerChromeOffset 95 | { 96 | return self.isIOS7OrNewer ? 20 : 0; 97 | } 98 | 99 | - (void)doViewLayout 100 | { 101 | CGRect contentFrame = CGRectZero; 102 | CGRect borderFrame = CGRectZero; 103 | const CGFloat borderSpacing = self.layeredNavigationItem.hasBorder ? 1 : 0; 104 | 105 | if (self.layeredNavigationItem.hasChrome) { 106 | CGRect chromeFrame = CGRectMake(0, 107 | 0, 108 | CGRectGetWidth(self.view.bounds), 109 | [self layerChromeHeight]); 110 | borderFrame = CGRectMake(0, 111 | [self layerChromeHeight], 112 | CGRectGetWidth(self.view.bounds), 113 | CGRectGetHeight(self.view.bounds)-[self layerChromeHeight]); 114 | contentFrame = CGRectMake(borderSpacing, 115 | [self layerChromeHeight] + borderSpacing, 116 | CGRectGetWidth(self.view.bounds)-(2*borderSpacing), 117 | CGRectGetHeight(self.view.bounds)-[self layerChromeHeight]-(2*borderSpacing)); 118 | self.chromeView.frame = chromeFrame; 119 | } else { 120 | borderFrame = CGRectMake(0, 121 | 0, 122 | CGRectGetWidth(self.view.bounds), 123 | CGRectGetHeight(self.view.bounds)); 124 | contentFrame = CGRectMake(borderSpacing, 125 | borderSpacing, 126 | CGRectGetWidth(self.view.bounds)-(2*borderSpacing), 127 | CGRectGetHeight(self.view.bounds)-(2*borderSpacing)); 128 | } 129 | 130 | if (self.layeredNavigationItem.hasBorder) { 131 | self.borderView.frame = borderFrame; 132 | } 133 | if (self.layeredNavigationItem.autosizeContent) { 134 | UIView * const contentView = self.contentView; 135 | contentView.frame = contentFrame; 136 | } 137 | } 138 | 139 | 140 | #pragma mark - UIViewController interface methods 141 | 142 | - (void)loadView 143 | { 144 | self.view = [[UIView alloc] init]; 145 | self.view.backgroundColor = [UIColor clearColor]; 146 | const FRLayeredNavigationItem * const navItem = self.layeredNavigationItem; 147 | UIView * const contentView = self.contentView; 148 | 149 | if (navItem.hasBorder) { 150 | self.borderView = [[UIView alloc] init]; 151 | self.borderView.backgroundColor = [UIColor clearColor]; 152 | self.borderView.layer.borderWidth = 1; 153 | self.borderView.layer.borderColor = [UIColor colorWithWhite:236.0f/255.0f alpha:1].CGColor; 154 | [self.view addSubview:self.borderView]; 155 | } 156 | 157 | if (self.layeredNavigationItem.hasChrome) { 158 | self.chromeView = [[FRLayerChromeView alloc] initWithFrame:CGRectZero 159 | titleView:navItem.titleView 160 | title:navItem.title == nil ? 161 | self.contentViewController.title : navItem.title 162 | yOffset:[self layerChromeOffset]]; 163 | 164 | [self.view addSubview:self.chromeView]; 165 | } 166 | 167 | if (contentView == nil && self.contentViewController.parentViewController == self) { 168 | /* when loaded again after a low memory view removal */ 169 | self.contentView = self.contentViewController.view; 170 | } 171 | 172 | if (contentView != nil) { 173 | [self.view addSubview:contentView]; 174 | } 175 | } 176 | 177 | - (void)viewWillLayoutSubviews 178 | { 179 | if (self.layeredNavigationItem.displayShadow) { 180 | self.view.layer.shadowRadius = 10.0; 181 | self.view.layer.shadowOffset = CGSizeMake(-2.0, -3.0); 182 | self.view.layer.shadowOpacity = 0.5; 183 | self.view.layer.shadowColor = [UIColor blackColor].CGColor; 184 | self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath; 185 | } 186 | 187 | [self doViewLayout]; 188 | } 189 | 190 | - (void)viewDidUnload 191 | { 192 | [super viewDidUnload]; 193 | FRDLOG(@"FRLayerController (%@): viewDidUnload", self); 194 | 195 | self.borderView = nil; 196 | self.chromeView = nil; 197 | self.contentView = nil; 198 | } 199 | 200 | - (BOOL)shouldAutorotateToInterfaceOrientation:(__unused UIInterfaceOrientation)interfaceOrientation 201 | { 202 | return YES; 203 | } 204 | 205 | - (void)willMoveToParentViewController:(UIViewController *)parent 206 | { 207 | [super willMoveToParentViewController:parent]; 208 | UIView *contentView = self.contentView; 209 | 210 | if (parent != nil) { 211 | /* will shortly attach to parent */ 212 | [self addChildViewController:self.contentViewController]; 213 | 214 | contentView = self.contentViewController.view; 215 | self.contentView = contentView; 216 | [self.view addSubview:contentView]; 217 | } else { 218 | /* will shortly detach from parent view controller */ 219 | [self.contentViewController willMoveToParentViewController:nil]; 220 | 221 | [contentView removeFromSuperview]; 222 | self.contentView = nil; 223 | } 224 | } 225 | 226 | - (void)didMoveToParentViewController:(UIViewController *)parent 227 | { 228 | [super didMoveToParentViewController:parent]; 229 | 230 | if (parent != nil) { 231 | /* just attached to parent view controller */ 232 | [self.contentViewController didMoveToParentViewController:self]; 233 | } else { 234 | /* did just detach */ 235 | [self.contentViewController removeFromParentViewController]; 236 | } 237 | } 238 | 239 | @end 240 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayeredNavigation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Local Imports */ 30 | #import "FRLayeredNavigationController.h" 31 | #import "FRLayeredNavigationItem.h" 32 | #import "UIViewController+FRLayeredNavigationController.h" 33 | #import "FRNavigationBar.h" 34 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayeredNavigationController-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'FRLayeredNavigationController' target in the 'FRLayeredNavigationController' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayeredNavigationController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | #import 31 | 32 | /* Local Imports */ 33 | #import "Utils.h" 34 | 35 | @class FRLayeredNavigationItem; 36 | @class FRLayeredNavigationController; 37 | /** 38 | * The FRLayeredNavigationControllerDelegate protocol is used by delegates of FRLayeredNavigationController 39 | * to detect actions such as views starting to move, in the process of moving, and finished moving. This allows 40 | * apps which have content 'underneath' the layered controller to adjust it appropriately. 41 | */ 42 | @protocol FRLayeredNavigationControllerDelegate 43 | @optional 44 | /** 45 | * Sent by the layered navigation controller when it is about to begin moving a view controller. This message 46 | * is only sent if the controller can be moved. 47 | * 48 | * @param layeredController The layered controller being interacted with. 49 | * @param controller The view controller which is about to be moved. 50 | */ 51 | - (void)layeredNavigationController:(FRLayeredNavigationController*)layeredController 52 | willMoveController:(UIViewController*)controller; 53 | 54 | /** 55 | * Sent by the layered navigation controller when it is moving a view controller. This message 56 | * may be sent multiple times over the course of an interaction, and so any code implemented by 57 | * the delegate here should be efficient. 58 | * 59 | * @param layeredController The layered controller being interacted with. 60 | * @param controller The view controller which is currently being moved. 61 | */ 62 | - (void)layeredNavigationController:(FRLayeredNavigationController*)layeredController 63 | movingViewController:(UIViewController*)controller; 64 | 65 | /** 66 | * Sent by the layered navigation controller when it has finished moving a view controller. 67 | * 68 | * @param layeredController The layered controller being interacted with. 69 | * @param controller The view controller which has finished moving. 70 | */ 71 | - (void)layeredNavigationController:(FRLayeredNavigationController*)layeredController 72 | didMoveController:(UIViewController*)controller; 73 | 74 | @end 75 | 76 | typedef enum { 77 | FRLayeredAnimationDirectionUp = 1, 78 | FRLayeredAnimationDirectionDown, 79 | FRLayeredAnimationDirectionLeft, 80 | FRLayeredAnimationDirectionRight 81 | } FRLayeredAnimationDirection; 82 | 83 | /** 84 | * The FRLayeredNavigationController class implements a container view controller that manages the navigation 85 | * of hierarchical content. This class is not intended for subclassing. 86 | * 87 | * The API and the usage is very similar to UINavigationController . 88 | */ 89 | @interface FRLayeredNavigationController : UIViewController 90 | 91 | /** 92 | * Initializes and returns a newly created layered navigation controller. 93 | * 94 | * @param rootViewController The view controller that resides at the bottom of the navigation stack. 95 | */ 96 | - (id)initWithRootViewController:(UIViewController *)rootViewController; 97 | 98 | /** 99 | * Initializes and returns a newly created layered navigation controller. 100 | * Does the same as initWithRootViewController: but has the ability to configure some parameters for the 101 | * root view controller. 102 | * 103 | * @param rootViewController The view controller that resides at the bottom of the navigation stack. 104 | * @param configuration A block object you can use to control some parameters (such as the width) for the root view 105 | * controller. The block's only parameter is an instance of FRLayeredNavigationItem . 106 | */ 107 | - (id)initWithRootViewController:(UIViewController *)rootViewController 108 | configuration:(void (^)(FRLayeredNavigationItem *item))configuration; 109 | 110 | /** 111 | * Pops the top view controller from the navigation stack and updates the display. 112 | * 113 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 114 | * controller before its view is displayed. 115 | */ 116 | - (void)popViewControllerAnimated:(BOOL)animated; 117 | 118 | /** 119 | * Pops the top view controller from the navigation stack and updates the display. 120 | * 121 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 122 | * controller before its view is displayed. 123 | * 124 | * @param direction Set this value to an FRLayeredAnimationDirection indicating the direction that layer 125 | * will animate off the screen. This parameter is ignored if animated is NO. 126 | */ 127 | - (void)popViewControllerAnimated:(BOOL)animated direction:(FRLayeredAnimationDirection)direction; 128 | 129 | /** 130 | * Pops all the view controllers on the stack except the root view controller and updates the display. 131 | * 132 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 133 | * controller before its view is displayed. 134 | */ 135 | - (void)popToRootViewControllerAnimated:(BOOL)animated; 136 | 137 | /** 138 | * Pops all the view controllers on the stack except the root view controller and updates the display. 139 | * 140 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 141 | * controller before its view is displayed. 142 | * 143 | * @param direction Set this value to an FRLayeredAnimationDirection indicating the direction that layers 144 | * will animate off the screen. This parameter is ignored if animated is NO. 145 | */ 146 | - (void)popToRootViewControllerAnimated:(BOOL)animated direction:(FRLayeredAnimationDirection)direction; 147 | 148 | /** 149 | * Pops view controllers until the specified view controller is at the top of the navigation stack. 150 | * 151 | * @param vc The view controller until which to pop. 152 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 153 | * controller before its view is displayed. 154 | */ 155 | - (void)popToViewController:(UIViewController *)vc animated:(BOOL)animated; 156 | 157 | /** 158 | * Pops view controllers until the specified view controller is at the top of the navigation stack. 159 | * 160 | * @param vc The view controller until which to pop. 161 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 162 | * controller before its view is displayed. 163 | * @param direction Set this value to an FRLayeredAnimationDirection indicating the direction that layers 164 | * will animate off the screen. This parameter is ignored if animated is NO. 165 | */ 166 | - (void)popToViewController:(UIViewController *)vc 167 | animated:(BOOL)animated 168 | direction:(FRLayeredAnimationDirection)direction; 169 | 170 | /** 171 | * Pushes a view controller onto the stack on top of anchorViewController and updates the display. 172 | * All view controllers already on top of anchorViewController get popped automatically first. 173 | * 174 | * @param viewController The UIViewController to push on the navigation stack. 175 | * @param anchorViewController The UIViewController on top of which the new view controller should get pushed. 176 | * @param maxWidth `YES` if viewController is a content view controller and should therefore use all the remaining 177 | * screen width. 178 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 179 | * controller before its view is displayed. 180 | */ 181 | - (void)pushViewController:(UIViewController *)viewController 182 | inFrontOf:(UIViewController *)anchorViewController 183 | maximumWidth:(BOOL)maxWidth 184 | animated:(BOOL)animated; 185 | 186 | /** 187 | * Pushes a view controller onto the stack on top of anchorViewController and updates the display. 188 | * All view controllers already on top of anchorViewController get popped automatically first. 189 | * 190 | * @param viewController The UIViewController to push on the navigation stack. 191 | * @param anchorViewController The UIViewController on top of which the new view controller should get pushed. 192 | * @param maxWidth `YES` if viewController is a content view controller and should therefore use all the remaining 193 | * screen width. 194 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 195 | * controller before its view is displayed. 196 | * @param configuration A block object you can use to control some parameters (such as the width) for the new view 197 | * controller. The block's only parameter is a newly created instance of FRLayeredNavigationItem . 198 | */ 199 | - (void)pushViewController:(UIViewController *)viewController 200 | inFrontOf:(UIViewController *)anchorViewController 201 | maximumWidth:(BOOL)maxWidth 202 | animated:(BOOL)animated 203 | configuration:(void (^)(FRLayeredNavigationItem *item))configuration; 204 | 205 | /** 206 | * Pushes a view controller onto the stack on top of anchorViewController and updates the display. 207 | * All view controllers already on top of anchorViewController get popped automatically first. 208 | * 209 | * @param viewController The UIViewController to push on the navigation stack. 210 | * @param anchorViewController The UIViewController on top of which the new view controller should get pushed. 211 | * @param maxWidth `YES` if viewController is a content view controller and should therefore use all the remaining 212 | * screen width. 213 | * @param animated Set this value to YES to animate the transition. Pass NO if you are setting up a layered navigation 214 | * controller before its view is displayed. 215 | * @param configuration A block object you can use to control some parameters (such as the width) for the new view 216 | * controller. The block's only parameter is a newly created instance of FRLayeredNavigationItem . 217 | * @param direction Set this value to an FRLayeredAnimationDirection indicating the direction that layer 218 | * will animate in from on the screen. This parameter is ignored if animated is NO. 219 | */ 220 | - (void)pushViewController:(UIViewController *)viewController 221 | inFrontOf:(UIViewController *)anchorViewController 222 | maximumWidth:(BOOL)maxWidth 223 | animated:(BOOL)animated 224 | configuration:(void (^)(FRLayeredNavigationItem *item))configuration 225 | direction:(FRLayeredAnimationDirection)direction; 226 | 227 | /** 228 | * Compresses all visible view controllers together, so they're all separated by the minimum distance. 229 | * 230 | * @param animated Set this value to `YES` to animate any layer movement that occurs as a result of the compacting. 231 | */ 232 | - (void)compressViewControllers:(BOOL)animated; 233 | 234 | /** 235 | * If user interaction on the layered navigation controller is enabled. 236 | */ 237 | @property (nonatomic) BOOL userInteractionEnabled; 238 | 239 | /** 240 | * Returns all the UIViewController objects being managed by the FRNavigationController. 241 | * Note that, unlike a UINavigationController, this is a readonly property. 242 | */ 243 | @property (nonatomic, readonly) NSArray *viewControllers; 244 | 245 | /** 246 | * Wheater to drop all layers except the root view controller when pulled far enough to the right 247 | */ 248 | @property (nonatomic) BOOL dropLayersWhenPulledRight; 249 | 250 | /** 251 | * The view controller in the top layer. (read-only) 252 | */ 253 | @property(nonatomic, readonly) UIViewController *topViewController; 254 | 255 | /** 256 | * The delegate for the controller. 257 | */ 258 | @property(nonatomic, weak) id delegate; 259 | 260 | @end 261 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayeredNavigationItem+Protected.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Local Imports */ 30 | #import "FRLayeredNavigationItem.h" 31 | 32 | @class FRLayerController; 33 | 34 | @interface FRLayeredNavigationItem (Protected) 35 | 36 | @property (nonatomic, readwrite, weak) FRLayerController *layerController; 37 | @property (nonatomic, readwrite) CGPoint initialViewPosition; 38 | @property (nonatomic, readwrite) CGPoint currentViewPosition; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayeredNavigationItem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | #import 31 | #import 32 | 33 | @class FRLayerController; 34 | 35 | /** 36 | * FRLayeredNavigationItem is used to configure one view controller layer. It is very similar to UINavigationItem . 37 | * 38 | */ 39 | @interface FRLayeredNavigationItem : NSObject { 40 | @private 41 | CGPoint _initialViewPosition; 42 | CGPoint _currentViewPosition; 43 | NSString *_title; 44 | UIView *_titleView; 45 | CGFloat _width; 46 | CGFloat _snappingDistance; 47 | CGFloat _nextItemDistance; 48 | BOOL _hasChrome; 49 | BOOL _hasBorder; 50 | BOOL _displayShadow; 51 | BOOL _autosizeContent; 52 | FRLayerController __weak * _layerController; 53 | } 54 | 55 | /** 56 | * The view position when the layers are compacted maximally. 57 | */ 58 | @property (nonatomic, readonly) CGPoint initialViewPosition; 59 | 60 | /** 61 | * The current view position. 62 | */ 63 | @property (nonatomic, readonly) CGPoint currentViewPosition; 64 | 65 | /** 66 | * The navigation item’s title displayed in the center of the navigation bar. 67 | */ 68 | @property (nonatomic, readwrite, strong) NSString *title; 69 | 70 | /** 71 | * A custom view displayed in the center of the navigation bar. 72 | */ 73 | @property (nonatomic, readwrite, strong) UIView *titleView; 74 | 75 | /** 76 | * The layer's width in points. 77 | */ 78 | @property (nonatomic, readwrite) CGFloat width; 79 | 80 | /** 81 | * The maximum distance (when the child layer is being pulled out) to the next layer in points. 82 | * If this value is unset, it defaults to the layer's width. 83 | */ 84 | @property (nonatomic, readwrite) CGFloat snappingDistance; 85 | 86 | /** 87 | * The minimal distance (when the child layer is as far on the left as possible) to the next layer in points. 88 | */ 89 | @property (nonatomic, readwrite) CGFloat nextItemDistance; 90 | 91 | /** 92 | * If the view controller should get decorated by some UI chrome: the navigation bar. 93 | */ 94 | @property (nonatomic, readwrite) BOOL hasChrome; 95 | 96 | /** 97 | * If the view controller should get a small border. 98 | */ 99 | @property (nonatomic, readwrite) BOOL hasBorder; 100 | 101 | /** 102 | * If the view should display a shadow 103 | */ 104 | @property (nonatomic, readwrite) BOOL displayShadow; 105 | 106 | /** 107 | * If the view should automatically size its content to the layer size 108 | */ 109 | @property (nonatomic, readwrite) BOOL autosizeContent; 110 | 111 | /** 112 | * A custom bar button item displayed on the left of the navigation bar. 113 | */ 114 | @property (nonatomic, strong) UIBarButtonItem *leftBarButtonItem; 115 | 116 | /** 117 | * A custom bar button item displayed on the right of the navigation bar. 118 | */ 119 | @property (nonatomic, strong) UIBarButtonItem *rightBarButtonItem; 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRLayeredNavigationItem.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Local Imports */ 30 | #import "FRLayeredNavigationItem+Protected.h" 31 | #import "FRLayerController+Protected.h" 32 | #import "FRLayerController.h" 33 | #import "FRLayerChromeView.h" 34 | 35 | @interface FRLayeredNavigationItem () 36 | 37 | @property (nonatomic, readwrite, weak) FRLayerController *layerController; 38 | @property (nonatomic, readwrite) CGPoint initialViewPosition; 39 | @property (nonatomic, readwrite) CGPoint currentViewPosition; 40 | 41 | @end 42 | 43 | @implementation FRLayeredNavigationItem 44 | 45 | - (id)init 46 | { 47 | if ((self = [super init])) { 48 | self->_width = -1; 49 | self->_nextItemDistance = -1; 50 | self->_snappingDistance = -1; 51 | self->_hasChrome = YES; 52 | self->_displayShadow = YES; 53 | self->_hasBorder = YES; 54 | self->_autosizeContent = YES; 55 | } 56 | 57 | return self; 58 | } 59 | 60 | - (void)setLeftBarButtonItem:(UIBarButtonItem *)leftBarButtonItem 61 | { 62 | FRLayerController *layerController = self.layerController; 63 | layerController.chromeView.leftBarButtonItem = leftBarButtonItem; 64 | } 65 | 66 | - (UIBarButtonItem *)leftBarButtonItem 67 | { 68 | FRLayerController *layerController = self.layerController; 69 | return layerController.chromeView.leftBarButtonItem; 70 | } 71 | 72 | - (void)setRightBarButtonItem:(UIBarButtonItem *)rightBarButtonItem 73 | { 74 | FRLayerController *layerController = self.layerController; 75 | layerController.chromeView.rightBarButtonItem = rightBarButtonItem; 76 | } 77 | 78 | - (UIBarButtonItem *)rightBarButtonItem 79 | { 80 | FRLayerController *layerController = self.layerController; 81 | return layerController.chromeView.rightBarButtonItem; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRNavigationBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012, Apurva Mehta 5 | * 2014-2015, Johannes Weiß 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | /* Standard Library */ 31 | #import 32 | 33 | /** 34 | * It’s a bar, typically displayed at the top of the screen, containing the view 35 | * controller's title and optionally some buttons or other views. 36 | */ 37 | @interface FRNavigationBar : NSObject 38 | 39 | /** 40 | * Returns an object which can be used to set global styles for the FRNavigationBar. 41 | */ 42 | +(FRNavigationBar *) appearance; 43 | 44 | 45 | /** 46 | * Returns an object which can be used set the style of an FRNavigationBar when embedded within other appearance 47 | * containers. 48 | * 49 | * @param ContainerClass A nil-terminated list of appearance container classes. 50 | * @param ... A nil-terminated list of appearance container classes. 51 | */ 52 | +(FRNavigationBar *) appearanceWhenContainedIn: (Class )ContainerClass,...; 53 | 54 | /** 55 | * The default background image of all FRNavigationBars in the application. If none is specified, 56 | * the default gray gradient of the iPad is used. 57 | */ 58 | @property (nonatomic, strong) UIImage *backgroundImage; 59 | 60 | 61 | /** 62 | * The default text attributes for FRNavigationBar titles. 63 | * Defaults to the etched dark gray look that is default on iPad navigation bars. 64 | */ 65 | @property (nonatomic, copy) NSDictionary *titleTextAttributes; 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRNavigationBar.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012, Apurva Mehta 5 | * 2013-2015, Johannes Weiß 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | /* Local Imports */ 31 | #import "FRNavigationBar.h" 32 | 33 | static FRNavigationBar *_appearance = nil; 34 | 35 | @implementation FRNavigationBar 36 | 37 | + (NSDictionary *)defaultTextAttributesIO6AndOlder 38 | { 39 | return @{UITextAttributeFont: [UIFont boldSystemFontOfSize:20.5], 40 | UITextAttributeTextShadowColor: [UIColor whiteColor], 41 | UITextAttributeTextColor:[UIColor colorWithRed:111.0f/255.0f 42 | green:118.0f/255.0f 43 | blue:126.0f/255.0f 44 | alpha:1.0f]}; 45 | } 46 | 47 | + (NSDictionary *)defaultTextAttributesIO7AndNewer 48 | { 49 | return @{UITextAttributeFont: [UIFont boldSystemFontOfSize:18], 50 | UITextAttributeTextColor:[UIColor blackColor]}; 51 | } 52 | 53 | + (NSDictionary *)defaultTextAttributes 54 | { 55 | return [FRNavigationBar defaultTextAttributesIO7AndNewer]; 56 | } 57 | 58 | + (FRNavigationBar *)appearance 59 | { 60 | if (!_appearance) { 61 | _appearance = [[FRNavigationBar alloc] init]; 62 | _appearance.backgroundImage = nil; 63 | 64 | _appearance.titleTextAttributes = [FRNavigationBar defaultTextAttributes]; 65 | } 66 | 67 | return _appearance; 68 | } 69 | 70 | + (FRNavigationBar *)appearanceWhenContainedIn:(__unused Class )ContainerClass,... 71 | { 72 | return [FRNavigationBar appearance]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRiOSVersion.h: -------------------------------------------------------------------------------- 1 | // 2 | // FRiOSVersion.h 3 | // FRLayeredNavigationController 4 | // 5 | // Created by Johannes Weiß on 28/09/2013. 6 | // 7 | // 8 | 9 | /* Standard Library */ 10 | #import 11 | 12 | @interface FRiOSVersion : NSObject 13 | 14 | + (BOOL)isIOS7OrNewer; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/FRiOSVersion.m: -------------------------------------------------------------------------------- 1 | // 2 | // FRiOSVersion.m 3 | // FRLayeredNavigationController 4 | // 5 | // Created by Johannes Weiß on 28/09/2013. 6 | // 7 | // 8 | 9 | /* Standard Library */ 10 | #import 11 | 12 | /* Local Imports */ 13 | #import "FRiOSVersion.h" 14 | 15 | @implementation FRiOSVersion 16 | 17 | + (BOOL)isIOS7OrNewer 18 | { 19 | NSArray *vComp = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."]; 20 | 21 | return [[vComp objectAtIndex:0] intValue] >= 7; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/UIViewController+FRLayeredNavigationController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Local Imports */ 30 | #import "FRLayeredNavigationController.h" 31 | 32 | /** 33 | * The UIViewController(FRLayeredNavigationController) category provides convenience properties 34 | * to access a view controller's FRLayeredNavigationItem and the nearest FRLayeredNavigationController. Just 35 | * as the `navigationItem` and `navigationController` properties of UIViewController. 36 | */ 37 | @interface UIViewController (FRLayeredNavigationController) 38 | 39 | /** 40 | * The nearest ancestor in the view controller hierarchy that is a FRLayeredNavigationController. 41 | */ 42 | @property (nonatomic, readonly, strong) FRLayeredNavigationController *layeredNavigationController; 43 | 44 | /** 45 | * The navigation item used to represent the view controller inside a FRLayeredNavigationController. 46 | * 47 | * @warning This property is `nil` until the view controller is shown on the screen. To configure the 48 | * FRLayeredNavigationItem before appearing on the screen use the following methods: 49 | * 50 | * - [FRLayeredNavigationController initWithRootViewController:configuration:] 51 | * - [FRLayeredNavigationController pushViewController:inFrontOf:maximumWidth:animated:configuration:] 52 | */ 53 | @property (nonatomic, readonly, strong) FRLayeredNavigationItem *layeredNavigationItem; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/UIViewController+FRLayeredNavigationController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Local Imports */ 30 | #import "FRDLog.h" 31 | #import "UIViewController+FRLayeredNavigationController.h" 32 | #import "FRLayerController.h" 33 | 34 | @implementation UIViewController (FRLayeredNavigationController) 35 | 36 | - (FRLayeredNavigationController *)layeredNavigationController 37 | { 38 | UIViewController *here = self; 39 | 40 | while (here != nil) { 41 | if([here isKindOfClass:[FRLayeredNavigationController class]]) { 42 | return (FRLayeredNavigationController *)here; 43 | } 44 | 45 | here = here.parentViewController; 46 | } 47 | 48 | FRDLOG(@"WARNING: No instance of FRLayeredNavigationController in view controller hierachy!"); 49 | FRDLOG(@"HINT: If you used [UIWindow addSubview:], change it to [UIWindow setRootViewController:]"); 50 | 51 | return nil; 52 | } 53 | 54 | - (FRLayeredNavigationItem *)layeredNavigationItem 55 | { 56 | UIViewController *here = self; 57 | 58 | while (here != nil) { 59 | if([here isKindOfClass:[FRLayerController class]]) { 60 | return ((FRLayerController *)here).layeredNavigationItem; 61 | } 62 | 63 | here = here.parentViewController; 64 | } 65 | 66 | FRDLOG(@"WARNING: No instance of FRLayerController in view controller hierachy!"); 67 | FRDLOG(@"DEBUG: self: '%@', self.parentViewController: '%@'", self, self.parentViewController); 68 | FRDLOG(@"HINT: The layeredNavigationItem property is nil until the view controller is shown on the screen."); 69 | 70 | return nil; 71 | } 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/Utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | #import 31 | #import 32 | #import 33 | 34 | BOOL CGFloatEquals(CGFloat l, CGFloat r); 35 | BOOL CGFloatNotEqual(CGFloat l, CGFloat r); 36 | 37 | @interface Utils : NSObject 38 | 39 | + (UIImage *)transparentImage; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /FRLayeredNavigationController/Utils.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* Standard Library */ 30 | #import 31 | #import 32 | 33 | /* Local Imports */ 34 | #import "Utils.h" 35 | 36 | BOOL CGFloatEquals(CGFloat l, CGFloat r) 37 | { 38 | return fabs(l-r) < 0.1; 39 | } 40 | 41 | BOOL CGFloatNotEqual(CGFloat l, CGFloat r) 42 | { 43 | return !CGFloatEquals(l, r); 44 | } 45 | 46 | @implementation Utils 47 | 48 | + (UIImage *)transparentImage 49 | { 50 | CGRect rect = CGRectMake(0, 0, 1, 1); 51 | UIGraphicsBeginImageContext(rect.size); 52 | CGContextRef context = UIGraphicsGetCurrentContext(); 53 | CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]); 54 | CGContextFillRect(context, rect); 55 | UIImage *transparentImage = UIGraphicsGetImageFromCurrentImageContext(); 56 | UIGraphicsEndImageContext(); 57 | return transparentImage; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #import 30 | #import "FRLayeredNavigation.h" 31 | 32 | @interface AppDelegate : UIResponder 33 | 34 | @property (strong, nonatomic) UIWindow *window; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #import "AppDelegate.h" 30 | 31 | #import "MainViewController.h" 32 | 33 | #import "SampleListViewController.h" 34 | 35 | //Wheather to demo size changes or not... 36 | //#define DEMO_SIZE_CHANGES 37 | 38 | @implementation AppDelegate 39 | 40 | - (BOOL)application:(__unused UIApplication *)application 41 | didFinishLaunchingWithOptions:(__unused NSDictionary *)launchOptions 42 | { 43 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 44 | // Override point for customization after application launch. 45 | self.window.backgroundColor = [UIColor whiteColor]; 46 | 47 | #ifdef DEMO_SIZE_CHANGES 48 | MainViewController *vc = [[MainViewController alloc] init]; 49 | self.window.rootViewController = vc; 50 | #else 51 | UIViewController *vc = [[SampleListViewController alloc] init]; 52 | FRLayeredNavigationController *fvc = [[FRLayeredNavigationController alloc] 53 | initWithRootViewController:vc 54 | configuration:^(FRLayeredNavigationItem *item) { 55 | item.width = 200; //600; 56 | item.nextItemDistance = 64; //2; 57 | }]; 58 | self.window.rootViewController = fvc; 59 | self.window.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; 60 | #endif 61 | [self.window makeKeyAndVisible]; 62 | 63 | return YES; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/FRLayeredNavigationControllerDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 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~ipad 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationPortraitUpsideDown 35 | UIInterfaceOrientationLandscapeLeft 36 | UIInterfaceOrientationLandscapeRight 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/FRLayeredNavigationControllerDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'FRLayeredNavigationControllerDemo' target in the 'FRLayeredNavigationControllerDemo' 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 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // FRLayeredNavigationController 4 | // 5 | // Created by Stefan Wehr on 16.08.12. 6 | // 7 | // 8 | 9 | #import 10 | #import "FRLayeredNavigation.h" 11 | 12 | @interface MainViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.m 3 | // FRLayeredNavigationController 4 | // 5 | // Created by Stefan Wehr on 16.08.12. 6 | // 7 | // 8 | 9 | #import "MainViewController.h" 10 | #import "SampleListViewController.h" 11 | #import "FRLayeredNavigationController.h" 12 | #import "FRLayeredNavigationItem.h" 13 | 14 | @interface MainViewController () 15 | @property (nonatomic, strong) FRLayeredNavigationController *rootViewController; 16 | @property (nonatomic, strong) UILabel *widthLabel; 17 | @end 18 | 19 | @implementation MainViewController 20 | 21 | - (void)buttonClicked { 22 | UIView *v = self.rootViewController.view; 23 | CGFloat newWidth = (v.frame.size.width > 800) ? 700 : 900; 24 | [UIView animateWithDuration:1.0 delay:0.0 options: UIViewAnimationOptionLayoutSubviews animations:^{ 25 | self.widthLabel.text = [NSString stringWithFormat:@"Width: %.0f", newWidth]; 26 | CGRect frame = CGRectMake(v.frame.origin.x, v.frame.origin.y, newWidth, v.frame.size.height); 27 | v.frame = frame; 28 | } completion:^(__unused BOOL finished) { 29 | // do nothing 30 | }]; 31 | } 32 | 33 | - (id)init { 34 | if ((self = [super init])) { 35 | UIViewController *vc = [[SampleListViewController alloc] init]; 36 | FRLayeredNavigationController *fvc = [[FRLayeredNavigationController alloc] 37 | initWithRootViewController:vc 38 | configuration:^(FRLayeredNavigationItem *item) { 39 | item.width = 200; //600; 40 | item.nextItemDistance = 64; //2; 41 | }]; 42 | fvc.delegate = self; 43 | self.rootViewController = fvc; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)loadView { 49 | UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024-44)]; 50 | UIView *lv = self.rootViewController.view; 51 | lv.clipsToBounds = YES; 52 | lv.frame = CGRectMake(20, 100, 900, 600); 53 | [v addSubview:lv]; 54 | lv.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; 55 | v.backgroundColor = [UIColor orangeColor]; 56 | UIButton *b = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 57 | [b setTitle:@"Change Size" forState:UIControlStateNormal]; 58 | b.frame = CGRectMake(20, 20, 130, 40); 59 | [b addTarget:self action:@selector(buttonClicked) forControlEvents: UIControlEventTouchUpInside]; 60 | [v addSubview:b]; 61 | UILabel *l = [[UILabel alloc] initWithFrame:CGRectMake(170, 20, 130, 40)]; 62 | l.text = @"Width: 900"; 63 | self.widthLabel = l; 64 | [v addSubview:l]; 65 | self.view = v; 66 | } 67 | 68 | - (void)viewDidLoad 69 | { 70 | [super viewDidLoad]; 71 | // Do any additional setup after loading the view. 72 | } 73 | 74 | - (void)viewDidUnload 75 | { 76 | [super viewDidUnload]; 77 | // Release any retained subviews of the main view. 78 | } 79 | 80 | - (BOOL)shouldAutorotateToInterfaceOrientation:(__unused UIInterfaceOrientation)interfaceOrientation 81 | { 82 | return YES; 83 | } 84 | 85 | // Layered controller delegate 86 | - (void)layeredNavigationController:(__unused FRLayeredNavigationController *)layeredController 87 | didMoveController:(UIViewController *)controller 88 | { 89 | NSLog(@"Finished moving controller %@", controller); 90 | } 91 | 92 | - (void)layeredNavigationController:(__unused FRLayeredNavigationController *)layeredController 93 | movingViewController:(UIViewController *)controller 94 | { 95 | NSLog(@"Moving controller %@", controller); 96 | } 97 | 98 | -(void)layeredNavigationController:(__unused FRLayeredNavigationController *)layeredController 99 | willMoveController:(UIViewController *)controller 100 | { 101 | NSLog(@"Going to start moving the view controller %@", controller); 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/SampleContentViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #import 30 | 31 | @interface SampleContentViewController : UIViewController 32 | 33 | - (void)indexDidChangeForSegmentedControl:(UISegmentedControl *)sc; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/SampleContentViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #import "SampleContentViewController.h" 30 | 31 | #import "FRLayeredNavigation.h" 32 | 33 | @interface SampleContentViewController () 34 | 35 | @property (nonatomic, readwrite, strong) UIImageView *imageView; 36 | @property (nonatomic, readwrite, strong) UIScrollView *scrollView; 37 | 38 | @end 39 | 40 | @implementation SampleContentViewController 41 | 42 | - (void)hooray 43 | { 44 | NSLog(@"hooray"); 45 | } 46 | 47 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 48 | { 49 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 50 | if (self) { 51 | } 52 | return self; 53 | } 54 | 55 | -(UIView *) viewForZoomingInScrollView:(__unused UIScrollView *)inScroll { 56 | return self.imageView; 57 | } 58 | 59 | - (void)loadView 60 | { 61 | self.view = [[UIView alloc] init]; 62 | 63 | NSBundle *bundle = [NSBundle mainBundle]; 64 | NSString *path = [bundle pathForResource:@"mandel" ofType:@"jpg"]; 65 | UIImage *img = [UIImage imageWithContentsOfFile:path]; 66 | self.imageView = [[UIImageView alloc] initWithImage:img]; 67 | 68 | self.scrollView = [[UIScrollView alloc] init]; 69 | self.scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 70 | self.scrollView.maximumZoomScale = 10; 71 | self.scrollView.minimumZoomScale = 1; 72 | self.scrollView.backgroundColor = [UIColor blueColor]; 73 | self.scrollView.clipsToBounds = YES; 74 | self.scrollView.delegate = self; 75 | [self.scrollView addSubview:self.imageView]; 76 | self.scrollView.zoomScale = .37f; 77 | 78 | [self.view addSubview:self.scrollView]; 79 | 80 | UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(10, 10, 400, 40)]; 81 | [self.view addSubview:slider]; 82 | } 83 | 84 | - (void)viewWillLayoutSubviews { 85 | _scrollView.contentSize = CGSizeMake(self.view.bounds.size.width, self.view.bounds.size.height); 86 | } 87 | 88 | - (void)viewWillAppear:(BOOL)animated 89 | { 90 | self.layeredNavigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] 91 | initWithImage:[UIImage imageNamed:@"back.png"] 92 | style:UIBarButtonItemStylePlain 93 | target:self 94 | action:@selector(hooray)]; 95 | self.layeredNavigationItem.leftBarButtonItem.style = UIBarButtonItemStyleBordered; 96 | self.layeredNavigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] 97 | initWithImage:[UIImage imageNamed:@"back.png"] 98 | style:UIBarButtonItemStylePlain 99 | target:self 100 | action:@selector(hooray)]; 101 | self.layeredNavigationItem.rightBarButtonItem.style = UIBarButtonItemStyleBordered; 102 | 103 | [super viewWillAppear:animated]; 104 | } 105 | 106 | - (void)didMoveToParentViewController:(UIViewController *)parent { 107 | if (parent == nil) { 108 | self.scrollView.delegate = nil; 109 | } 110 | } 111 | 112 | - (void)viewDidLoad 113 | { 114 | [super viewDidLoad]; 115 | // Do any additional setup after loading the view. 116 | } 117 | 118 | - (void)viewDidUnload 119 | { 120 | [super viewDidUnload]; 121 | 122 | self.scrollView.delegate = nil; 123 | self.scrollView = nil; 124 | self.imageView = nil; 125 | } 126 | 127 | - (BOOL)shouldAutorotateToInterfaceOrientation:(__unused UIInterfaceOrientation)interfaceOrientation 128 | { 129 | return YES; 130 | } 131 | 132 | - (void)indexDidChangeForSegmentedControl:(__unused UISegmentedControl *)sc 133 | { 134 | NSLog(@"SC changed"); 135 | } 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/SampleListViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #import 30 | 31 | @interface SampleListViewController : UITableViewController 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/SampleListViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FRLayeredNavigationController. 3 | * 4 | * Copyright (c) 2012-2015, Johannes Weiß 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #import 30 | 31 | #import "SampleContentViewController.h" 32 | #import "SampleListViewController.h" 33 | 34 | #import "FRLayeredNavigation.h" 35 | 36 | @interface SampleListViewController () 37 | 38 | @end 39 | 40 | @implementation SampleListViewController 41 | 42 | - (id)initWithStyle:(UITableViewStyle)style 43 | { 44 | self = [super initWithStyle:style]; 45 | if (self) { 46 | self.title = @"demo"; 47 | } 48 | return self; 49 | } 50 | 51 | - (void)viewDidLoad 52 | { 53 | [super viewDidLoad]; 54 | 55 | // Uncomment the following line to preserve selection between presentations. 56 | // self.clearsSelectionOnViewWillAppear = NO; 57 | 58 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 59 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 60 | } 61 | 62 | - (void)viewDidUnload 63 | { 64 | [super viewDidUnload]; 65 | // Release any retained subviews of the main view. 66 | // e.g. self.myOutlet = nil; 67 | } 68 | 69 | - (void)hooray 70 | { 71 | NSLog(@"hooray"); 72 | } 73 | 74 | - (void)viewWillAppear:(BOOL)animated 75 | { 76 | self.layeredNavigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] 77 | initWithImage:[UIImage imageNamed:@"back.png"] 78 | style:UIBarButtonItemStylePlain 79 | target:self 80 | action:@selector(hooray)]; 81 | self.layeredNavigationItem.leftBarButtonItem.style = UIBarButtonItemStyleBordered; 82 | self.layeredNavigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] 83 | initWithImage:[UIImage imageNamed:@"back.png"] 84 | style:UIBarButtonItemStylePlain 85 | target:self 86 | action:@selector(hooray)]; 87 | self.layeredNavigationItem.rightBarButtonItem.style = UIBarButtonItemStyleBordered; 88 | 89 | [super viewWillAppear:animated]; 90 | } 91 | 92 | - (BOOL)shouldAutorotateToInterfaceOrientation:(__unused UIInterfaceOrientation)interfaceOrientation 93 | { 94 | return YES; 95 | } 96 | 97 | #pragma mark - Table view data source 98 | 99 | - (NSString *)cellText:(NSInteger)n { 100 | if (n < 0) { 101 | return @"iOS stinkt"; 102 | } else if (n == 0) { 103 | return @"content (ANIMATION)"; 104 | } else if (n == 1) { 105 | return @"content chromeless (NO ANIMATION)"; 106 | } else if (n == 2) { 107 | return @"pop to root vc (ANIMATION)"; 108 | } else if (n == 3) { 109 | return @"pop to root vc (NO ANIMATION)"; 110 | } else if (n == 4) { 111 | return @"pop VC (ANIMATION)"; 112 | } else if (n == 5) { 113 | return @"pop VC (NO ANIMATION)"; 114 | } else if (n == 6) { 115 | return @"low mem testing: push on UINavigationController"; 116 | } else if (n == 7) { 117 | return @"foo"; 118 | } else if (n == 8) { 119 | return @"bar"; 120 | } else if (n == 9) { 121 | return @"buz"; 122 | } else { 123 | NSAssert(n >= 0, @"n negative"); 124 | NSMutableString *s = [[NSMutableString alloc] initWithCapacity:(NSUInteger)n]; 125 | [s appendString:@"q"]; 126 | for (int i=7; i 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #import 30 | 31 | #import "AppDelegate.h" 32 | 33 | int main(int argc, char *argv[]) 34 | { 35 | @autoreleasepool { 36 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /FRLayeredNavigationControllerDemo/mandel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/FRLayeredNavigationControllerDemo/mandel.jpg -------------------------------------------------------------------------------- /FRLayeredNavigationControllerRotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/FRLayeredNavigationControllerRotation.png -------------------------------------------------------------------------------- /FRLayeredNavigationControllerScreenshot-iOS7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/FRLayeredNavigationControllerScreenshot-iOS7.png -------------------------------------------------------------------------------- /FRLayeredNavigationControllerScreenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/FRLayeredNavigationControllerScreenshot1.png -------------------------------------------------------------------------------- /FRLayeredNavigationControllerScreenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/FRLayeredNavigationControllerScreenshot2.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2015, Johannes Weiß 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 3. The name of the author may not be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FRLayeredNavigationController 2 | ============================= 3 | 4 | FRLayeredNavigationController, an iOS container view controller with an API 5 | similar to UINavigationController. Influenced by the UI of the Twitter and 6 | Soundcloud iPad apps, the user will think of a stack of paper and has similar 7 | interaction options. 8 | 9 | Official Project Home: https://github.com/weissi/FRLayeredNavigationController . You can also find [FRLayeredNavigationController at 10 | Ohloh](https://www.ohloh.net/p/frlayerednavigationcontroller). 11 | 12 | See below for documentation and instructions (including a screencast) on how 13 | to add FRLayeredNavigationController to your project. 14 | 15 | If you have further questions, feel free to [mail me](mailto:weiss@tux4u.de)! 16 | 17 | [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=JohannesWeiss&url=https://github.com/weissi/FRLayeredNavigationController&title=FRLayeredNavigationController&language=&tags=github&category=software) 18 | 19 | ©2012-2015, [Johannes Weiß](mailto:weiss@tux4u.de) for 20 | [factis research GmbH](http://www.factisresearch.com). 21 | 22 | 23 | Documentation 24 | ============= 25 | 26 | - [The API Documentation](http://weissi.github.io/FRLayeredNavigationController/docs/html/index.html) 27 | - [Blog Post](http://factisresearch.blogspot.de/2012/06/uis-for-hierachical-ipad-apps.html) 28 | - [EuroCopa Demo Project](https://github.com/weissi/EuroCopaInfo) 29 | 30 | 31 | Features 32 | ======== 33 | 34 | - The [API](http://weissi.github.io/FRLayeredNavigationController/docs/html/index.html) 35 | feels very natural to iOS developers since it's very similar to the API of 36 | `UINavigationController` 37 | - FRLayeredNavigationController uses ARC (automatic reference counting) but you 38 | can use it in your legacy projects without ARC, too 39 | - Low memory conditions and rotation are handled correctly with 40 | FRLayeredNavigationController 41 | - FRLayeredNavigationController works on the iPad, the iPhone and iPod touch 42 | but the UI concept is best on the iPad since the big screen 43 | - You can easily install FRLayeredNavigationController using 44 | [CocoaPods](http://cocoapods.org/) or manually (screencast and instructions 45 | below) 46 | - Correctly handles `view.frame` and `view.bounds` and has therefore no 47 | problems with `view.transform` (such as rotations) as you can see on this 48 | [screenshot](https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerRotation.png). 49 | - *App Store* compatible (uses only Public API and was already approved by 50 | Apple) 51 | - iOS 7 & 8 Support (still supports iOS6 and older with old visuals) 52 | 53 | 54 | License 55 | ======= 56 | It's all open source but you can use it in your commercial product free of 57 | charge. FRLayeredNavigationController is licensed under the terms of the 58 | Modified BSD License. 59 | 60 | 61 | Demo Videos 62 | =========== 63 | - http://youtu.be/v_tXD_mL05E 64 | - http://youtu.be/q66HX2td_uc 65 | 66 | 67 | Screenshots 68 | =========== 69 | [![](https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot-iOS7.png)](https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot-iOS7.png) 70 | [![](https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot1.png)](https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot1.png) 71 | [![](https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot2.png)](https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot2.png) 72 | 73 | 74 | Known Users 75 | =========== 76 | 77 | ###[RecordBox](http://myrecordbox.com) ([App Store](http://itunes.apple.com/us/app/recordbox/id480534869?mt=8))### 78 | [![](http://a4.mzstatic.com/us/r1000/093/Purple/v4/50/61/93/50619376-7243-bf68-2192-d11bc8687106/mza_4403044630314584279.175x175-75.jpg)](http://myrecordbox.com) 79 | 80 | ###[Checkpad MED](http://www.lohmann-birkner.de/en/Checkpad-MED/index.php)### 81 | [![](http://www.lohmann-birkner.de/de-wGlobal/wGlobal/layout/images/headlogos/lub_hcc.gif)](http://www.lohmann-birkner.de/en/Checkpad-MED/index.php) 82 | 83 | ###[Wunderlist](http://www.6wunderkinder.com/wunderlist) ([App Store](https://itunes.apple.com/gb/app/wunderlist/id406644151?mt=8))### 84 | [![](http://a3.mzstatic.com/us/r1000/074/Purple/v4/e9/90/93/e99093fd-6f74-c579-6626-ccb83c0b9554/mzl.oppuszqm.175x175-75.jpg)](http://www.6wunderkinder.com/wunderlist) 85 | 86 | 87 | Adding FRLayeredNavigationController to your project 88 | ==================================================== 89 | 90 | FRLayeredNavigationController is compiled as static libraries. It use Xcode's 91 | "dependent project" facilities. If you're familiar with 92 | [CocoaPods](http://cocoapods.org/) use that, just add the `dependency 93 | 'FRLayeredNavigationController'` to your `Podfile`. 94 | 95 | Here is how: **Estimated time:** 5 minutes. 96 | 97 | There's also a screencast which shows how to add 98 | FRLayeredNavigationController to a project and how to switch from 99 | UINavigationController to FRLayeredNavigationController: 100 | http://youtu.be/k9bFAYtoenw . 101 | 102 | 1. Clone the FRLayeredNavigationController git repository: `git clone 103 | git@github.com:weissi/FRLayeredNavigationController.git`. Make sure you 104 | store the repository in a permanent place because Xcode will need to reference 105 | the files every time you compile your project. 106 | 107 | 2. Locate the "FRLayeredNavigationController.xcodeproj" file under 108 | "`FRLayeredNavigationController`". Drag 109 | FRLayeredNavigationController.xcodeproj and drop it onto the root of your Xcode 110 | project's "Groups and Files" sidebar. 111 | 112 | 3. Now you need to link the FRLayeredNavigationController static libraries to 113 | your project. Add `libFRLayeredNavigationController.a` to the `Link Binary 114 | With Libraries` section of your project's Build phases. 115 | 116 | 4. Finally, we need to tell your project where to find the 117 | FRLayeredNavigationController headers. Open your "Project Settings" and go 118 | to the "Build" tab. Look for "Header Search Paths" and double-click it. Add the 119 | relative path from your project's directory to the 120 | "FRLayeredNavigationController/" directory. 121 | 122 | 5. While you are in Project Settings, go to "Other Linker Flags" under the 123 | "Linker" section, and add "`-ObjC`", "`-fobjc-arc`" and "`-all_load`" to the 124 | list of flags. 125 | 126 | 6. You're ready to go. 127 | Just `#import "FRLayeredNavigationController/FRLayeredNavigation.h"` 128 | anywhere you want to use FRLayeredNavigationController in your project. 129 | 130 | If you want to, you can install [appledoc](http://gentlebytes.com/appledoc/) 131 | and type `appledoc .` in FRLayeredNavigationController's root directory to 132 | install the API documentation in Xcode. 133 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | v0.4.4, 2013-03-01 2 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | docset-installed.txt 2 | -------------------------------------------------------------------------------- /docs/html/Categories/UIViewController+FRLayeredNavigationController.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIViewController(FRLayeredNavigationController) Category Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 18 | 19 | 22 | 56 |
57 | 88 |
89 |
90 | 91 | 97 | 102 |
103 | 104 |
105 | 106 | 107 | 108 | 109 |
Declared inUIViewController+FRLayeredNavigationController.h
UIViewController+FRLayeredNavigationController.m
110 | 111 | 112 | 113 | 114 |
115 | 116 |

Overview

117 |

The UIViewController(FRLayeredNavigationController) category provides convenience properties 118 | to access a view controller’s FRLayeredNavigationItem and the nearest FRLayeredNavigationController. Just 119 | as the navigationItem and navigationController properties of UIViewController.

120 |
121 | 122 | 123 | 124 | 125 | 126 |
127 | 128 |

Tasks

129 | 130 | 131 | 132 | 133 | 134 | 151 | 152 |
153 | 154 | 155 | 156 | 157 | 158 |
159 | 160 |

Properties

161 | 162 |
163 | 164 |

layeredNavigationController

165 | 166 | 167 | 168 |
169 |

The nearest ancestor in the view controller hierarchy that is a FRLayeredNavigationController.

170 |
171 | 172 | 173 | 174 |
@property (nonatomic, readonly, strong) FRLayeredNavigationController *layeredNavigationController
175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 |
185 |

Discussion

186 |

The nearest ancestor in the view controller hierarchy that is a FRLayeredNavigationController.

187 |
188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 |
196 |

Declared In

197 | UIViewController+FRLayeredNavigationController.h
198 |
199 | 200 | 201 |
202 | 203 |
204 | 205 |

layeredNavigationItem

206 | 207 | 208 | 209 |
210 |

The navigation item used to represent the view controller inside a FRLayeredNavigationController.

211 |
212 | 213 | 214 | 215 |
@property (nonatomic, readonly, strong) FRLayeredNavigationItem *layeredNavigationItem
216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 |
226 |

Discussion

227 |

The navigation item used to represent the view controller inside a FRLayeredNavigationController.

Warning: This property is nil until the view controller is shown on the screen. To configure the 228 | FRLayeredNavigationItem before appearing on the screen use the following methods:

229 | 230 | 234 |
235 |
236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 |
244 |

Declared In

245 | UIViewController+FRLayeredNavigationController.h
246 |
247 | 248 | 249 |
250 | 251 |
252 | 253 | 254 | 255 | 256 | 257 | 258 |
259 | 265 | 274 |
275 |
276 | 367 | 368 | -------------------------------------------------------------------------------- /docs/html/Classes/FRLayeredNavigationItem.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FRLayeredNavigationItem Class Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 18 | 19 | 22 | 78 |
79 | 132 |
133 |
134 | 135 | 141 | 146 |
147 | 148 |
149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 |
Inherits fromNSObject
Declared inFRLayeredNavigationItem.h
FRLayeredNavigationItem.m
157 | 158 | 159 | 160 | 161 |
162 | 163 |

Overview

164 |

FRLayeredNavigationItem is used to configure one view controller layer. It is very similar to UINavigationItem .

165 |
166 | 167 | 168 | 169 | 170 | 171 |
172 | 173 |

Tasks

174 | 175 | 176 | 177 | 178 | 179 |
    180 |
  • 181 | 182 |   initialViewPosition 183 |

    The view position when the layers are compacted maximally.

    184 |
    185 | property 186 | 187 |
  • 188 | 189 |   currentViewPosition 190 |

    The current view position.

    191 |
    192 | property 193 | 194 |
  • 195 | 196 |   title 197 |

    The navigation item’s title displayed in the center of the navigation bar.

    198 |
    199 | property 200 | 201 |
  • 202 | 203 |   titleView 204 |

    A custom view displayed in the center of the navigation bar.

    205 |
    206 | property 207 | 208 |
  • 209 | 210 |   width 211 |

    The layer’s width in points.

    212 |
    213 | property 214 | 215 |
  • 216 | 217 |   snappingDistance 218 |

    The maximum distance (when the child layer is being pulled out) to the next layer in points. 219 | If this value is unset, it defaults to the layer’s width.

    220 |
    221 | property 222 | 223 |
  • 224 | 225 |   nextItemDistance 226 |

    The minimal distance (when the child layer is as far on the left as possible) to the next layer in points.

    227 |
    228 | property 229 | 230 |
  • 231 | 232 |   hasChrome 233 |

    If the view controller should get decorated by some UI chrome: the navigation bar.

    234 |
    235 | property 236 | 237 |
  • 238 | 239 |   hasBorder 240 |

    If the view controller should get a small border.

    241 |
    242 | property 243 | 244 |
  • 245 | 246 |   displayShadow 247 |

    If the view should display a shadow

    248 |
    249 | property 250 | 251 |
  • 252 | 253 |   autosizeContent 254 |

    If the view should automatically size its content to the layer size

    255 |
    256 | property 257 | 258 |
  • 259 | 260 |   leftBarButtonItem 261 |

    A custom bar button item displayed on the left of the navigation bar.

    262 |
    263 | property 264 | 265 |
  • 266 | 267 |   rightBarButtonItem 268 |

    A custom bar button item displayed on the right of the navigation bar.

    269 |
    270 | property 271 | 272 |
  • 273 |
274 | 275 |
276 | 277 | 278 | 279 | 280 | 281 |
282 | 283 |

Properties

284 | 285 |
286 | 287 |

autosizeContent

288 | 289 | 290 | 291 |
292 |

If the view should automatically size its content to the layer size

293 |
294 | 295 | 296 | 297 |
@property (nonatomic, readwrite) BOOL autosizeContent
298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 |
308 |

Discussion

309 |

If the view should automatically size its content to the layer size

310 |
311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 |
319 |

Declared In

320 | FRLayeredNavigationItem.h
321 |
322 | 323 | 324 |
325 | 326 |
327 | 328 |

currentViewPosition

329 | 330 | 331 | 332 |
333 |

The current view position.

334 |
335 | 336 | 337 | 338 |
@property (nonatomic, readonly) CGPoint currentViewPosition
339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 |
349 |

Discussion

350 |

The current view position.

351 |
352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 |
360 |

Declared In

361 | FRLayeredNavigationItem.h
362 |
363 | 364 | 365 |
366 | 367 |
368 | 369 |

displayShadow

370 | 371 | 372 | 373 |
374 |

If the view should display a shadow

375 |
376 | 377 | 378 | 379 |
@property (nonatomic, readwrite) BOOL displayShadow
380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 |
390 |

Discussion

391 |

If the view should display a shadow

392 |
393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 |
401 |

Declared In

402 | FRLayeredNavigationItem.h
403 |
404 | 405 | 406 |
407 | 408 |
409 | 410 |

hasBorder

411 | 412 | 413 | 414 |
415 |

If the view controller should get a small border.

416 |
417 | 418 | 419 | 420 |
@property (nonatomic, readwrite) BOOL hasBorder
421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 |
431 |

Discussion

432 |

If the view controller should get a small border.

433 |
434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 |
442 |

Declared In

443 | FRLayeredNavigationItem.h
444 |
445 | 446 | 447 |
448 | 449 |
450 | 451 |

hasChrome

452 | 453 | 454 | 455 |
456 |

If the view controller should get decorated by some UI chrome: the navigation bar.

457 |
458 | 459 | 460 | 461 |
@property (nonatomic, readwrite) BOOL hasChrome
462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 |
472 |

Discussion

473 |

If the view controller should get decorated by some UI chrome: the navigation bar.

474 |
475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 |
483 |

Declared In

484 | FRLayeredNavigationItem.h
485 |
486 | 487 | 488 |
489 | 490 |
491 | 492 |

initialViewPosition

493 | 494 | 495 | 496 |
497 |

The view position when the layers are compacted maximally.

498 |
499 | 500 | 501 | 502 |
@property (nonatomic, readonly) CGPoint initialViewPosition
503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 |
513 |

Discussion

514 |

The view position when the layers are compacted maximally.

515 |
516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 |
524 |

Declared In

525 | FRLayeredNavigationItem.h
526 |
527 | 528 | 529 |
530 | 531 |
532 | 533 |

leftBarButtonItem

534 | 535 | 536 | 537 |
538 |

A custom bar button item displayed on the left of the navigation bar.

539 |
540 | 541 | 542 | 543 |
@property (nonatomic, strong) UIBarButtonItem *leftBarButtonItem
544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 |
554 |

Discussion

555 |

A custom bar button item displayed on the left of the navigation bar.

556 |
557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 |
565 |

Declared In

566 | FRLayeredNavigationItem.h
567 |
568 | 569 | 570 |
571 | 572 |
573 | 574 |

nextItemDistance

575 | 576 | 577 | 578 |
579 |

The minimal distance (when the child layer is as far on the left as possible) to the next layer in points.

580 |
581 | 582 | 583 | 584 |
@property (nonatomic, readwrite) CGFloat nextItemDistance
585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 |
595 |

Discussion

596 |

The minimal distance (when the child layer is as far on the left as possible) to the next layer in points.

597 |
598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 |
606 |

Declared In

607 | FRLayeredNavigationItem.h
608 |
609 | 610 | 611 |
612 | 613 |
614 | 615 |

rightBarButtonItem

616 | 617 | 618 | 619 |
620 |

A custom bar button item displayed on the right of the navigation bar.

621 |
622 | 623 | 624 | 625 |
@property (nonatomic, strong) UIBarButtonItem *rightBarButtonItem
626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 |
636 |

Discussion

637 |

A custom bar button item displayed on the right of the navigation bar.

638 |
639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 |
647 |

Declared In

648 | FRLayeredNavigationItem.h
649 |
650 | 651 | 652 |
653 | 654 |
655 | 656 |

snappingDistance

657 | 658 | 659 | 660 |
661 |

The maximum distance (when the child layer is being pulled out) to the next layer in points. 662 | If this value is unset, it defaults to the layer’s width.

663 |
664 | 665 | 666 | 667 |
@property (nonatomic, readwrite) CGFloat snappingDistance
668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 |
678 |

Discussion

679 |

The maximum distance (when the child layer is being pulled out) to the next layer in points. 680 | If this value is unset, it defaults to the layer’s width.

681 |
682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 |
690 |

Declared In

691 | FRLayeredNavigationItem.h
692 |
693 | 694 | 695 |
696 | 697 |
698 | 699 |

title

700 | 701 | 702 | 703 |
704 |

The navigation item’s title displayed in the center of the navigation bar.

705 |
706 | 707 | 708 | 709 |
@property (nonatomic, readwrite, strong) NSString *title
710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 |
720 |

Discussion

721 |

The navigation item’s title displayed in the center of the navigation bar.

722 |
723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 |
731 |

Declared In

732 | FRLayeredNavigationItem.h
733 |
734 | 735 | 736 |
737 | 738 |
739 | 740 |

titleView

741 | 742 | 743 | 744 |
745 |

A custom view displayed in the center of the navigation bar.

746 |
747 | 748 | 749 | 750 |
@property (nonatomic, readwrite, strong) UIView *titleView
751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 |
761 |

Discussion

762 |

A custom view displayed in the center of the navigation bar.

763 |
764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 |
772 |

Declared In

773 | FRLayeredNavigationItem.h
774 |
775 | 776 | 777 |
778 | 779 |
780 | 781 |

width

782 | 783 | 784 | 785 |
786 |

The layer’s width in points.

787 |
788 | 789 | 790 | 791 |
@property (nonatomic, readwrite) CGFloat width
792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 |
802 |

Discussion

803 |

The layer’s width in points.

804 |
805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 |
813 |

Declared In

814 | FRLayeredNavigationItem.h
815 |
816 | 817 | 818 |
819 | 820 |
821 | 822 | 823 | 824 | 825 | 826 | 827 |
828 | 834 | 843 |
844 |
845 | 936 | 937 | -------------------------------------------------------------------------------- /docs/html/Classes/FRNavigationBar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FRNavigationBar Class Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 18 | 19 | 22 | 63 |
64 | 103 |
104 |
105 | 106 | 112 | 117 |
118 | 119 |
120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
Inherits fromNSObject
Conforms toUIAppearance
Declared inFRNavigationBar.h
FRNavigationBar.m
131 | 132 | 133 | 134 | 135 |
136 | 137 |

Overview

138 |

It’s a bar, typically displayed at the top of the screen, containing the view 139 | controller’s title and optionally some buttons or other views.

140 |
141 | 142 | 143 | 144 | 145 | 146 |
147 | 148 |

Tasks

149 | 150 | 151 | 152 | 153 | 154 |
    155 |
  • 156 | 157 | + appearance 158 |

    Returns an object which can be used to set global styles for the FRNavigationBar.

    159 |
    160 | 161 | 162 |
  • 163 | 164 | + appearanceWhenContainedIn: 165 |

    Returns an object which can be used set the style of an FRNavigationBar when embedded within other appearance 166 | containers.

    167 |
    168 | 169 | 170 |
  • 171 | 172 |   backgroundImage 173 |

    The default background image of all FRNavigationBars in the application. If none is specified, 174 | the default gray gradient of the iPad is used.

    175 |
    176 | property 177 | 178 |
  • 179 | 180 |   titleTextAttributes 181 |

    The default text attributes for FRNavigationBar titles. 182 | Defaults to the etched dark gray look that is default on iPad navigation bars.

    183 |
    184 | property 185 | 186 |
  • 187 |
188 | 189 |
190 | 191 | 192 | 193 | 194 | 195 |
196 | 197 |

Properties

198 | 199 |
200 | 201 |

backgroundImage

202 | 203 | 204 | 205 |
206 |

The default background image of all FRNavigationBars in the application. If none is specified, 207 | the default gray gradient of the iPad is used.

208 |
209 | 210 | 211 | 212 |
@property (nonatomic, strong) UIImage *backgroundImage
213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 |
223 |

Discussion

224 |

The default background image of all FRNavigationBars in the application. If none is specified, 225 | the default gray gradient of the iPad is used.

226 |
227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 |
235 |

Declared In

236 | FRNavigationBar.h
237 |
238 | 239 | 240 |
241 | 242 |
243 | 244 |

titleTextAttributes

245 | 246 | 247 | 248 |
249 |

The default text attributes for FRNavigationBar titles. 250 | Defaults to the etched dark gray look that is default on iPad navigation bars.

251 |
252 | 253 | 254 | 255 |
@property (nonatomic, copy) NSDictionary *titleTextAttributes
256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 |
266 |

Discussion

267 |

The default text attributes for FRNavigationBar titles. 268 | Defaults to the etched dark gray look that is default on iPad navigation bars.

269 |
270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 |
278 |

Declared In

279 | FRNavigationBar.h
280 |
281 | 282 | 283 |
284 | 285 |
286 | 287 | 288 | 289 |
290 | 291 |

Class Methods

292 | 293 |
294 | 295 |

appearance

296 | 297 | 298 | 299 |
300 |

Returns an object which can be used to set global styles for the FRNavigationBar.

301 |
302 | 303 | 304 | 305 |
+ (FRNavigationBar *)appearance
306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 |
316 |

Discussion

317 |

Returns an object which can be used to set global styles for the FRNavigationBar.

318 |
319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 |
327 |

Declared In

328 | FRNavigationBar.h
329 |
330 | 331 | 332 |
333 | 334 |
335 | 336 |

appearanceWhenContainedIn:

337 | 338 | 339 | 340 |
341 |

Returns an object which can be used set the style of an FRNavigationBar when embedded within other appearance 342 | containers.

343 |
344 | 345 | 346 | 347 |
+ (FRNavigationBar *)appearanceWhenContainedIn:(Class<UIAppearanceContainer>)ContainerClass, ...
348 | 349 | 350 | 351 |
352 |

Parameters

353 | 354 |
355 |
ContainerClass
356 |

A nil-terminated list of appearance container classes.

357 |
358 | 359 |
360 |
...
361 |

A nil-terminated list of appearance container classes.

362 |
363 | 364 |
365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 |
373 |

Discussion

374 |

Returns an object which can be used set the style of an FRNavigationBar when embedded within other appearance 375 | containers.

376 |
377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 |
385 |

Declared In

386 | FRNavigationBar.h
387 |
388 | 389 | 390 |
391 | 392 |
393 | 394 | 395 | 396 | 397 |
398 | 404 | 413 |
414 |
415 | 506 | 507 | -------------------------------------------------------------------------------- /docs/html/Protocols/FRLayeredNavigationControllerDelegate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FRLayeredNavigationControllerDelegate Protocol Reference 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 18 | 19 | 22 | 58 |
59 | 92 |
93 |
94 | 95 | 101 | 106 |
107 | 108 |
109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
Conforms toNSObject
Declared inFRLayeredNavigationController.h
117 | 118 | 119 | 120 | 121 |
122 | 123 |

Overview

124 |

The FRLayeredNavigationControllerDelegate protocol is used by delegates of FRLayeredNavigationController 125 | to detect actions such as views starting to move, in the process of moving, and finished moving. This allows 126 | apps which have content ‘underneath’ the layered controller to adjust it appropriately.

127 |
128 | 129 | 130 | 131 | 132 | 133 |
134 | 135 |

Tasks

136 | 137 | 138 | 139 | 140 | 141 | 168 | 169 |
170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 |
180 | 181 |

Instance Methods

182 | 183 |
184 | 185 |

layeredNavigationController:didMoveController:

186 | 187 | 188 | 189 |
190 |

Sent by the layered navigation controller when it has finished moving a view controller.

191 |
192 | 193 | 194 | 195 |
- (void)layeredNavigationController:(FRLayeredNavigationController *)layeredController didMoveController:(UIViewController *)controller
196 | 197 | 198 | 199 |
200 |

Parameters

201 | 202 |
203 |
layeredController
204 |

The layered controller being interacted with.

205 |
206 | 207 |
208 |
controller
209 |

The view controller which has finished moving.

210 |
211 | 212 |
213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
221 |

Discussion

222 |

Sent by the layered navigation controller when it has finished moving a view controller.

223 |
224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 |
232 |

Declared In

233 | FRLayeredNavigationController.h
234 |
235 | 236 | 237 |
238 | 239 |
240 | 241 |

layeredNavigationController:movingViewController:

242 | 243 | 244 | 245 |
246 |

Sent by the layered navigation controller when it is moving a view controller. This message 247 | may be sent multiple times over the course of an interaction, and so any code implemented by 248 | the delegate here should be efficient.

249 |
250 | 251 | 252 | 253 |
- (void)layeredNavigationController:(FRLayeredNavigationController *)layeredController movingViewController:(UIViewController *)controller
254 | 255 | 256 | 257 |
258 |

Parameters

259 | 260 |
261 |
layeredController
262 |

The layered controller being interacted with.

263 |
264 | 265 |
266 |
controller
267 |

The view controller which is currently being moved.

268 |
269 | 270 |
271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 |
279 |

Discussion

280 |

Sent by the layered navigation controller when it is moving a view controller. This message 281 | may be sent multiple times over the course of an interaction, and so any code implemented by 282 | the delegate here should be efficient.

283 |
284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 |
292 |

Declared In

293 | FRLayeredNavigationController.h
294 |
295 | 296 | 297 |
298 | 299 |
300 | 301 |

layeredNavigationController:willMoveController:

302 | 303 | 304 | 305 |
306 |

Sent by the layered navigation controller when it is about to begin moving a view controller. This message 307 | is only sent if the controller can be moved.

308 |
309 | 310 | 311 | 312 |
- (void)layeredNavigationController:(FRLayeredNavigationController *)layeredController willMoveController:(UIViewController *)controller
313 | 314 | 315 | 316 |
317 |

Parameters

318 | 319 |
320 |
layeredController
321 |

The layered controller being interacted with.

322 |
323 | 324 |
325 |
controller
326 |

The view controller which is about to be moved.

327 |
328 | 329 |
330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 |
338 |

Discussion

339 |

Sent by the layered navigation controller when it is about to begin moving a view controller. This message 340 | is only sent if the controller can be moved.

341 |
342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 |
350 |

Declared In

351 | FRLayeredNavigationController.h
352 |
353 | 354 | 355 |
356 | 357 |
358 | 359 | 360 |
361 | 367 | 376 |
377 |
378 | 469 | 470 | -------------------------------------------------------------------------------- /docs/html/css/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 3 | font-size: 13px; 4 | } 5 | 6 | code { 7 | font-family: Courier, Consolas, monospace; 8 | font-size: 13px; 9 | color: #666; 10 | } 11 | 12 | pre { 13 | font-family: Courier, Consolas, monospace; 14 | font-size: 13px; 15 | line-height: 18px; 16 | tab-interval: 0.5em; 17 | border: 1px solid #C7CFD5; 18 | background-color: #F1F5F9; 19 | color: #666; 20 | padding: 0.3em 1em; 21 | } 22 | 23 | ul { 24 | list-style-type: square; 25 | } 26 | 27 | li { 28 | margin-bottom: 10px; 29 | } 30 | 31 | a, a code { 32 | text-decoration: none; 33 | color: #36C; 34 | } 35 | 36 | a:hover, a:hover code { 37 | text-decoration: underline; 38 | color: #36C; 39 | } 40 | 41 | h2 { 42 | border-bottom: 1px solid #8391A8; 43 | color: #3C4C6C; 44 | font-size: 187%; 45 | font-weight: normal; 46 | margin-top: 1.75em; 47 | padding-bottom: 2px; 48 | } 49 | 50 | table { 51 | margin-bottom: 4em; 52 | border-collapse:collapse; 53 | vertical-align: middle; 54 | } 55 | 56 | td { 57 | border: 1px solid #9BB3CD; 58 | padding: .667em; 59 | font-size: 100%; 60 | } 61 | 62 | th { 63 | border: 1px solid #9BB3CD; 64 | padding: .3em .667em .3em .667em; 65 | background: #93A5BB; 66 | font-size: 103%; 67 | font-weight: bold; 68 | color: white; 69 | text-align: left; 70 | } 71 | 72 | /* @group Common page elements */ 73 | 74 | #top_header { 75 | height: 91px; 76 | left: 0; 77 | min-width: 598px; 78 | position: absolute; 79 | right: 0; 80 | top: 0; 81 | z-index: 900; 82 | } 83 | 84 | #footer { 85 | clear: both; 86 | padding-top: 20px; 87 | text-align: center; 88 | } 89 | 90 | #contents, #overview_contents { 91 | -webkit-overflow-scrolling: touch; 92 | border-top: 1px solid #2B334F; 93 | position: absolute; 94 | top: 91px; 95 | left: 0; 96 | right: 0; 97 | bottom: 0; 98 | overflow-x: hidden; 99 | overflow-y: auto; 100 | padding-left: 2em; 101 | padding-right: 2em; 102 | padding-top: 1em; 103 | min-width: 550px; 104 | } 105 | 106 | #contents.isShowingTOC { 107 | left: 230px; 108 | min-width: 320px; 109 | } 110 | 111 | .copyright { 112 | font-size: 12px; 113 | } 114 | 115 | .generator { 116 | font-size: 11px; 117 | } 118 | 119 | .main-navigation ul li { 120 | display: inline; 121 | margin-left: 15px; 122 | list-style: none; 123 | } 124 | 125 | .navigation-top { 126 | clear: both; 127 | float: right; 128 | } 129 | 130 | .navigation-bottom { 131 | clear: both; 132 | float: right; 133 | margin-top: 20px; 134 | margin-bottom: -10px; 135 | } 136 | 137 | .open > .disclosure { 138 | background-image: url("../img/disclosure_open.png"); 139 | } 140 | 141 | .disclosure { 142 | background: url("../img/disclosure.png") no-repeat scroll 0 0; 143 | } 144 | 145 | .disclosure, .nodisclosure { 146 | display: inline-block; 147 | height: 8px; 148 | margin-right: 5px; 149 | position: relative; 150 | width: 9px; 151 | } 152 | 153 | /* @end */ 154 | 155 | /* @group Header */ 156 | 157 | #top_header #library { 158 | background: url("../img/library_background.png") repeat-x 0 0 #485E78; 159 | background-color: #ccc; 160 | height: 35px; 161 | font-size: 115%; 162 | } 163 | 164 | #top_header #library #libraryTitle { 165 | color: #FFFFFF; 166 | margin-left: 15px; 167 | text-shadow: 0 -1px 0 #485E78; 168 | top: 8px; 169 | position: absolute; 170 | } 171 | 172 | #top_header #library #developerHome { 173 | color: #92979E; 174 | right: 15px; 175 | top: 8px; 176 | position: absolute; 177 | } 178 | 179 | #top_header #library a:hover { 180 | text-decoration: none; 181 | } 182 | 183 | #top_header #title { 184 | background: url("../img/title_background.png") repeat-x 0 0 #8A98A9; 185 | border-bottom: 1px solid #B6B6B6; 186 | height: 25px; 187 | overflow: hidden; 188 | } 189 | 190 | #top_header h1 { 191 | font-size: 115%; 192 | font-weight: normal; 193 | margin: 0; 194 | padding: 3px 0 2px; 195 | text-align: center; 196 | text-shadow: 0 1px 0 #D5D5D5; 197 | white-space: nowrap; 198 | } 199 | 200 | #headerButtons { 201 | background-color: #D8D8D8; 202 | background-image: url("../img/button_bar_background.png"); 203 | border-bottom: 1px solid #EDEDED; 204 | border-top: 1px solid #2B334F; 205 | font-size: 8pt; 206 | height: 28px; 207 | left: 0; 208 | list-style: none outside none; 209 | margin: 0; 210 | overflow: hidden; 211 | padding: 0; 212 | position: absolute; 213 | right: 0; 214 | top: 61px; 215 | } 216 | 217 | #headerButtons li { 218 | background-repeat: no-repeat; 219 | display: inline; 220 | margin-top: 0; 221 | margin-bottom: 0; 222 | padding: 0; 223 | } 224 | 225 | #toc_button button { 226 | border-color: #ACACAC; 227 | border-style: none solid none none; 228 | border-width: 0 1px 0 0; 229 | height: 28px; 230 | margin: 0; 231 | padding-left: 30px; 232 | text-align: left; 233 | width: 230px; 234 | } 235 | 236 | li#jumpto_button { 237 | left: 230px; 238 | margin-left: 0; 239 | position: absolute; 240 | } 241 | 242 | li#jumpto_button select { 243 | height: 22px; 244 | margin: 5px 2px 0 10px; 245 | max-width: 300px; 246 | } 247 | 248 | /* @end */ 249 | 250 | /* @group Table of contents */ 251 | 252 | #tocContainer.isShowingTOC { 253 | border-right: 1px solid #ACACAC; 254 | display: block; 255 | overflow-x: hidden; 256 | overflow-y: auto; 257 | padding: 0; 258 | } 259 | 260 | #tocContainer { 261 | background-color: #E4EBF7; 262 | border-top: 1px solid #2B334F; 263 | bottom: 0; 264 | display: none; 265 | left: 0; 266 | overflow: hidden; 267 | position: absolute; 268 | top: 91px; 269 | width: 229px; 270 | } 271 | 272 | #tocContainer > ul#toc { 273 | font-size: 11px; 274 | margin: 0; 275 | padding: 12px 0 18px; 276 | width: 209px; 277 | -moz-user-select: none; 278 | -webkit-user-select: none; 279 | user-select: none; 280 | } 281 | 282 | #tocContainer > ul#toc > li { 283 | margin: 0; 284 | padding: 0 0 7px 30px; 285 | text-indent: -15px; 286 | } 287 | 288 | #tocContainer > ul#toc > li > .sectionName a { 289 | color: #000000; 290 | font-weight: bold; 291 | } 292 | 293 | #tocContainer > ul#toc > li > .sectionName a:hover { 294 | text-decoration: none; 295 | } 296 | 297 | #tocContainer > ul#toc li.children > ul { 298 | display: none; 299 | height: 0; 300 | } 301 | 302 | #tocContainer > ul#toc > li > ul { 303 | margin: 0; 304 | padding: 0; 305 | } 306 | 307 | #tocContainer > ul#toc > li > ul, ul#toc > li > ul > li { 308 | margin-left: 0; 309 | margin-bottom: 0; 310 | padding-left: 15px; 311 | } 312 | 313 | #tocContainer > ul#toc > li ul { 314 | list-style: none; 315 | margin-right: 0; 316 | padding-right: 0; 317 | } 318 | 319 | #tocContainer > ul#toc li.children.open > ul { 320 | display: block; 321 | height: auto; 322 | margin-left: -15px; 323 | padding-left: 0; 324 | } 325 | 326 | #tocContainer > ul#toc > li > ul, ul#toc > li > ul > li { 327 | margin-left: 0; 328 | padding-left: 15px; 329 | } 330 | 331 | #tocContainer li ul li { 332 | margin-top: 0.583em; 333 | overflow: hidden; 334 | text-overflow: ellipsis; 335 | white-space: nowrap; 336 | } 337 | 338 | #tocContainer li ul li span.sectionName { 339 | white-space: normal; 340 | } 341 | 342 | #tocContainer > ul#toc > li > ul > li > .sectionName a { 343 | font-weight: bold; 344 | } 345 | 346 | #tocContainer > ul#toc > li > ul a { 347 | color: #4F4F4F; 348 | } 349 | 350 | /* @end */ 351 | 352 | /* @group Index formatting */ 353 | 354 | .index-title { 355 | font-size: 13px; 356 | font-weight: normal; 357 | } 358 | 359 | .index-column { 360 | float: left; 361 | width: 30%; 362 | min-width: 200px; 363 | font-size: 11px; 364 | } 365 | 366 | .index-column ul { 367 | margin: 8px 0 0 0; 368 | padding: 0; 369 | list-style: none; 370 | } 371 | 372 | .index-column ul li { 373 | margin: 0 0 3px 0; 374 | padding: 0; 375 | } 376 | 377 | .hierarchy-column { 378 | min-width: 400px; 379 | } 380 | 381 | .hierarchy-column ul { 382 | margin: 3px 0 0 15px; 383 | } 384 | 385 | .hierarchy-column ul li { 386 | list-style-type: square; 387 | } 388 | 389 | /* @end */ 390 | 391 | /* @group Common formatting elements */ 392 | 393 | .title { 394 | font-weight: normal; 395 | font-size: 215%; 396 | margin-top:0; 397 | } 398 | 399 | .subtitle { 400 | font-weight: normal; 401 | font-size: 180%; 402 | color: #3C4C6C; 403 | border-bottom: 1px solid #5088C5; 404 | } 405 | 406 | .subsubtitle { 407 | font-weight: normal; 408 | font-size: 145%; 409 | height: 0.7em; 410 | } 411 | 412 | .note { 413 | border: 1px solid #5088C5; 414 | background-color: white; 415 | margin: 1.667em 0 1.75em 0; 416 | padding: 0 .667em .083em .750em; 417 | } 418 | 419 | .warning { 420 | border: 1px solid #5088C5; 421 | background-color: #F0F3F7; 422 | margin-bottom: 0.5em; 423 | padding: 0.3em 0.8em; 424 | } 425 | 426 | .bug { 427 | border: 1px solid #000; 428 | background-color: #ffffcc; 429 | margin-bottom: 0.5em; 430 | padding: 0.3em 0.8em; 431 | } 432 | 433 | .deprecated { 434 | color: #F60425; 435 | } 436 | 437 | /* @end */ 438 | 439 | /* @group Common layout */ 440 | 441 | .section { 442 | margin-top: 3em; 443 | } 444 | 445 | /* @end */ 446 | 447 | /* @group Object specification section */ 448 | 449 | .section-specification { 450 | margin-left: 2.5em; 451 | margin-right: 2.5em; 452 | font-size: 12px; 453 | } 454 | 455 | .section-specification table { 456 | margin-bottom: 0em; 457 | border-top: 1px solid #d6e0e5; 458 | } 459 | 460 | .section-specification td { 461 | vertical-align: top; 462 | border-bottom: 1px solid #d6e0e5; 463 | border-left-width: 0px; 464 | border-right-width: 0px; 465 | border-top-width: 0px; 466 | padding: .6em; 467 | } 468 | 469 | .section-specification .specification-title { 470 | font-weight: bold; 471 | } 472 | 473 | /* @end */ 474 | 475 | /* @group Tasks section */ 476 | 477 | .task-list { 478 | list-style-type: none; 479 | padding-left: 0px; 480 | } 481 | 482 | .task-list li { 483 | margin-bottom: 3px; 484 | } 485 | 486 | .task-item-suffix { 487 | color: #996; 488 | font-size: 12px; 489 | font-style: italic; 490 | margin-left: 0.5em; 491 | } 492 | 493 | span.tooltip span.tooltip { 494 | font-size: 1.0em; 495 | display: none; 496 | padding: 0.3em; 497 | border: 1px solid #aaa; 498 | background-color: #fdfec8; 499 | color: #000; 500 | text-align: left; 501 | } 502 | 503 | span.tooltip:hover span.tooltip { 504 | display: block; 505 | position: absolute; 506 | margin-left: 2em; 507 | } 508 | 509 | /* @end */ 510 | 511 | /* @group Method section */ 512 | 513 | .section-method { 514 | margin-top: 2.3em; 515 | } 516 | 517 | .method-title { 518 | margin-bottom: 1.5em; 519 | } 520 | 521 | .method-subtitle { 522 | margin-top: 0.7em; 523 | margin-bottom: 0.2em; 524 | } 525 | 526 | .method-subsection p { 527 | margin-top: 0.4em; 528 | margin-bottom: 0.8em; 529 | } 530 | 531 | .method-declaration { 532 | margin-top:1.182em; 533 | margin-bottom:.909em; 534 | } 535 | 536 | .method-declaration code { 537 | font:14px Courier, Consolas, monospace; 538 | color:#000; 539 | } 540 | 541 | .declaration { 542 | color: #000; 543 | } 544 | 545 | .argument-def { 546 | margin-top: 0.3em; 547 | margin-bottom: 0.3em; 548 | } 549 | 550 | .argument-def dd { 551 | margin-left: 1.25em; 552 | } 553 | 554 | .see-also-section ul { 555 | list-style-type: none; 556 | padding-left: 0px; 557 | margin-top: 0; 558 | } 559 | 560 | .see-also-section li { 561 | margin-bottom: 3px; 562 | } 563 | 564 | .declared-in-ref { 565 | color: #666; 566 | } 567 | 568 | #tocContainer.hideInXcode { 569 | display: none; 570 | border: 0px solid black; 571 | } 572 | 573 | #top_header.hideInXcode { 574 | display: none; 575 | } 576 | 577 | #contents.hideInXcode { 578 | border: 0px solid black; 579 | top: 0px; 580 | left: 0px; 581 | } 582 | 583 | /* @end */ 584 | 585 | -------------------------------------------------------------------------------- /docs/html/css/stylesPrint.css: -------------------------------------------------------------------------------- 1 | 2 | header { 3 | display: none; 4 | } 5 | 6 | div.main-navigation, div.navigation-top { 7 | display: none; 8 | } 9 | 10 | div#overview_contents, div#contents.isShowingTOC, div#contents { 11 | overflow: visible; 12 | position: relative; 13 | top: 0px; 14 | border: none; 15 | left: 0; 16 | } 17 | #tocContainer.isShowingTOC { 18 | display: none; 19 | } 20 | nav { 21 | display: none; 22 | } -------------------------------------------------------------------------------- /docs/html/hierarchy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FRLayeredNavigationController Hierarchy 6 | 7 | 8 | 9 | 10 | 11 |
12 | 16 | 17 | 20 | 21 |
22 |
23 |
24 | 27 | 32 |
33 | 34 |
35 |

Class Hierarchy

36 | 37 | 58 | 59 |
60 | 61 | 62 | 63 |
64 | 65 |

Protocol References

66 | 71 | 72 | 73 |

Category References

74 | 79 | 80 |
81 | 82 |
83 | 86 | 96 |
97 |
98 | 99 | -------------------------------------------------------------------------------- /docs/html/img/button_bar_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/docs/html/img/button_bar_background.png -------------------------------------------------------------------------------- /docs/html/img/disclosure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/docs/html/img/disclosure.png -------------------------------------------------------------------------------- /docs/html/img/disclosure_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/docs/html/img/disclosure_open.png -------------------------------------------------------------------------------- /docs/html/img/library_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/docs/html/img/library_background.png -------------------------------------------------------------------------------- /docs/html/img/title_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weissi/FRLayeredNavigationController/391c617f8bbdfbb3f8f305692cfe368ea6f06b03/docs/html/img/title_background.png -------------------------------------------------------------------------------- /docs/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FRLayeredNavigationController Reference 6 | 7 | 8 | 9 | 10 | 11 |
12 | 16 | 17 | 20 | 21 |
22 |
23 |
24 | 27 | 32 |
33 | 34 | 35 | 36 | 37 | 38 |
39 |

Class References

40 | 49 |
50 | 51 | 52 | 53 |
54 | 55 |

Protocol References

56 | 61 | 62 | 63 |

Category References

64 | 69 | 70 |
71 | 72 |
73 | 76 | 86 |
87 |
88 | 89 | -------------------------------------------------------------------------------- /generate-html-documentation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | appledoc --create-html --project-name FRLayeredNavigationController \ 4 | --project-company 'factis research GmbH' \ 5 | --company-id com.factisresearch --output docs \ 6 | --no-create-docset FRLayeredNavigationController 7 | -------------------------------------------------------------------------------- /syncheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd) 6 | PROG=syncheck.sh 7 | 8 | trap bug_found ERR 9 | 10 | function usage() { 11 | echo "$PROG" 12 | } 13 | 14 | function bug_found() { 15 | echo >&2 "ERROR: You found a bug in the $PROG script, please report" 16 | exit 99 17 | } 18 | 19 | cd "$HERE" 20 | 21 | RET=0 22 | 23 | #file test args msg 24 | function check() { 25 | if grep -q $3 "$2" -- "$1"; then 26 | echo "SYNTAX ERROR: $4 found in '$1'" 27 | grep --color=always $3 "$2" -- "$1" | while read line; do 28 | echo " --> $line" 29 | done 30 | echo 31 | RET=1 32 | fi 33 | return 0 34 | } 35 | 36 | while read file; do 37 | check "$file" '^.{121,}$' -EHn "line too long" 38 | check "$file" ' $' -EHn "trailing whitespace" 39 | check "$file" ' ' -Hn "tab found" 40 | check "$file" '^ +[+-]' -EHn "method declaration/definition not on line start" 41 | check "$file" '^[+-]\([a-z *]+\)' -EHn "method declaration/definition syntax" 42 | check "$file" '@synthesize' -Hn "@synthesize found" 43 | check "$file" '^[+-] \(.*\).*\{' -EHn "method definition: { not on next line" 44 | done < <(find FRLayeredNavigationController -name '*.h' \ 45 | -or -name '*.m' -type f) 46 | 47 | if [ $RET -eq 0 ]; then 48 | echo "CONGRATULATIONS, looks fine" 49 | fi 50 | 51 | exit $RET 52 | --------------------------------------------------------------------------------