├── SCNavigation ├── en.lproj │ └── InfoPlist.strings ├── SCNavigation │ ├── Resources │ │ ├── navi_mask@2x.png │ │ └── navi_shadow@2x.png │ ├── SCNavigationBar.h │ ├── SCNavigation.h │ ├── SCNavigationPopAnimation.h │ ├── SCNavigationPushAnimation.h │ ├── SCNavigationController.h │ ├── SCShared.h │ ├── SCNavigationItem.h │ ├── UIViewController+SCNavigation.h │ ├── SCBarButtonItem.h │ ├── SCNavigationBar.m │ ├── SCNavigationItem.m │ ├── SCBarButtonItem.m │ ├── UIViewController+SCNavigation.m │ ├── SCNavigationPushAnimation.m │ ├── SCNavigationPopAnimation.m │ └── SCNavigationController.m ├── Images.xcassets │ ├── LaunchImage.launchimage │ │ ├── launchImage_375.png │ │ ├── launchImage_621.png │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── SCViewController.h ├── SCAppDelegate.h ├── Additions │ └── FrameAccessor │ │ ├── FrameAccessor.h │ │ ├── ScrollViewFrameAccessor.h │ │ ├── ViewFrameAccessor.h │ │ ├── ScrollViewFrameAccessor.m │ │ └── ViewFrameAccessor.m ├── main.m ├── SCNavigation-Prefix.pch ├── SCNavigation-Info.plist ├── SCAppDelegate.m └── SCViewController.m ├── SCNavigationTests ├── en.lproj │ └── InfoPlist.strings ├── SCNavigationTests-Info.plist └── SCNavigationTests.m ├── SCNavigation.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── .gitignore ├── README.md └── LICENSE /SCNavigation/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SCNavigationTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/Resources/navi_mask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/singro/SCNavigation/HEAD/SCNavigation/SCNavigation/Resources/navi_mask@2x.png -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/Resources/navi_shadow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/singro/SCNavigation/HEAD/SCNavigation/SCNavigation/Resources/navi_shadow@2x.png -------------------------------------------------------------------------------- /SCNavigation/Images.xcassets/LaunchImage.launchimage/launchImage_375.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/singro/SCNavigation/HEAD/SCNavigation/Images.xcassets/LaunchImage.launchimage/launchImage_375.png -------------------------------------------------------------------------------- /SCNavigation/Images.xcassets/LaunchImage.launchimage/launchImage_621.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/singro/SCNavigation/HEAD/SCNavigation/Images.xcassets/LaunchImage.launchimage/launchImage_621.png -------------------------------------------------------------------------------- /SCNavigation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationBar.h 3 | // 4 | // Created by Singro on 6/23/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SCNavigationBar : UIView 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /SCNavigation/SCViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCViewController.h 3 | // SCNavigation 4 | // 5 | // Created by Singro on 8/15/14. 6 | // Copyright (c) 2014 Singro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SCViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.moved-aside 14 | DerivedData 15 | .idea/ 16 | *.hmap 17 | *.xccheckout 18 | 19 | #CocoaPods 20 | Pods 21 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigation.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigation.h 3 | // 4 | // Created by Singro on 5/25/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import "SCNavigationController.h" 9 | #import "SCNavigationItem.h" 10 | #import "SCBarButtonItem.h" 11 | #import "UIViewController+SCNavigation.h" 12 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationPopAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationPopAnimation.h 3 | // 4 | // Created by Singro on 3/2/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SCNavigationPopAnimation : NSObject 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationPushAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationPushAnimation.h 3 | // 4 | // Created by Singro on 5/25/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SCNavigationPushAnimation : NSObject 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /SCNavigation/SCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCAppDelegate.h 3 | // SCNavigation 4 | // 5 | // Created by Singro on 8/15/14. 6 | // Copyright (c) 2014 Singro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SCAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SCNavigation/Additions/FrameAccessor/FrameAccessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // FrameAccessor.h 3 | // FrameAccessor 4 | // 5 | // Created by Alex Denisov on 18.03.12. 6 | // Copyright (c) 2013 okolodev.org. All rights reserved. 7 | // 8 | 9 | #import "ViewFrameAccessor.h" 10 | 11 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 12 | #import "ScrollViewFrameAccessor.h" 13 | #endif -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationController.h 3 | // 4 | // Created by Singro on 2/19/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface SCNavigationController : UINavigationController 11 | 12 | @property (nonatomic, assign) BOOL enableInnerInactiveGesture; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCShared.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCShared.h 3 | // 4 | // Created by Singro on 5/19/15. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | 9 | #import "FrameAccessor.h" 10 | 11 | #define kNavigationBarTintColor [UIColor blackColor] 12 | #define kNavigationBarColor [UIColor colorWithWhite:1.00 alpha:0.980] 13 | #define kNavigationBarLineColor [UIColor colorWithWhite:0.869 alpha:1] 14 | -------------------------------------------------------------------------------- /SCNavigation/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SCNavigation 4 | // 5 | // Created by Singro on 8/15/14. 6 | // Copyright (c) 2014 Singro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "SCAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([SCAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #import "SCNavigation.h" 17 | #endif 18 | -------------------------------------------------------------------------------- /SCNavigation/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "60x60", 21 | "scale" : "3x" 22 | } 23 | ], 24 | "info" : { 25 | "version" : 1, 26 | "author" : "xcode" 27 | } 28 | } -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationItem.h 3 | // 4 | // Created by Singro on 5/25/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @class SCBarButtonItem; 11 | @interface SCNavigationItem : NSObject 12 | 13 | @property (nonatomic, strong ) SCBarButtonItem *leftBarButtonItem; 14 | @property (nonatomic, strong ) SCBarButtonItem *rightBarButtonItem; 15 | @property (nonatomic, copy ) NSString *title; 16 | 17 | @property (nonatomic, readonly) UIView *titleView; 18 | @property (nonatomic, readonly) UILabel *titleLabel; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ###SCNavigation 2 | ============ 3 | 4 | A custom navigation for pan gesture pop & maximum customization 5 | 6 | 7 | ####Feature 8 | * Full custom navigation bar. 9 | * iOS7 Style pop animation with pan gesture 10 | * Pop animation based on previous status of navigation bar. 11 | * Support iPhone 6 / 6 plus, iOS7+ 12 | 13 | ####Third Parties 14 | * [FrameAccessor](https://github.com/AlexDenisov/FrameAccessor) 15 | 16 | ####Usage 17 | * Copy to your project 18 | * Use SCNavigationController instead of UINavigationController 19 | 20 | ####DEMO 21 | ![DEMO](http://ww3.sinaimg.cn/large/84efdcc6gw1ejibypsu1qg208w0fse81.gif) 22 | 23 | ####License 24 | 25 | MIT 26 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/UIViewController+SCNavigation.h: -------------------------------------------------------------------------------- 1 | // 2 | // SPViewController+NaviBar.h 3 | // 4 | // Created by Singro on 5/19/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import "SCNavigationItem.h" 9 | #import "SCBarButtonItem.h" 10 | 11 | @interface UIViewController (SCNavigation) 12 | 13 | @property (nonatomic, strong) SCNavigationItem *sc_navigationItem; 14 | @property (nonatomic, strong) UIView *sc_navigationBar; 15 | 16 | @property(nonatomic, getter = sc_isNavigationBarHidden) BOOL sc_navigationBarHidden; 17 | 18 | - (void)sc_setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated; 19 | 20 | - (void)naviBeginRefreshing; 21 | - (void)naviEndRefreshing; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /SCNavigationTests/SCNavigationTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.singro.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SCNavigationTests/SCNavigationTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationTests.m 3 | // SCNavigationTests 4 | // 5 | // Created by Singro on 8/15/14. 6 | // Copyright (c) 2014 Singro. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SCNavigationTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation SCNavigationTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /SCNavigation/Additions/FrameAccessor/ScrollViewFrameAccessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollViewFrameAccessor.h 3 | // ScrollViewFrameAccessor 4 | // 5 | // Created by Ivanenko Dmitry on 28.10.13. 6 | // Copyright (c) 2013 Artox Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface UIScrollView (FrameAccessor) 13 | 14 | // Content Offset 15 | @property (nonatomic) CGFloat contentOffsetX; 16 | @property (nonatomic) CGFloat contentOffsetY; 17 | 18 | // Content Size 19 | @property (nonatomic) CGFloat contentSizeWidth; 20 | @property (nonatomic) CGFloat contentSizeHeight; 21 | 22 | // Content Inset 23 | @property (nonatomic) CGFloat contentInsetTop; 24 | @property (nonatomic) CGFloat contentInsetLeft; 25 | @property (nonatomic) CGFloat contentInsetBottom; 26 | @property (nonatomic) CGFloat contentInsetRight; 27 | 28 | @end -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCBarButtonItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // SCBarButtonItem.h 3 | // 4 | // Created by Singro on 5/25/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | typedef NS_ENUM(NSInteger, SCBarButtonItemStyle) { // for future use 11 | SCBarButtonItemStylePlain, 12 | SCBarButtonItemStyleBordered, 13 | SCBarButtonItemStyleDone, 14 | }; 15 | 16 | @interface SCBarButtonItem : NSObject 17 | 18 | @property (nonatomic, strong) UIView *view; 19 | 20 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 21 | 22 | - (instancetype)initWithTitle:(NSString *)title style:(SCBarButtonItemStyle)style handler:(void (^)(id sender))action; 23 | 24 | - (instancetype)initWithImage:(UIImage *)image style:(SCBarButtonItemStyle)style handler:(void (^)(id sender))action; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /SCNavigation/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "launchImage_621.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "667h", 16 | "filename" : "launchImage_375.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "orientation" : "portrait", 23 | "idiom" : "iphone", 24 | "extent" : "full-screen", 25 | "minimum-system-version" : "7.0", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "orientation" : "portrait", 30 | "idiom" : "iphone", 31 | "extent" : "full-screen", 32 | "minimum-system-version" : "7.0", 33 | "subtype" : "retina4", 34 | "scale" : "2x" 35 | } 36 | ], 37 | "info" : { 38 | "version" : 1, 39 | "author" : "xcode" 40 | } 41 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 singro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.singro.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationBar.m 3 | // 4 | // Created by Singro on 6/23/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import "SCNavigationBar.h" 9 | 10 | #import "SCShared.h" 11 | 12 | @interface SCNavigationBar () 13 | 14 | @property (nonatomic, strong) UIView *lineView; 15 | @end 16 | 17 | @implementation SCNavigationBar 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | 24 | self.frame = (CGRect){0, 0, [UIScreen mainScreen].bounds.size.width, 64}; 25 | 26 | self.backgroundColor = kNavigationBarColor; 27 | 28 | self.lineView = [[UIView alloc] initWithFrame:(CGRect){0, 64, [UIScreen mainScreen].bounds.size.width, 0.5}]; 29 | self.lineView.backgroundColor = kNavigationBarLineColor; 30 | [self addSubview:self.lineView]; 31 | 32 | } 33 | return self; 34 | } 35 | 36 | - (instancetype)init { 37 | return [self initWithFrame:CGRectZero]; 38 | } 39 | 40 | - (void)dealloc { 41 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 42 | } 43 | 44 | #pragma mark - Notifications 45 | 46 | - (void)didReceiveThemeChangeNotification { 47 | 48 | self.backgroundColor = kNavigationBarColor; 49 | self.lineView.backgroundColor = kNavigationBarLineColor; 50 | 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /SCNavigation/Additions/FrameAccessor/ViewFrameAccessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewFrameAccessor.h 3 | // ViewFrameAccessor 4 | // 5 | // Created by Alex Denisov on 18.03.12. 6 | // Copyright (c) 2013 okolodev.org. All rights reserved. 7 | // 8 | 9 | 10 | #define IS_IOS_DEVICE (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 11 | 12 | #if IS_IOS_DEVICE 13 | #import 14 | #define View UIView 15 | #else 16 | #import 17 | #define View NSView 18 | #endif 19 | 20 | 21 | @interface View (FrameAccessor) 22 | 23 | // Frame 24 | @property (nonatomic) CGPoint origin; 25 | @property (nonatomic) CGSize size; 26 | 27 | // Frame Origin 28 | @property (nonatomic) CGFloat x; 29 | @property (nonatomic) CGFloat y; 30 | 31 | // Frame Size 32 | @property (nonatomic) CGFloat width; 33 | @property (nonatomic) CGFloat height; 34 | 35 | // Frame Borders 36 | @property (nonatomic) CGFloat top; 37 | @property (nonatomic) CGFloat left; 38 | @property (nonatomic) CGFloat bottom; 39 | @property (nonatomic) CGFloat right; 40 | 41 | // Center Point 42 | #if !IS_IOS_DEVICE 43 | @property (nonatomic) CGPoint center; 44 | #endif 45 | @property (nonatomic) CGFloat centerX; 46 | @property (nonatomic) CGFloat centerY; 47 | 48 | // Middle Point 49 | @property (nonatomic, readonly) CGPoint middlePoint; 50 | @property (nonatomic, readonly) CGFloat middleX; 51 | @property (nonatomic, readonly) CGFloat middleY; 52 | 53 | @end -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationItem.m 3 | // 4 | // Created by Singro on 5/25/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import "SCNavigationItem.h" 9 | 10 | #import "SCShared.h" 11 | 12 | @interface SCNavigationItem () 13 | 14 | @property (nonatomic, strong, readwrite) UILabel *titleLabel; 15 | @property (nonatomic, assign) UIViewController *_sc_viewController; 16 | 17 | @end 18 | 19 | @implementation SCNavigationItem 20 | 21 | - (instancetype)init { 22 | if (self = [super init]) { 23 | } 24 | return self; 25 | } 26 | 27 | - (void)setTitle:(NSString *)title { 28 | 29 | _title = title; 30 | 31 | if (!title) { 32 | _titleLabel.text = @""; 33 | return; 34 | } 35 | 36 | if ([title isEqualToString:_titleLabel.text]) { 37 | return; 38 | } 39 | 40 | if (!_titleLabel) { 41 | _titleLabel = [[UILabel alloc] init]; 42 | [_titleLabel setFont:[UIFont systemFontOfSize:17]]; 43 | [_titleLabel setTextColor:kNavigationBarTintColor]; 44 | _titleLabel.textAlignment = NSTextAlignmentCenter; 45 | _titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; 46 | [__sc_viewController.sc_navigationBar addSubview:_titleLabel]; 47 | } 48 | 49 | _titleLabel.text = title; 50 | [_titleLabel sizeToFit]; 51 | NSUInteger otherButtonWidth = self.leftBarButtonItem.view.width + self.rightBarButtonItem.view.width; 52 | _titleLabel.width = [UIScreen mainScreen].bounds.size.width - otherButtonWidth - 20; 53 | _titleLabel.centerY = 42; 54 | _titleLabel.centerX = [UIScreen mainScreen].bounds.size.width/2; 55 | 56 | } 57 | 58 | - (void)setLeftBarButtonItem:(SCBarButtonItem *)leftBarButtonItem { 59 | 60 | if (__sc_viewController) { 61 | [_leftBarButtonItem.view removeFromSuperview]; 62 | leftBarButtonItem.view.x = 0; 63 | leftBarButtonItem.view.centerY = 42; 64 | [__sc_viewController.sc_navigationBar addSubview:leftBarButtonItem.view]; 65 | } 66 | 67 | _leftBarButtonItem = leftBarButtonItem; 68 | } 69 | 70 | - (void)setRightBarButtonItem:(SCBarButtonItem *)rightBarButtonItem { 71 | 72 | if (__sc_viewController) { 73 | [_rightBarButtonItem.view removeFromSuperview]; 74 | rightBarButtonItem.view.x = [UIScreen mainScreen].bounds.size.width - rightBarButtonItem.view.width; 75 | rightBarButtonItem.view.centerY = 42; 76 | [__sc_viewController.sc_navigationBar addSubview:rightBarButtonItem.view]; 77 | } 78 | 79 | _rightBarButtonItem = rightBarButtonItem; 80 | 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /SCNavigation/SCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCAppDelegate.m 3 | // SCNavigation 4 | // 5 | // Created by Singro on 8/15/14. 6 | // Copyright (c) 2014 Singro. All rights reserved. 7 | // 8 | 9 | #import "SCAppDelegate.h" 10 | 11 | #import "SCViewController.h" 12 | #import "SCNavigation.h" 13 | 14 | @implementation SCAppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | 20 | SCViewController *rootVC = [[SCViewController alloc] init]; 21 | SCNavigationController *rootNavigationController = [[SCNavigationController alloc] initWithRootViewController:rootVC]; 22 | 23 | self.window.rootViewController = rootNavigationController; 24 | 25 | self.window.backgroundColor = [UIColor whiteColor]; 26 | [self.window makeKeyAndVisible]; 27 | 28 | return YES; 29 | } 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application 32 | { 33 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 34 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 35 | } 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application 38 | { 39 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 40 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 41 | } 42 | 43 | - (void)applicationWillEnterForeground:(UIApplication *)application 44 | { 45 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 46 | } 47 | 48 | - (void)applicationDidBecomeActive:(UIApplication *)application 49 | { 50 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 51 | } 52 | 53 | - (void)applicationWillTerminate:(UIApplication *)application 54 | { 55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /SCNavigation/SCViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCViewController.m 3 | // SCNavigation 4 | // 5 | // Created by Singro on 8/15/14. 6 | // Copyright (c) 2014 Singro. All rights reserved. 7 | // 8 | 9 | #import "SCViewController.h" 10 | 11 | static NSInteger pushedCount = 0; 12 | 13 | @interface SCViewController () 14 | 15 | @end 16 | 17 | @implementation SCViewController 18 | 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | 23 | self.view.backgroundColor = [UIColor whiteColor]; 24 | 25 | UILabel *switchLabel = [[UILabel alloc] initWithFrame:(CGRect){20, 153, 100, 44}]; 26 | switchLabel.font = [UIFont systemFontOfSize:15]; 27 | switchLabel.text = @"navi hidden:"; 28 | [self.view addSubview:switchLabel]; 29 | 30 | UISwitch *aSwitch = [[UISwitch alloc] initWithFrame:(CGRect){160, 160, 90, 44}]; 31 | [aSwitch addTarget:self action:@selector(switchChange:) forControlEvents:UIControlEventValueChanged]; 32 | [self.view addSubview:aSwitch]; 33 | aSwitch.on = NO; 34 | 35 | UIButton *pushButton = [[UIButton alloc] initWithFrame:(CGRect){20, 230, 200, 44}]; 36 | [pushButton setTitle:@"push" forState:UIControlStateNormal]; 37 | [pushButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 38 | pushButton.backgroundColor = [UIColor grayColor]; 39 | [pushButton addTarget:self action:@selector(pushToVC) forControlEvents:UIControlEventTouchUpInside]; 40 | [self.view addSubview:pushButton]; 41 | 42 | self.sc_navigationItem.title = [NSString stringWithFormat:@"navi %ld", (long)pushedCount]; 43 | 44 | __weak typeof(SCViewController) *weakSelf = self; 45 | 46 | if (pushedCount > 0) { 47 | self.sc_navigationItem.leftBarButtonItem = [[SCBarButtonItem alloc] initWithTitle:@"back" style:SCBarButtonItemStylePlain handler:^(id sender) { 48 | [weakSelf.navigationController popViewControllerAnimated:YES]; 49 | }]; 50 | } 51 | 52 | self.sc_navigationItem.rightBarButtonItem = [[SCBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:@"%ld", (long)pushedCount] style:SCBarButtonItemStylePlain handler:^(id sender) { 53 | [weakSelf pushToVC]; 54 | }]; 55 | 56 | } 57 | 58 | - (void)didReceiveMemoryWarning 59 | { 60 | [super didReceiveMemoryWarning]; 61 | } 62 | 63 | - (void)pushToVC { 64 | 65 | SCViewController *vc = [[SCViewController alloc] init]; 66 | pushedCount ++; 67 | [self.navigationController pushViewController:vc animated:YES]; 68 | 69 | } 70 | 71 | - (void)switchChange:(UISwitch *)aSwitch { 72 | 73 | if (aSwitch.isOn) { 74 | [self sc_setNavigationBarHidden:YES animated:YES]; 75 | } else { 76 | [self sc_setNavigationBarHidden:NO animated:YES]; 77 | } 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /SCNavigation/Additions/FrameAccessor/ScrollViewFrameAccessor.m: -------------------------------------------------------------------------------- 1 | // 2 | // ScrollViewFrameAccessor.m 3 | // ScrollViewFrameAccessor 4 | // 5 | // Created by Ivanenko Dmitry on 28.10.13. 6 | // Copyright (c) 2013 Artox Lab. All rights reserved. 7 | // 8 | 9 | #import "ScrollViewFrameAccessor.h" 10 | 11 | 12 | @implementation UIScrollView (FrameAccessor) 13 | 14 | #pragma mark Content Offset 15 | 16 | - (CGFloat)contentOffsetX 17 | { 18 | return self.contentOffset.x; 19 | } 20 | 21 | - (CGFloat)contentOffsetY 22 | { 23 | return self.contentOffset.y; 24 | } 25 | 26 | - (void)setContentOffsetX:(CGFloat)newContentOffsetX 27 | { 28 | self.contentOffset = CGPointMake(newContentOffsetX, self.contentOffsetY); 29 | } 30 | 31 | - (void)setContentOffsetY:(CGFloat)newContentOffsetY 32 | { 33 | self.contentOffset = CGPointMake(self.contentOffsetX, newContentOffsetY); 34 | } 35 | 36 | 37 | #pragma mark Content Size 38 | 39 | - (CGFloat)contentSizeWidth 40 | { 41 | return self.contentSize.width; 42 | } 43 | 44 | - (CGFloat)contentSizeHeight 45 | { 46 | return self.contentSize.height; 47 | } 48 | 49 | - (void)setContentSizeWidth:(CGFloat)newContentSizeWidth 50 | { 51 | self.contentSize = CGSizeMake(newContentSizeWidth, self.contentSizeHeight); 52 | } 53 | 54 | - (void)setContentSizeHeight:(CGFloat)newContentSizeHeight 55 | { 56 | self.contentSize = CGSizeMake(self.contentSizeWidth, newContentSizeHeight); 57 | } 58 | 59 | 60 | #pragma mark Content Inset 61 | 62 | - (CGFloat)contentInsetTop 63 | { 64 | return self.contentInset.top; 65 | } 66 | 67 | - (CGFloat)contentInsetRight 68 | { 69 | return self.contentInset.right; 70 | } 71 | 72 | - (CGFloat)contentInsetBottom 73 | { 74 | return self.contentInset.bottom; 75 | } 76 | 77 | - (CGFloat)contentInsetLeft 78 | { 79 | return self.contentInset.left; 80 | } 81 | 82 | - (void)setContentInsetTop:(CGFloat)newContentInsetTop 83 | { 84 | UIEdgeInsets newContentInset = self.contentInset; 85 | newContentInset.top = newContentInsetTop; 86 | self.contentInset = newContentInset; 87 | } 88 | 89 | - (void)setContentInsetRight:(CGFloat)newContentInsetRight 90 | { 91 | UIEdgeInsets newContentInset = self.contentInset; 92 | newContentInset.right = newContentInsetRight; 93 | self.contentInset = newContentInset; 94 | } 95 | 96 | - (void)setContentInsetBottom:(CGFloat)newContentInsetBottom 97 | { 98 | UIEdgeInsets newContentInset = self.contentInset; 99 | newContentInset.bottom = newContentInsetBottom; 100 | self.contentInset = newContentInset; 101 | } 102 | 103 | - (void)setContentInsetLeft:(CGFloat)newContentInsetLeft 104 | { 105 | UIEdgeInsets newContentInset = self.contentInset; 106 | newContentInset.left = newContentInsetLeft; 107 | self.contentInset = newContentInset; 108 | } 109 | 110 | @end -------------------------------------------------------------------------------- /SCNavigation/Additions/FrameAccessor/ViewFrameAccessor.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewFrameAccessor.m 3 | // ViewFrameAccessor 4 | // 5 | // Created by Alex Denisov on 18.03.12. 6 | // Copyright (c) 2013 okolodev.org. All rights reserved. 7 | // 8 | 9 | #import "ViewFrameAccessor.h" 10 | 11 | 12 | @implementation View (FrameAccessor) 13 | 14 | #pragma mark Frame 15 | 16 | - (CGPoint)origin 17 | { 18 | return self.frame.origin; 19 | } 20 | 21 | - (void)setOrigin:(CGPoint)newOrigin 22 | { 23 | CGRect newFrame = self.frame; 24 | newFrame.origin = newOrigin; 25 | self.frame = newFrame; 26 | } 27 | 28 | - (CGSize)size 29 | { 30 | return self.frame.size; 31 | } 32 | 33 | - (void)setSize:(CGSize)newSize 34 | { 35 | CGRect newFrame = self.frame; 36 | newFrame.size = newSize; 37 | self.frame = newFrame; 38 | } 39 | 40 | 41 | #pragma mark Frame Origin 42 | 43 | - (CGFloat)x 44 | { 45 | return self.frame.origin.x; 46 | } 47 | 48 | - (void)setX:(CGFloat)newX 49 | { 50 | CGRect newFrame = self.frame; 51 | newFrame.origin.x = newX; 52 | self.frame = newFrame; 53 | } 54 | 55 | - (CGFloat)y 56 | { 57 | return self.frame.origin.y; 58 | } 59 | 60 | - (void)setY:(CGFloat)newY 61 | { 62 | CGRect newFrame = self.frame; 63 | newFrame.origin.y = newY; 64 | self.frame = newFrame; 65 | } 66 | 67 | 68 | #pragma mark Frame Size 69 | 70 | - (CGFloat)height 71 | { 72 | return self.frame.size.height; 73 | } 74 | 75 | - (void)setHeight:(CGFloat)newHeight 76 | { 77 | CGRect newFrame = self.frame; 78 | newFrame.size.height = newHeight; 79 | self.frame = newFrame; 80 | } 81 | 82 | - (CGFloat)width 83 | { 84 | return self.frame.size.width; 85 | } 86 | 87 | - (void)setWidth:(CGFloat)newWidth 88 | { 89 | CGRect newFrame = self.frame; 90 | newFrame.size.width = newWidth; 91 | self.frame = newFrame; 92 | } 93 | 94 | 95 | #pragma mark Frame Borders 96 | 97 | - (CGFloat)left 98 | { 99 | return self.x; 100 | } 101 | 102 | - (void)setLeft:(CGFloat)left 103 | { 104 | self.x = left; 105 | } 106 | 107 | - (CGFloat)right 108 | { 109 | return self.frame.origin.x + self.frame.size.width; 110 | } 111 | 112 | - (void)setRight:(CGFloat)right 113 | { 114 | self.x = right - self.width; 115 | } 116 | 117 | - (CGFloat)top 118 | { 119 | return self.y; 120 | } 121 | 122 | - (void)setTop:(CGFloat)top 123 | { 124 | self.y = top; 125 | } 126 | 127 | - (CGFloat)bottom 128 | { 129 | return self.frame.origin.y + self.frame.size.height; 130 | } 131 | 132 | - (void)setBottom:(CGFloat)bottom 133 | { 134 | self.y = bottom - self.height; 135 | } 136 | 137 | 138 | #pragma mark Center Point 139 | 140 | #if !IS_IOS_DEVICE 141 | - (CGPoint)center 142 | { 143 | return CGPointMake(self.left + self.middleX, self.top + self.middleY); 144 | } 145 | 146 | - (void)setCenter:(CGPoint)newCenter 147 | { 148 | self.left = newCenter.x - self.middleX; 149 | self.top = newCenter.y - self.middleY; 150 | } 151 | #endif 152 | 153 | - (CGFloat)centerX 154 | { 155 | return self.center.x; 156 | } 157 | 158 | - (void)setCenterX:(CGFloat)newCenterX 159 | { 160 | self.center = CGPointMake(newCenterX, self.center.y); 161 | } 162 | 163 | - (CGFloat)centerY 164 | { 165 | return self.center.y; 166 | } 167 | 168 | - (void)setCenterY:(CGFloat)newCenterY 169 | { 170 | self.center = CGPointMake(self.center.x, newCenterY); 171 | } 172 | 173 | 174 | #pragma mark Middle Point 175 | 176 | - (CGPoint)middlePoint 177 | { 178 | return CGPointMake(self.middleX, self.middleY); 179 | } 180 | 181 | - (CGFloat)middleX 182 | { 183 | return self.width / 2; 184 | } 185 | 186 | - (CGFloat)middleY 187 | { 188 | return self.height / 2; 189 | } 190 | 191 | @end -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCBarButtonItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCBarButtonItem.m 3 | // 4 | // Created by Singro on 5/25/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import "SCBarButtonItem.h" 9 | 10 | #import "SCShared.h" 11 | 12 | @interface SCBarButtonItem () 13 | 14 | @property (nonatomic, strong) UIImage *buttonImage; 15 | @property (nonatomic, strong) UILabel *badgeLabel; 16 | 17 | @property (nonatomic, copy) void (^actionBlock)(id); 18 | 19 | @end 20 | 21 | @implementation SCBarButtonItem 22 | 23 | - (instancetype)init { 24 | 25 | if (self = [super init]) { 26 | 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (instancetype)initWithTitle:(NSString *)title style:(SCBarButtonItemStyle)style handler:(void (^)(id sender))action { 33 | 34 | if ([self init]) { 35 | 36 | UIButton *button = [[UIButton alloc] init]; 37 | [button setTitle:title forState:UIControlStateNormal]; 38 | [button.titleLabel setFont:[UIFont systemFontOfSize:15]]; 39 | [button setTitleColor:kNavigationBarTintColor forState:UIControlStateNormal]; 40 | [button sizeToFit]; 41 | button.height = 44; 42 | button.width += 30; 43 | button.centerY = 20 + 22; 44 | button.x = 0; 45 | self.view = button; 46 | 47 | self.actionBlock = action; 48 | 49 | [button addTarget:self action:@selector(handleTouchUpInside:) forControlEvents:UIControlEventTouchUpInside]; 50 | [button addTarget:self action:@selector(handleTouchDown:) forControlEvents:UIControlEventTouchDown]; 51 | [button addTarget:self action:@selector(handleTouchUp:) forControlEvents:UIControlEventTouchCancel|UIControlEventTouchUpOutside|UIControlEventTouchDragOutside]; 52 | 53 | } 54 | 55 | return self; 56 | } 57 | 58 | - (instancetype)initWithImage:(UIImage *)image style:(SCBarButtonItemStyle)style handler:(void (^)(id sender))action { 59 | 60 | if ([self init]) { 61 | 62 | self.buttonImage = image; 63 | 64 | UIButton *button = [[UIButton alloc] init]; 65 | [button setImage:image forState:UIControlStateNormal]; 66 | [button setImage:image forState:UIControlStateHighlighted]; 67 | [button sizeToFit]; 68 | button.height = 44; 69 | button.width += 30; 70 | button.centerY = 20 + 22; 71 | button.x = 0; 72 | self.view = button; 73 | 74 | self.actionBlock = action; 75 | 76 | [button addTarget:self action:@selector(handleTouchUpInside:) forControlEvents:UIControlEventTouchUpInside]; 77 | [button addTarget:self action:@selector(handleTouchDown:) forControlEvents:UIControlEventTouchDown]; 78 | [button addTarget:self action:@selector(handleTouchUp:) forControlEvents:UIControlEventTouchCancel|UIControlEventTouchUpOutside|UIControlEventTouchDragOutside]; 79 | 80 | } 81 | 82 | return self; 83 | } 84 | 85 | - (void)setEnabled:(BOOL)enabled { 86 | _enabled = enabled; 87 | 88 | if (enabled) { 89 | self.view.userInteractionEnabled = YES; 90 | self.view.alpha = 1.0; 91 | } else { 92 | self.view.userInteractionEnabled = NO; 93 | self.view.alpha = 0.3; 94 | } 95 | 96 | } 97 | 98 | #pragma mark - Private Methods 99 | 100 | - (void)handleTouchUpInside:(UIButton *)button { 101 | 102 | self.actionBlock(button); 103 | [UIView animateWithDuration:0.2 animations:^{ 104 | button.alpha = 1.0; 105 | }]; 106 | 107 | } 108 | 109 | - (void)handleTouchDown:(UIButton *)button { 110 | 111 | button.alpha = 0.3; 112 | 113 | } 114 | 115 | - (void)handleTouchUp:(UIButton *)button { 116 | 117 | [UIView animateWithDuration:0.3 animations:^{ 118 | button.alpha = 1.0; 119 | }]; 120 | 121 | } 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/UIViewController+SCNavigation.m: -------------------------------------------------------------------------------- 1 | // 2 | // SPViewController+NaviBar.m 3 | // 4 | // Created by Singro on 5/19/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | static char const * const kNaviHidden = "kSPNaviHidden"; 9 | static char const * const kNaviBar = "kSPNaviBar"; 10 | static char const * const kNaviBarView = "kNaviBarView"; 11 | 12 | #import "UIViewController+SCNavigation.h" 13 | 14 | #import 15 | 16 | #import "SCShared.h" 17 | 18 | @implementation UIViewController (SCNavigation) 19 | 20 | @dynamic sc_navigationItem; 21 | @dynamic sc_navigationBar; 22 | @dynamic sc_navigationBarHidden; 23 | 24 | - (BOOL)sc_isNavigationBarHidden { 25 | return [objc_getAssociatedObject(self, kNaviHidden) boolValue]; 26 | } 27 | 28 | - (void)setSc_navigationBarHidden:(BOOL)sc_navigationBarHidden { 29 | objc_setAssociatedObject(self, kNaviHidden, @(sc_navigationBarHidden), OBJC_ASSOCIATION_ASSIGN); 30 | } 31 | 32 | - (void)sc_setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated { 33 | if (hidden) { 34 | [UIView animateWithDuration:0.3 animations:^{ 35 | self.sc_navigationBar.y = -44; 36 | for (UIView *view in self.sc_navigationBar.subviews) { 37 | view.alpha = 0.0; 38 | } 39 | } completion:^(BOOL finished) { 40 | self.sc_navigationBarHidden = YES; 41 | }]; 42 | } else { 43 | [UIView animateWithDuration:0.3 animations:^{ 44 | self.sc_navigationBar.y = 0; 45 | for (UIView *view in self.sc_navigationBar.subviews) { 46 | view.alpha = 1.0; 47 | } 48 | } completion:^(BOOL finished) { 49 | self.sc_navigationBarHidden = NO; 50 | }]; 51 | } 52 | } 53 | 54 | - (SCNavigationItem *)sc_navigationItem { 55 | return objc_getAssociatedObject(self, kNaviBar); 56 | } 57 | 58 | - (void)setSc_navigationItem:(SCNavigationItem *)sc_navigationItem { 59 | objc_setAssociatedObject(self, kNaviBar, sc_navigationItem, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 60 | } 61 | 62 | - (UIView *)sc_navigationBar { 63 | return objc_getAssociatedObject(self, kNaviBarView); 64 | } 65 | 66 | - (void)setSc_navigationBar:(UIView *)sc_navigationBar { 67 | objc_setAssociatedObject(self, kNaviBarView, sc_navigationBar, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 68 | } 69 | 70 | - (void)naviBeginRefreshing { 71 | 72 | UIActivityIndicatorView *activityView; 73 | for (UIView *view in self.sc_navigationBar.subviews) { 74 | if ([view isKindOfClass:[UIActivityIndicatorView class]]) { 75 | activityView = (UIActivityIndicatorView *)view; 76 | } 77 | if ([view isEqual:self.sc_navigationItem.rightBarButtonItem.view]) { 78 | [view removeFromSuperview]; 79 | } 80 | } 81 | 82 | if (!activityView) { 83 | activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 84 | [activityView setColor:[UIColor blackColor]]; 85 | activityView.frame = (CGRect){[UIScreen mainScreen].bounds.size.width - 42, 25, 35, 35}; 86 | [self.sc_navigationBar addSubview:activityView]; 87 | } 88 | 89 | [activityView startAnimating]; 90 | 91 | } 92 | 93 | 94 | - (void)naviEndRefreshing { 95 | 96 | UIActivityIndicatorView *activityView; 97 | for (UIView *view in self.sc_navigationBar.subviews) { 98 | if ([view isKindOfClass:[UIActivityIndicatorView class]]) { 99 | activityView = (UIActivityIndicatorView *)view; 100 | } 101 | } 102 | 103 | if (self.sc_navigationItem.rightBarButtonItem) { 104 | [self.sc_navigationBar addSubview:self.sc_navigationItem.rightBarButtonItem.view]; 105 | } 106 | 107 | [activityView stopAnimating]; 108 | 109 | } 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationPushAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationPushAnimation.m 3 | // 4 | // Created by Singro on 5/25/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import "SCNavigationPushAnimation.h" 9 | 10 | #import "SCShared.h" 11 | 12 | #define kScreenWidth ([UIScreen mainScreen].bounds.size.width) 13 | 14 | 15 | @interface SCNavigationPushAnimation () 16 | 17 | @end 18 | 19 | 20 | @implementation SCNavigationPushAnimation 21 | 22 | 23 | - (instancetype)init { 24 | if (self = [super init]) { 25 | 26 | } 27 | return self; 28 | } 29 | 30 | - (void)animateTransition:(id)transitionContext { 31 | UIViewController *fromViewController = (UIViewController*)[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 32 | UIViewController *toViewController = (UIViewController*)[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 33 | 34 | UIView *containerView = [transitionContext containerView]; 35 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 36 | 37 | [containerView addSubview:fromViewController.view]; 38 | [containerView addSubview:toViewController.view]; 39 | fromViewController.view.frame = CGRectMake(0, 0, kScreenWidth, CGRectGetHeight(fromViewController.view.frame)); 40 | toViewController.view.frame = CGRectMake(kScreenWidth, 0, kScreenWidth, CGRectGetHeight(toViewController.view.frame)); 41 | 42 | // Configure Navi Transition 43 | 44 | UIView *naviBarView; 45 | 46 | UIView *toNaviLeft; 47 | UIView *toNaviRight; 48 | UIView *toNaviTitle; 49 | 50 | UIView *fromNaviLeft; 51 | UIView *fromNaviRight; 52 | UIView *fromNaviTitle; 53 | 54 | if (fromViewController.sc_isNavigationBarHidden || toViewController.sc_isNavigationBarHidden) { 55 | ; 56 | } else { 57 | 58 | naviBarView = [[UIView alloc] initWithFrame:(CGRect){0, 0, kScreenWidth, 64}]; 59 | naviBarView.backgroundColor = kNavigationBarColor; 60 | [containerView addSubview:naviBarView]; 61 | 62 | UIView *lineView = [[UIView alloc] initWithFrame:(CGRect){0, 64, kScreenWidth, 0.5}]; 63 | lineView.backgroundColor = kNavigationBarLineColor; 64 | [naviBarView addSubview:lineView]; 65 | 66 | toNaviLeft = toViewController.sc_navigationItem.leftBarButtonItem.view; 67 | toNaviRight = toViewController.sc_navigationItem.rightBarButtonItem.view; 68 | toNaviTitle = toViewController.sc_navigationItem.titleLabel; 69 | 70 | fromNaviLeft = fromViewController.sc_navigationItem.leftBarButtonItem.view; 71 | fromNaviRight = fromViewController.sc_navigationItem.rightBarButtonItem.view; 72 | fromNaviTitle = fromViewController.sc_navigationItem.titleLabel; 73 | 74 | [containerView addSubview:toNaviLeft]; 75 | [containerView addSubview:toNaviTitle]; 76 | [containerView addSubview:toNaviRight]; 77 | 78 | [containerView addSubview:fromNaviLeft]; 79 | [containerView addSubview:fromNaviTitle]; 80 | [containerView addSubview:fromNaviRight]; 81 | 82 | fromNaviLeft.alpha = 1.0; 83 | fromNaviRight.alpha = 1.0; 84 | fromNaviTitle.alpha = 1.0; 85 | 86 | toNaviLeft.alpha = 0.0; 87 | toNaviRight.alpha = 0.0; 88 | toNaviTitle.alpha = 0.0; 89 | toNaviTitle.centerX = 44; 90 | 91 | toNaviLeft.x = 0; 92 | toNaviTitle.centerX = kScreenWidth; 93 | toNaviRight.x = kScreenWidth+70 - toNaviRight.width; 94 | 95 | } 96 | 97 | // End configure 98 | 99 | [UIView animateWithDuration:duration animations:^{ 100 | toViewController.view.x = 0; 101 | fromViewController.view.x = -120; 102 | 103 | fromNaviLeft.alpha = 0; 104 | fromNaviRight.alpha = 0; 105 | fromNaviTitle.alpha = 0; 106 | fromNaviTitle.centerX = 0; 107 | 108 | toNaviLeft.alpha = 1.0; 109 | toNaviRight.alpha = 1.0; 110 | toNaviTitle.alpha = 1.0; 111 | toNaviTitle.centerX = kScreenWidth/2; 112 | toNaviLeft.x = 0; 113 | toNaviRight.x = kScreenWidth - toNaviRight.width; 114 | 115 | 116 | } completion:^(BOOL finished) { 117 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; 118 | 119 | fromNaviLeft.alpha = 1.0; 120 | fromNaviRight.alpha = 1.0; 121 | fromNaviTitle.alpha = 1.0; 122 | fromNaviTitle.centerX = kScreenWidth/2; 123 | fromNaviLeft.x = 0; 124 | fromNaviRight.x = kScreenWidth - fromNaviRight.width; 125 | 126 | [naviBarView removeFromSuperview]; 127 | 128 | [toNaviLeft removeFromSuperview]; 129 | [toNaviTitle removeFromSuperview]; 130 | [toNaviRight removeFromSuperview]; 131 | 132 | [fromNaviLeft removeFromSuperview]; 133 | [fromNaviTitle removeFromSuperview]; 134 | [fromNaviRight removeFromSuperview]; 135 | 136 | [toViewController.sc_navigationBar addSubview:toNaviLeft]; 137 | [toViewController.sc_navigationBar addSubview:toNaviTitle]; 138 | [toViewController.sc_navigationBar addSubview:toNaviRight]; 139 | 140 | [fromViewController.sc_navigationBar addSubview:fromNaviLeft]; 141 | [fromViewController.sc_navigationBar addSubview:fromNaviTitle]; 142 | [fromViewController.sc_navigationBar addSubview:fromNaviRight]; 143 | 144 | }]; 145 | } 146 | 147 | - (NSTimeInterval)transitionDuration:(id)transitionContext { 148 | return 0.3; 149 | } 150 | 151 | @end 152 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationPopAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationPopAnimation.m 3 | // 4 | // Created by Singro on 3/2/14. 5 | // Copyright (c) 2014 Singro. All rights reserved. 6 | // 7 | 8 | #import "SCNavigationPopAnimation.h" 9 | 10 | #import "SCShared.h" 11 | 12 | static const CGFloat kToBackgroundInitAlpha = 0.08; 13 | 14 | #define kScreenWidth ([UIScreen mainScreen].bounds.size.width) 15 | 16 | @interface SCNavigationPopAnimation () 17 | 18 | @property (nonatomic, strong) UIView *toBackgroundView; 19 | @property (nonatomic, strong) UIImageView *shadowImageView; 20 | 21 | @property (nonatomic, strong) UIView *naviContainView; 22 | 23 | @end 24 | 25 | @implementation SCNavigationPopAnimation 26 | 27 | - (instancetype)init { 28 | if (self = [super init]) { 29 | 30 | CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; 31 | 32 | self.toBackgroundView = [[UIView alloc] init]; 33 | 34 | self.shadowImageView = [[UIImageView alloc] initWithFrame:(CGRect){-10, 0, 10, screenHeight}]; 35 | self.shadowImageView.image = [UIImage imageNamed:@"navi_shadow"]; 36 | self.shadowImageView.contentMode = UIViewContentModeScaleToFill; 37 | 38 | self.naviContainView = [[UIView alloc] initWithFrame:(CGRect){0, 0, kScreenWidth, 64}]; 39 | self.naviContainView.backgroundColor = [UIColor colorWithRed:0.774 green:0.368 blue:1.000 alpha:0.810]; 40 | 41 | } 42 | return self; 43 | } 44 | 45 | - (void)animateTransition:(id)transitionContext { 46 | UIViewController *fromViewController = (UIViewController*)[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; 47 | UIViewController *toViewController = (UIViewController*)[transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; 48 | 49 | UIView *containerView = [transitionContext containerView]; 50 | NSTimeInterval duration = [self transitionDuration:transitionContext]; 51 | 52 | toViewController.view.frame = [transitionContext finalFrameForViewController:toViewController]; 53 | [containerView addSubview:fromViewController.view]; 54 | [containerView insertSubview:toViewController.view belowSubview:fromViewController.view]; 55 | [containerView insertSubview:self.toBackgroundView belowSubview:fromViewController.view]; 56 | [containerView insertSubview:self.shadowImageView belowSubview:fromViewController.view]; 57 | toViewController.view.frame = CGRectMake(-90, 0, kScreenWidth, CGRectGetHeight(toViewController.view.frame)); 58 | self.toBackgroundView.frame = CGRectMake(-90, 0, kScreenWidth, CGRectGetHeight(toViewController.view.frame)); 59 | self.shadowImageView.x = - 10; 60 | self.shadowImageView.alpha = 1.3; 61 | 62 | self.toBackgroundView.backgroundColor = [UIColor blackColor]; 63 | self.toBackgroundView.alpha = kToBackgroundInitAlpha; 64 | 65 | // Configure Navi Transition 66 | 67 | UIView *naviBarView; 68 | 69 | UIView *toNaviLeft; 70 | UIView *toNaviRight; 71 | UIView *toNaviTitle; 72 | 73 | UIView *fromNaviLeft; 74 | UIView *fromNaviRight; 75 | UIView *fromNaviTitle; 76 | 77 | if (fromViewController.sc_isNavigationBarHidden || toViewController.sc_isNavigationBarHidden) { 78 | ; 79 | } else { 80 | 81 | naviBarView = [[UIView alloc] initWithFrame:(CGRect){0, 0, kScreenWidth, 64}]; 82 | naviBarView.backgroundColor = kNavigationBarColor; 83 | [containerView addSubview:naviBarView]; 84 | 85 | UIView *lineView = [[UIView alloc] initWithFrame:(CGRect){0, 64, kScreenWidth, 0.5}]; 86 | lineView.backgroundColor = kNavigationBarLineColor; 87 | [naviBarView addSubview:lineView]; 88 | 89 | toNaviLeft = toViewController.sc_navigationItem.leftBarButtonItem.view; 90 | toNaviRight = toViewController.sc_navigationItem.rightBarButtonItem.view; 91 | toNaviTitle = toViewController.sc_navigationItem.titleLabel; 92 | 93 | fromNaviLeft = fromViewController.sc_navigationItem.leftBarButtonItem.view; 94 | fromNaviRight = fromViewController.sc_navigationItem.rightBarButtonItem.view; 95 | fromNaviTitle = fromViewController.sc_navigationItem.titleLabel; 96 | 97 | [containerView addSubview:toNaviTitle]; 98 | [containerView addSubview:fromNaviTitle]; 99 | 100 | [containerView addSubview:toNaviLeft]; 101 | [containerView addSubview:toNaviRight]; 102 | 103 | [containerView addSubview:fromNaviLeft]; 104 | [containerView addSubview:fromNaviRight]; 105 | 106 | fromNaviLeft.alpha = 1.0; 107 | fromNaviRight.alpha = 1.0; 108 | fromNaviTitle.alpha = 1.0; 109 | fromNaviLeft.x = 0; 110 | fromNaviRight.x = kScreenWidth - fromNaviRight.width; 111 | 112 | toNaviLeft.alpha = 0.0; 113 | toNaviRight.alpha = 0.0; 114 | toNaviTitle.alpha = 0.0; 115 | toNaviTitle.centerX = 44; 116 | 117 | } 118 | 119 | // End configure 120 | 121 | [UIView animateWithDuration:duration animations:^{ 122 | 123 | toViewController.view.x = 0; 124 | self.toBackgroundView.x = 0; 125 | fromViewController.view.x = kScreenWidth; 126 | 127 | self.shadowImageView.alpha = 0.2; 128 | self.shadowImageView.x = kScreenWidth - 7; 129 | 130 | 131 | self.toBackgroundView.alpha = 0.0; 132 | fromNaviLeft.alpha = 0; 133 | fromNaviRight.alpha = 0; 134 | fromNaviTitle.alpha = 0; 135 | fromNaviTitle.centerX = kScreenWidth + 10; 136 | 137 | toNaviLeft.alpha = 1.0; 138 | toNaviRight.alpha = 1.0; 139 | toNaviTitle.alpha = 1.0; 140 | toNaviTitle.centerX = kScreenWidth/2; 141 | 142 | } completion:^(BOOL finished) { 143 | 144 | if (transitionContext.transitionWasCancelled) { 145 | toNaviLeft.alpha = 1.0; 146 | toNaviRight.alpha = 1.0; 147 | toNaviTitle.alpha = 1.0; 148 | toNaviTitle.centerX = kScreenWidth/2; 149 | self.toBackgroundView.alpha = kToBackgroundInitAlpha; 150 | } 151 | 152 | [transitionContext completeTransition:!transitionContext.transitionWasCancelled]; 153 | 154 | [naviBarView removeFromSuperview]; 155 | [self.toBackgroundView removeFromSuperview]; 156 | 157 | [toNaviLeft removeFromSuperview]; 158 | [toNaviTitle removeFromSuperview]; 159 | [toNaviRight removeFromSuperview]; 160 | 161 | [fromNaviLeft removeFromSuperview]; 162 | [fromNaviTitle removeFromSuperview]; 163 | [fromNaviRight removeFromSuperview]; 164 | 165 | [toViewController.sc_navigationBar addSubview:toNaviLeft]; 166 | [toViewController.sc_navigationBar addSubview:toNaviTitle]; 167 | [toViewController.sc_navigationBar addSubview:toNaviRight]; 168 | 169 | [fromViewController.sc_navigationBar addSubview:fromNaviLeft]; 170 | [fromViewController.sc_navigationBar addSubview:fromNaviTitle]; 171 | [fromViewController.sc_navigationBar addSubview:fromNaviRight]; 172 | 173 | }]; 174 | 175 | } 176 | 177 | - (NSTimeInterval)transitionDuration:(id)transitionContext { 178 | return 0.3; 179 | } 180 | 181 | @end 182 | -------------------------------------------------------------------------------- /SCNavigation/SCNavigation/SCNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SCNavigationController.m 3 | // 4 | // 5 | // Created by Singro on 2/19/14. 6 | // Copyright (c) 2014 Singro. All rights reserved. 7 | // 8 | 9 | #import "SCNavigationController.h" 10 | 11 | #import "SCShared.h" 12 | 13 | #import "SCNavigationPopAnimation.h" 14 | #import "SCNavigationPushAnimation.h" 15 | 16 | #import "SCNavigationBar.h" 17 | 18 | @interface SCNavigationController () 19 | 20 | @property (nonatomic, strong) UIPanGestureRecognizer *panRecognizer; 21 | @property (nonatomic, strong) UIPercentDrivenInteractiveTransition *interactivePopTransition; 22 | 23 | @property (nonatomic, assign) UIViewController *lastViewController; 24 | 25 | @property (nonatomic, assign) BOOL isTransiting; 26 | 27 | @end 28 | 29 | @implementation SCNavigationController 30 | 31 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController { 32 | self = [super initWithRootViewController:rootViewController]; 33 | if (self) { 34 | 35 | self.enableInnerInactiveGesture = YES; 36 | 37 | } 38 | return self; 39 | } 40 | 41 | - (instancetype)init { 42 | if (self = [super init]) { 43 | 44 | self.enableInnerInactiveGesture = YES; 45 | 46 | } 47 | return self; 48 | } 49 | 50 | - (void)loadView { 51 | [super loadView]; 52 | 53 | } 54 | 55 | - (void)viewDidLoad 56 | { 57 | [super viewDidLoad]; 58 | 59 | self.isTransiting = NO; 60 | 61 | self.navigationBarHidden = YES; 62 | 63 | self.interactivePopGestureRecognizer.delegate = self; 64 | super.delegate = self; 65 | 66 | self.panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanRecognizer:)]; 67 | 68 | } 69 | 70 | #pragma mark - UINavigationDelegate 71 | 72 | // forbid User VC to be NavigationController's delegate 73 | - (void)setDelegate:(id)delegate { 74 | } 75 | 76 | #pragma mark - Push & Pop 77 | 78 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 79 | { 80 | 81 | 82 | if (!self.isTransiting) { 83 | self.interactivePopGestureRecognizer.enabled = NO; 84 | } 85 | 86 | [self configureNavigationBarForViewController:viewController]; 87 | 88 | [super pushViewController:viewController animated:animated]; 89 | 90 | } 91 | 92 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated { 93 | 94 | if (self.isTransiting) { 95 | self.isTransiting = NO; 96 | return nil; 97 | } 98 | 99 | return [super popViewControllerAnimated:animated]; 100 | 101 | } 102 | 103 | #pragma mark UINavigationControllerDelegate 104 | 105 | - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { 106 | 107 | self.isTransiting = YES; 108 | 109 | } 110 | 111 | - (void)navigationController:(UINavigationController *)navigationController 112 | didShowViewController:(UIViewController *)viewController 113 | animated:(BOOL)animate 114 | { 115 | 116 | self.isTransiting = NO; 117 | 118 | [viewController.view bringSubviewToFront:viewController.sc_navigationBar]; 119 | 120 | if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) { 121 | if (navigationController.viewControllers.count == 1) { 122 | self.interactivePopGestureRecognizer.delegate = nil; 123 | self.delegate = nil; 124 | self.interactivePopGestureRecognizer.enabled = NO; 125 | } else { 126 | self.interactivePopGestureRecognizer.enabled = YES; 127 | } 128 | } 129 | 130 | if (self.enableInnerInactiveGesture) { 131 | BOOL hasPanGesture = NO; 132 | BOOL hasEdgePanGesture = NO; 133 | for (UIGestureRecognizer *recognizer in [viewController.view gestureRecognizers]) { 134 | if ([recognizer isKindOfClass:[UIPanGestureRecognizer class]]) { 135 | if ([recognizer isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) { 136 | hasEdgePanGesture = YES; 137 | } else { 138 | hasPanGesture = YES; 139 | } 140 | } 141 | } 142 | if (!hasPanGesture && (navigationController.viewControllers.count > 1)) { 143 | [viewController.view addGestureRecognizer:self.panRecognizer]; 144 | } 145 | } 146 | 147 | viewController.navigationController.delegate = self; 148 | 149 | } 150 | 151 | 152 | // Animation 153 | - (id)navigationController:(UINavigationController *)navigationController 154 | animationControllerForOperation:(UINavigationControllerOperation)operation 155 | fromViewController:(UIViewController *)fromVC 156 | toViewController:(UIViewController *)toVC { 157 | 158 | if (operation == UINavigationControllerOperationPop && navigationController.viewControllers.count >= 1 && self.enableInnerInactiveGesture) { 159 | return [[SCNavigationPopAnimation alloc] init]; 160 | } else if (operation == UINavigationControllerOperationPush) { 161 | SCNavigationPushAnimation *animation = [[SCNavigationPushAnimation alloc] init]; 162 | return animation; 163 | } else { 164 | return nil; 165 | } 166 | } 167 | 168 | - (id)navigationController:(UINavigationController *)navigationController 169 | interactionControllerForAnimationController:(id)animationController { 170 | if ([animationController isKindOfClass:[SCNavigationPopAnimation class]] && self.enableInnerInactiveGesture) { 171 | return self.interactivePopTransition; 172 | } 173 | else { 174 | return nil; 175 | } 176 | } 177 | 178 | 179 | - (void)handlePanRecognizer:(UIPanGestureRecognizer*)recognizer { 180 | 181 | 182 | static CGFloat startLocationX = 0; 183 | 184 | CGPoint location = [recognizer locationInView:self.view]; 185 | 186 | CGFloat progress = (location.x - startLocationX) / [UIScreen mainScreen].bounds.size.width; 187 | progress = MIN(1.0, MAX(0.0, progress)); 188 | 189 | // NSLog(@"progress: %.2f", progress); 190 | 191 | if (recognizer.state == UIGestureRecognizerStateBegan) { 192 | startLocationX = location.x; 193 | self.interactivePopTransition = [[UIPercentDrivenInteractiveTransition alloc] init]; 194 | [self popViewControllerAnimated:YES]; 195 | } 196 | else if (recognizer.state == UIGestureRecognizerStateChanged) { 197 | 198 | 199 | [self.interactivePopTransition updateInteractiveTransition:progress]; 200 | } 201 | else if (recognizer.state == UIGestureRecognizerStateEnded || recognizer.state == UIGestureRecognizerStateCancelled) { 202 | if (progress > 0.3) { 203 | self.interactivePopTransition.completionSpeed = 0.4; 204 | [self.interactivePopTransition finishInteractiveTransition]; 205 | } 206 | else { 207 | self.interactivePopTransition.completionSpeed = 0.3; 208 | [self.interactivePopTransition cancelInteractiveTransition]; 209 | } 210 | 211 | self.interactivePopTransition = nil; 212 | } 213 | } 214 | 215 | #pragma mark - Private Helper 216 | 217 | - (void)configureNavigationBarForViewController:(UIViewController *)viewController { 218 | 219 | if (!viewController.sc_navigationItem) { 220 | SCNavigationItem *navigationItem = [[SCNavigationItem alloc] init]; 221 | [navigationItem setValue:viewController forKey:@"_sc_viewController"]; 222 | viewController.sc_navigationItem = navigationItem; 223 | } 224 | if (!viewController.sc_navigationBar) { 225 | viewController.sc_navigationBar = [[SCNavigationBar alloc] init]; 226 | [viewController.view addSubview:viewController.sc_navigationBar]; 227 | } 228 | 229 | } 230 | 231 | @end 232 | -------------------------------------------------------------------------------- /SCNavigation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2929701519A38945007B5A02 /* navi_mask@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2929701319A38945007B5A02 /* navi_mask@2x.png */; }; 11 | 2929701619A38945007B5A02 /* navi_shadow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2929701419A38945007B5A02 /* navi_shadow@2x.png */; }; 12 | 29571D2E19A2EC6000675B56 /* SCBarButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D2019A2EC6000675B56 /* SCBarButtonItem.m */; }; 13 | 29571D2F19A2EC6000675B56 /* SCNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D2319A2EC6000675B56 /* SCNavigationController.m */; }; 14 | 29571D3019A2EC6000675B56 /* SCNavigationItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D2519A2EC6000675B56 /* SCNavigationItem.m */; }; 15 | 29571D3119A2EC6000675B56 /* SCNavigationPopAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D2719A2EC6000675B56 /* SCNavigationPopAnimation.m */; }; 16 | 29571D3219A2EC6000675B56 /* SCNavigationPushAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D2919A2EC6000675B56 /* SCNavigationPushAnimation.m */; }; 17 | 29571D3419A2EC6000675B56 /* SCNavigationBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D2D19A2EC6000675B56 /* SCNavigationBar.m */; }; 18 | 29571D3C19A2ED3000675B56 /* ScrollViewFrameAccessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D3919A2ED3000675B56 /* ScrollViewFrameAccessor.m */; }; 19 | 29571D3D19A2ED3000675B56 /* ViewFrameAccessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 29571D3B19A2ED3000675B56 /* ViewFrameAccessor.m */; }; 20 | 29670A05199D9EEE00B4A59B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29670A04199D9EEE00B4A59B /* Foundation.framework */; }; 21 | 29670A07199D9EEE00B4A59B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29670A06199D9EEE00B4A59B /* CoreGraphics.framework */; }; 22 | 29670A09199D9EEE00B4A59B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29670A08199D9EEE00B4A59B /* UIKit.framework */; }; 23 | 29670A0F199D9EEE00B4A59B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 29670A0D199D9EEE00B4A59B /* InfoPlist.strings */; }; 24 | 29670A11199D9EEE00B4A59B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29670A10199D9EEE00B4A59B /* main.m */; }; 25 | 29670A15199D9EEE00B4A59B /* SCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 29670A14199D9EEE00B4A59B /* SCAppDelegate.m */; }; 26 | 29670A1B199D9EEE00B4A59B /* SCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29670A1A199D9EEE00B4A59B /* SCViewController.m */; }; 27 | 29670A1D199D9EEE00B4A59B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29670A1C199D9EEE00B4A59B /* Images.xcassets */; }; 28 | 29670A24199D9EEF00B4A59B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29670A23199D9EEF00B4A59B /* XCTest.framework */; }; 29 | 29670A25199D9EEF00B4A59B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29670A04199D9EEE00B4A59B /* Foundation.framework */; }; 30 | 29670A26199D9EEF00B4A59B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29670A08199D9EEE00B4A59B /* UIKit.framework */; }; 31 | 29670A2E199D9EEF00B4A59B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 29670A2C199D9EEF00B4A59B /* InfoPlist.strings */; }; 32 | 29670A30199D9EEF00B4A59B /* SCNavigationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 29670A2F199D9EEF00B4A59B /* SCNavigationTests.m */; }; 33 | 299114F31B0AD5F700E08BAE /* UIViewController+SCNavigation.m in Sources */ = {isa = PBXBuildFile; fileRef = 299114F21B0AD5F700E08BAE /* UIViewController+SCNavigation.m */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | 29670A27199D9EEF00B4A59B /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 296709F9199D9EEE00B4A59B /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = 29670A00199D9EEE00B4A59B; 42 | remoteInfo = SCNavigation; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 2929701319A38945007B5A02 /* navi_mask@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "navi_mask@2x.png"; sourceTree = ""; }; 48 | 2929701419A38945007B5A02 /* navi_shadow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "navi_shadow@2x.png"; sourceTree = ""; }; 49 | 29571D1F19A2EC6000675B56 /* SCBarButtonItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCBarButtonItem.h; sourceTree = ""; }; 50 | 29571D2019A2EC6000675B56 /* SCBarButtonItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCBarButtonItem.m; sourceTree = ""; }; 51 | 29571D2119A2EC6000675B56 /* SCNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCNavigation.h; sourceTree = ""; }; 52 | 29571D2219A2EC6000675B56 /* SCNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCNavigationController.h; sourceTree = ""; }; 53 | 29571D2319A2EC6000675B56 /* SCNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCNavigationController.m; sourceTree = ""; }; 54 | 29571D2419A2EC6000675B56 /* SCNavigationItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCNavigationItem.h; sourceTree = ""; }; 55 | 29571D2519A2EC6000675B56 /* SCNavigationItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCNavigationItem.m; sourceTree = ""; }; 56 | 29571D2619A2EC6000675B56 /* SCNavigationPopAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCNavigationPopAnimation.h; sourceTree = ""; }; 57 | 29571D2719A2EC6000675B56 /* SCNavigationPopAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCNavigationPopAnimation.m; sourceTree = ""; }; 58 | 29571D2819A2EC6000675B56 /* SCNavigationPushAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCNavigationPushAnimation.h; sourceTree = ""; }; 59 | 29571D2919A2EC6000675B56 /* SCNavigationPushAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCNavigationPushAnimation.m; sourceTree = ""; }; 60 | 29571D2C19A2EC6000675B56 /* SCNavigationBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCNavigationBar.h; sourceTree = ""; }; 61 | 29571D2D19A2EC6000675B56 /* SCNavigationBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCNavigationBar.m; sourceTree = ""; }; 62 | 29571D3719A2ED3000675B56 /* FrameAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameAccessor.h; sourceTree = ""; }; 63 | 29571D3819A2ED3000675B56 /* ScrollViewFrameAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollViewFrameAccessor.h; sourceTree = ""; }; 64 | 29571D3919A2ED3000675B56 /* ScrollViewFrameAccessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScrollViewFrameAccessor.m; sourceTree = ""; }; 65 | 29571D3A19A2ED3000675B56 /* ViewFrameAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewFrameAccessor.h; sourceTree = ""; }; 66 | 29571D3B19A2ED3000675B56 /* ViewFrameAccessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewFrameAccessor.m; sourceTree = ""; }; 67 | 29670A01199D9EEE00B4A59B /* SCNavigation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SCNavigation.app; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 29670A04199D9EEE00B4A59B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 69 | 29670A06199D9EEE00B4A59B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 70 | 29670A08199D9EEE00B4A59B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 71 | 29670A0C199D9EEE00B4A59B /* SCNavigation-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SCNavigation-Info.plist"; sourceTree = ""; }; 72 | 29670A0E199D9EEE00B4A59B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 73 | 29670A10199D9EEE00B4A59B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 74 | 29670A12199D9EEE00B4A59B /* SCNavigation-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SCNavigation-Prefix.pch"; sourceTree = ""; }; 75 | 29670A13199D9EEE00B4A59B /* SCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCAppDelegate.h; sourceTree = ""; }; 76 | 29670A14199D9EEE00B4A59B /* SCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCAppDelegate.m; sourceTree = ""; }; 77 | 29670A19199D9EEE00B4A59B /* SCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SCViewController.h; sourceTree = ""; }; 78 | 29670A1A199D9EEE00B4A59B /* SCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCViewController.m; sourceTree = ""; }; 79 | 29670A1C199D9EEE00B4A59B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 80 | 29670A22199D9EEF00B4A59B /* SCNavigationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCNavigationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 81 | 29670A23199D9EEF00B4A59B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 82 | 29670A2B199D9EEF00B4A59B /* SCNavigationTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SCNavigationTests-Info.plist"; sourceTree = ""; }; 83 | 29670A2D199D9EEF00B4A59B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 84 | 29670A2F199D9EEF00B4A59B /* SCNavigationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCNavigationTests.m; sourceTree = ""; }; 85 | 299114F11B0AD5F700E08BAE /* UIViewController+SCNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+SCNavigation.h"; sourceTree = ""; }; 86 | 299114F21B0AD5F700E08BAE /* UIViewController+SCNavigation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+SCNavigation.m"; sourceTree = ""; }; 87 | /* End PBXFileReference section */ 88 | 89 | /* Begin PBXFrameworksBuildPhase section */ 90 | 296709FE199D9EEE00B4A59B /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | 29670A07199D9EEE00B4A59B /* CoreGraphics.framework in Frameworks */, 95 | 29670A09199D9EEE00B4A59B /* UIKit.framework in Frameworks */, 96 | 29670A05199D9EEE00B4A59B /* Foundation.framework in Frameworks */, 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | 29670A1F199D9EEF00B4A59B /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | 29670A24199D9EEF00B4A59B /* XCTest.framework in Frameworks */, 105 | 29670A26199D9EEF00B4A59B /* UIKit.framework in Frameworks */, 106 | 29670A25199D9EEF00B4A59B /* Foundation.framework in Frameworks */, 107 | ); 108 | runOnlyForDeploymentPostprocessing = 0; 109 | }; 110 | /* End PBXFrameworksBuildPhase section */ 111 | 112 | /* Begin PBXGroup section */ 113 | 2929701219A38945007B5A02 /* Resources */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 2929701319A38945007B5A02 /* navi_mask@2x.png */, 117 | 2929701419A38945007B5A02 /* navi_shadow@2x.png */, 118 | ); 119 | path = Resources; 120 | sourceTree = ""; 121 | }; 122 | 29571D1E19A2EC6000675B56 /* SCNavigation */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 2929701219A38945007B5A02 /* Resources */, 126 | 29571D1F19A2EC6000675B56 /* SCBarButtonItem.h */, 127 | 29571D2019A2EC6000675B56 /* SCBarButtonItem.m */, 128 | 29571D2119A2EC6000675B56 /* SCNavigation.h */, 129 | 29571D2219A2EC6000675B56 /* SCNavigationController.h */, 130 | 29571D2319A2EC6000675B56 /* SCNavigationController.m */, 131 | 29571D2419A2EC6000675B56 /* SCNavigationItem.h */, 132 | 29571D2519A2EC6000675B56 /* SCNavigationItem.m */, 133 | 29571D2619A2EC6000675B56 /* SCNavigationPopAnimation.h */, 134 | 29571D2719A2EC6000675B56 /* SCNavigationPopAnimation.m */, 135 | 29571D2819A2EC6000675B56 /* SCNavigationPushAnimation.h */, 136 | 29571D2919A2EC6000675B56 /* SCNavigationPushAnimation.m */, 137 | 299114F11B0AD5F700E08BAE /* UIViewController+SCNavigation.h */, 138 | 299114F21B0AD5F700E08BAE /* UIViewController+SCNavigation.m */, 139 | 29571D2C19A2EC6000675B56 /* SCNavigationBar.h */, 140 | 29571D2D19A2EC6000675B56 /* SCNavigationBar.m */, 141 | ); 142 | path = SCNavigation; 143 | sourceTree = ""; 144 | }; 145 | 29571D3519A2ED3000675B56 /* Additions */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 29571D3619A2ED3000675B56 /* FrameAccessor */, 149 | ); 150 | path = Additions; 151 | sourceTree = ""; 152 | }; 153 | 29571D3619A2ED3000675B56 /* FrameAccessor */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 29571D3719A2ED3000675B56 /* FrameAccessor.h */, 157 | 29571D3819A2ED3000675B56 /* ScrollViewFrameAccessor.h */, 158 | 29571D3919A2ED3000675B56 /* ScrollViewFrameAccessor.m */, 159 | 29571D3A19A2ED3000675B56 /* ViewFrameAccessor.h */, 160 | 29571D3B19A2ED3000675B56 /* ViewFrameAccessor.m */, 161 | ); 162 | path = FrameAccessor; 163 | sourceTree = ""; 164 | }; 165 | 296709F8199D9EEE00B4A59B = { 166 | isa = PBXGroup; 167 | children = ( 168 | 29670A0A199D9EEE00B4A59B /* SCNavigation */, 169 | 29670A29199D9EEF00B4A59B /* SCNavigationTests */, 170 | 29670A03199D9EEE00B4A59B /* Frameworks */, 171 | 29670A02199D9EEE00B4A59B /* Products */, 172 | ); 173 | sourceTree = ""; 174 | }; 175 | 29670A02199D9EEE00B4A59B /* Products */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 29670A01199D9EEE00B4A59B /* SCNavigation.app */, 179 | 29670A22199D9EEF00B4A59B /* SCNavigationTests.xctest */, 180 | ); 181 | name = Products; 182 | sourceTree = ""; 183 | }; 184 | 29670A03199D9EEE00B4A59B /* Frameworks */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 29670A04199D9EEE00B4A59B /* Foundation.framework */, 188 | 29670A06199D9EEE00B4A59B /* CoreGraphics.framework */, 189 | 29670A08199D9EEE00B4A59B /* UIKit.framework */, 190 | 29670A23199D9EEF00B4A59B /* XCTest.framework */, 191 | ); 192 | name = Frameworks; 193 | sourceTree = ""; 194 | }; 195 | 29670A0A199D9EEE00B4A59B /* SCNavigation */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | 29571D3519A2ED3000675B56 /* Additions */, 199 | 29571D1E19A2EC6000675B56 /* SCNavigation */, 200 | 29670A13199D9EEE00B4A59B /* SCAppDelegate.h */, 201 | 29670A14199D9EEE00B4A59B /* SCAppDelegate.m */, 202 | 29670A19199D9EEE00B4A59B /* SCViewController.h */, 203 | 29670A1A199D9EEE00B4A59B /* SCViewController.m */, 204 | 29670A1C199D9EEE00B4A59B /* Images.xcassets */, 205 | 29670A0B199D9EEE00B4A59B /* Supporting Files */, 206 | ); 207 | path = SCNavigation; 208 | sourceTree = ""; 209 | }; 210 | 29670A0B199D9EEE00B4A59B /* Supporting Files */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | 29670A0C199D9EEE00B4A59B /* SCNavigation-Info.plist */, 214 | 29670A0D199D9EEE00B4A59B /* InfoPlist.strings */, 215 | 29670A10199D9EEE00B4A59B /* main.m */, 216 | 29670A12199D9EEE00B4A59B /* SCNavigation-Prefix.pch */, 217 | ); 218 | name = "Supporting Files"; 219 | sourceTree = ""; 220 | }; 221 | 29670A29199D9EEF00B4A59B /* SCNavigationTests */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | 29670A2F199D9EEF00B4A59B /* SCNavigationTests.m */, 225 | 29670A2A199D9EEF00B4A59B /* Supporting Files */, 226 | ); 227 | path = SCNavigationTests; 228 | sourceTree = ""; 229 | }; 230 | 29670A2A199D9EEF00B4A59B /* Supporting Files */ = { 231 | isa = PBXGroup; 232 | children = ( 233 | 29670A2B199D9EEF00B4A59B /* SCNavigationTests-Info.plist */, 234 | 29670A2C199D9EEF00B4A59B /* InfoPlist.strings */, 235 | ); 236 | name = "Supporting Files"; 237 | sourceTree = ""; 238 | }; 239 | /* End PBXGroup section */ 240 | 241 | /* Begin PBXNativeTarget section */ 242 | 29670A00199D9EEE00B4A59B /* SCNavigation */ = { 243 | isa = PBXNativeTarget; 244 | buildConfigurationList = 29670A33199D9EEF00B4A59B /* Build configuration list for PBXNativeTarget "SCNavigation" */; 245 | buildPhases = ( 246 | 296709FD199D9EEE00B4A59B /* Sources */, 247 | 296709FE199D9EEE00B4A59B /* Frameworks */, 248 | 296709FF199D9EEE00B4A59B /* Resources */, 249 | ); 250 | buildRules = ( 251 | ); 252 | dependencies = ( 253 | ); 254 | name = SCNavigation; 255 | productName = SCNavigation; 256 | productReference = 29670A01199D9EEE00B4A59B /* SCNavigation.app */; 257 | productType = "com.apple.product-type.application"; 258 | }; 259 | 29670A21199D9EEF00B4A59B /* SCNavigationTests */ = { 260 | isa = PBXNativeTarget; 261 | buildConfigurationList = 29670A36199D9EEF00B4A59B /* Build configuration list for PBXNativeTarget "SCNavigationTests" */; 262 | buildPhases = ( 263 | 29670A1E199D9EEF00B4A59B /* Sources */, 264 | 29670A1F199D9EEF00B4A59B /* Frameworks */, 265 | 29670A20199D9EEF00B4A59B /* Resources */, 266 | ); 267 | buildRules = ( 268 | ); 269 | dependencies = ( 270 | 29670A28199D9EEF00B4A59B /* PBXTargetDependency */, 271 | ); 272 | name = SCNavigationTests; 273 | productName = SCNavigationTests; 274 | productReference = 29670A22199D9EEF00B4A59B /* SCNavigationTests.xctest */; 275 | productType = "com.apple.product-type.bundle.unit-test"; 276 | }; 277 | /* End PBXNativeTarget section */ 278 | 279 | /* Begin PBXProject section */ 280 | 296709F9199D9EEE00B4A59B /* Project object */ = { 281 | isa = PBXProject; 282 | attributes = { 283 | CLASSPREFIX = SC; 284 | LastUpgradeCheck = 0510; 285 | ORGANIZATIONNAME = Singro; 286 | TargetAttributes = { 287 | 29670A21199D9EEF00B4A59B = { 288 | TestTargetID = 29670A00199D9EEE00B4A59B; 289 | }; 290 | }; 291 | }; 292 | buildConfigurationList = 296709FC199D9EEE00B4A59B /* Build configuration list for PBXProject "SCNavigation" */; 293 | compatibilityVersion = "Xcode 3.2"; 294 | developmentRegion = English; 295 | hasScannedForEncodings = 0; 296 | knownRegions = ( 297 | en, 298 | Base, 299 | ); 300 | mainGroup = 296709F8199D9EEE00B4A59B; 301 | productRefGroup = 29670A02199D9EEE00B4A59B /* Products */; 302 | projectDirPath = ""; 303 | projectRoot = ""; 304 | targets = ( 305 | 29670A00199D9EEE00B4A59B /* SCNavigation */, 306 | 29670A21199D9EEF00B4A59B /* SCNavigationTests */, 307 | ); 308 | }; 309 | /* End PBXProject section */ 310 | 311 | /* Begin PBXResourcesBuildPhase section */ 312 | 296709FF199D9EEE00B4A59B /* Resources */ = { 313 | isa = PBXResourcesBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | 29670A1D199D9EEE00B4A59B /* Images.xcassets in Resources */, 317 | 2929701519A38945007B5A02 /* navi_mask@2x.png in Resources */, 318 | 2929701619A38945007B5A02 /* navi_shadow@2x.png in Resources */, 319 | 29670A0F199D9EEE00B4A59B /* InfoPlist.strings in Resources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | 29670A20199D9EEF00B4A59B /* Resources */ = { 324 | isa = PBXResourcesBuildPhase; 325 | buildActionMask = 2147483647; 326 | files = ( 327 | 29670A2E199D9EEF00B4A59B /* InfoPlist.strings in Resources */, 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | }; 331 | /* End PBXResourcesBuildPhase section */ 332 | 333 | /* Begin PBXSourcesBuildPhase section */ 334 | 296709FD199D9EEE00B4A59B /* Sources */ = { 335 | isa = PBXSourcesBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | 29571D3019A2EC6000675B56 /* SCNavigationItem.m in Sources */, 339 | 29571D3119A2EC6000675B56 /* SCNavigationPopAnimation.m in Sources */, 340 | 29571D3C19A2ED3000675B56 /* ScrollViewFrameAccessor.m in Sources */, 341 | 29571D2F19A2EC6000675B56 /* SCNavigationController.m in Sources */, 342 | 299114F31B0AD5F700E08BAE /* UIViewController+SCNavigation.m in Sources */, 343 | 29670A15199D9EEE00B4A59B /* SCAppDelegate.m in Sources */, 344 | 29571D3219A2EC6000675B56 /* SCNavigationPushAnimation.m in Sources */, 345 | 29571D3419A2EC6000675B56 /* SCNavigationBar.m in Sources */, 346 | 29670A1B199D9EEE00B4A59B /* SCViewController.m in Sources */, 347 | 29571D2E19A2EC6000675B56 /* SCBarButtonItem.m in Sources */, 348 | 29670A11199D9EEE00B4A59B /* main.m in Sources */, 349 | 29571D3D19A2ED3000675B56 /* ViewFrameAccessor.m in Sources */, 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | 29670A1E199D9EEF00B4A59B /* Sources */ = { 354 | isa = PBXSourcesBuildPhase; 355 | buildActionMask = 2147483647; 356 | files = ( 357 | 29670A30199D9EEF00B4A59B /* SCNavigationTests.m in Sources */, 358 | ); 359 | runOnlyForDeploymentPostprocessing = 0; 360 | }; 361 | /* End PBXSourcesBuildPhase section */ 362 | 363 | /* Begin PBXTargetDependency section */ 364 | 29670A28199D9EEF00B4A59B /* PBXTargetDependency */ = { 365 | isa = PBXTargetDependency; 366 | target = 29670A00199D9EEE00B4A59B /* SCNavigation */; 367 | targetProxy = 29670A27199D9EEF00B4A59B /* PBXContainerItemProxy */; 368 | }; 369 | /* End PBXTargetDependency section */ 370 | 371 | /* Begin PBXVariantGroup section */ 372 | 29670A0D199D9EEE00B4A59B /* InfoPlist.strings */ = { 373 | isa = PBXVariantGroup; 374 | children = ( 375 | 29670A0E199D9EEE00B4A59B /* en */, 376 | ); 377 | name = InfoPlist.strings; 378 | sourceTree = ""; 379 | }; 380 | 29670A2C199D9EEF00B4A59B /* InfoPlist.strings */ = { 381 | isa = PBXVariantGroup; 382 | children = ( 383 | 29670A2D199D9EEF00B4A59B /* en */, 384 | ); 385 | name = InfoPlist.strings; 386 | sourceTree = ""; 387 | }; 388 | /* End PBXVariantGroup section */ 389 | 390 | /* Begin XCBuildConfiguration section */ 391 | 29670A31199D9EEF00B4A59B /* Debug */ = { 392 | isa = XCBuildConfiguration; 393 | buildSettings = { 394 | ALWAYS_SEARCH_USER_PATHS = NO; 395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 396 | CLANG_CXX_LIBRARY = "libc++"; 397 | CLANG_ENABLE_MODULES = YES; 398 | CLANG_ENABLE_OBJC_ARC = YES; 399 | CLANG_WARN_BOOL_CONVERSION = YES; 400 | CLANG_WARN_CONSTANT_CONVERSION = YES; 401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 402 | CLANG_WARN_EMPTY_BODY = YES; 403 | CLANG_WARN_ENUM_CONVERSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 406 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 407 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 408 | COPY_PHASE_STRIP = NO; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_DYNAMIC_NO_PIC = NO; 411 | GCC_OPTIMIZATION_LEVEL = 0; 412 | GCC_PREPROCESSOR_DEFINITIONS = ( 413 | "DEBUG=1", 414 | "$(inherited)", 415 | ); 416 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 417 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 418 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 419 | GCC_WARN_UNDECLARED_SELECTOR = YES; 420 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 421 | GCC_WARN_UNUSED_FUNCTION = YES; 422 | GCC_WARN_UNUSED_VARIABLE = YES; 423 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 424 | ONLY_ACTIVE_ARCH = YES; 425 | SDKROOT = iphoneos; 426 | }; 427 | name = Debug; 428 | }; 429 | 29670A32199D9EEF00B4A59B /* Release */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ALWAYS_SEARCH_USER_PATHS = NO; 433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 434 | CLANG_CXX_LIBRARY = "libc++"; 435 | CLANG_ENABLE_MODULES = YES; 436 | CLANG_ENABLE_OBJC_ARC = YES; 437 | CLANG_WARN_BOOL_CONVERSION = YES; 438 | CLANG_WARN_CONSTANT_CONVERSION = YES; 439 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 440 | CLANG_WARN_EMPTY_BODY = YES; 441 | CLANG_WARN_ENUM_CONVERSION = YES; 442 | CLANG_WARN_INT_CONVERSION = YES; 443 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 444 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 445 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 446 | COPY_PHASE_STRIP = YES; 447 | ENABLE_NS_ASSERTIONS = NO; 448 | GCC_C_LANGUAGE_STANDARD = gnu99; 449 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 450 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 451 | GCC_WARN_UNDECLARED_SELECTOR = YES; 452 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 453 | GCC_WARN_UNUSED_FUNCTION = YES; 454 | GCC_WARN_UNUSED_VARIABLE = YES; 455 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 456 | SDKROOT = iphoneos; 457 | VALIDATE_PRODUCT = YES; 458 | }; 459 | name = Release; 460 | }; 461 | 29670A34199D9EEF00B4A59B /* Debug */ = { 462 | isa = XCBuildConfiguration; 463 | buildSettings = { 464 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 465 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 466 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 467 | GCC_PREFIX_HEADER = "SCNavigation/SCNavigation-Prefix.pch"; 468 | INFOPLIST_FILE = "SCNavigation/SCNavigation-Info.plist"; 469 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 470 | PRODUCT_NAME = "$(TARGET_NAME)"; 471 | WRAPPER_EXTENSION = app; 472 | }; 473 | name = Debug; 474 | }; 475 | 29670A35199D9EEF00B4A59B /* Release */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 479 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 480 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 481 | GCC_PREFIX_HEADER = "SCNavigation/SCNavigation-Prefix.pch"; 482 | INFOPLIST_FILE = "SCNavigation/SCNavigation-Info.plist"; 483 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 484 | PRODUCT_NAME = "$(TARGET_NAME)"; 485 | WRAPPER_EXTENSION = app; 486 | }; 487 | name = Release; 488 | }; 489 | 29670A37199D9EEF00B4A59B /* Debug */ = { 490 | isa = XCBuildConfiguration; 491 | buildSettings = { 492 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SCNavigation.app/SCNavigation"; 493 | FRAMEWORK_SEARCH_PATHS = ( 494 | "$(SDKROOT)/Developer/Library/Frameworks", 495 | "$(inherited)", 496 | "$(DEVELOPER_FRAMEWORKS_DIR)", 497 | ); 498 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 499 | GCC_PREFIX_HEADER = "SCNavigation/SCNavigation-Prefix.pch"; 500 | GCC_PREPROCESSOR_DEFINITIONS = ( 501 | "DEBUG=1", 502 | "$(inherited)", 503 | ); 504 | INFOPLIST_FILE = "SCNavigationTests/SCNavigationTests-Info.plist"; 505 | PRODUCT_NAME = "$(TARGET_NAME)"; 506 | TEST_HOST = "$(BUNDLE_LOADER)"; 507 | WRAPPER_EXTENSION = xctest; 508 | }; 509 | name = Debug; 510 | }; 511 | 29670A38199D9EEF00B4A59B /* Release */ = { 512 | isa = XCBuildConfiguration; 513 | buildSettings = { 514 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/SCNavigation.app/SCNavigation"; 515 | FRAMEWORK_SEARCH_PATHS = ( 516 | "$(SDKROOT)/Developer/Library/Frameworks", 517 | "$(inherited)", 518 | "$(DEVELOPER_FRAMEWORKS_DIR)", 519 | ); 520 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 521 | GCC_PREFIX_HEADER = "SCNavigation/SCNavigation-Prefix.pch"; 522 | INFOPLIST_FILE = "SCNavigationTests/SCNavigationTests-Info.plist"; 523 | PRODUCT_NAME = "$(TARGET_NAME)"; 524 | TEST_HOST = "$(BUNDLE_LOADER)"; 525 | WRAPPER_EXTENSION = xctest; 526 | }; 527 | name = Release; 528 | }; 529 | /* End XCBuildConfiguration section */ 530 | 531 | /* Begin XCConfigurationList section */ 532 | 296709FC199D9EEE00B4A59B /* Build configuration list for PBXProject "SCNavigation" */ = { 533 | isa = XCConfigurationList; 534 | buildConfigurations = ( 535 | 29670A31199D9EEF00B4A59B /* Debug */, 536 | 29670A32199D9EEF00B4A59B /* Release */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | defaultConfigurationName = Release; 540 | }; 541 | 29670A33199D9EEF00B4A59B /* Build configuration list for PBXNativeTarget "SCNavigation" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | 29670A34199D9EEF00B4A59B /* Debug */, 545 | 29670A35199D9EEF00B4A59B /* Release */, 546 | ); 547 | defaultConfigurationIsVisible = 0; 548 | defaultConfigurationName = Release; 549 | }; 550 | 29670A36199D9EEF00B4A59B /* Build configuration list for PBXNativeTarget "SCNavigationTests" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 29670A37199D9EEF00B4A59B /* Debug */, 554 | 29670A38199D9EEF00B4A59B /* Release */, 555 | ); 556 | defaultConfigurationIsVisible = 0; 557 | defaultConfigurationName = Release; 558 | }; 559 | /* End XCConfigurationList section */ 560 | }; 561 | rootObject = 296709F9199D9EEE00B4A59B /* Project object */; 562 | } 563 | --------------------------------------------------------------------------------