├── .DS_Store ├── .gitignore ├── LICENSE ├── LargeNavTitleDemo ├── .DS_Store ├── LargeNavTitleDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── LargeNavTitleDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── LargeNavTitleDemo │ ├── .DS_Store │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ └── Contents.json │ │ ├── back.imageset │ │ │ ├── Contents.json │ │ │ ├── 返回@2x.png │ │ │ └── 返回@3x.png │ │ ├── collection.imageset │ │ │ ├── Contents.json │ │ │ ├── 已收藏@2x.png │ │ │ └── 已收藏@3x.png │ │ ├── index_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── 首页-默认@2x.png │ │ │ └── 首页-默认@3x.png │ │ ├── index_select.imageset │ │ │ ├── Contents.json │ │ │ ├── 首页-选中@2x.png │ │ │ └── 首页-选中@3x.png │ │ ├── my_normal.imageset │ │ │ ├── Contents.json │ │ │ ├── 我的-默认@2x.png │ │ │ └── 我的-默认@3x.png │ │ └── my_select.imageset │ │ │ ├── Contents.json │ │ │ ├── 我的-选中@2x.png │ │ │ └── 我的-选中@3x.png │ ├── Base │ │ ├── .DS_Store │ │ ├── BaseClass │ │ │ └── TABDefine.h │ │ ├── Controller │ │ │ ├── .DS_Store │ │ │ ├── BaseNavigationController.h │ │ │ ├── BaseNavigationController.m │ │ │ ├── BaseTabbarController.h │ │ │ ├── BaseTabbarController.m │ │ │ ├── BaseViewController.h │ │ │ └── BaseViewController.m │ │ └── View │ │ │ ├── ButtonView.h │ │ │ ├── ButtonView.m │ │ │ ├── CustomNavigationBar.h │ │ │ ├── CustomNavigationBar.m │ │ │ ├── CustomTabBar.h │ │ │ └── CustomTabBar.m │ ├── CategoryUtil │ │ ├── TABSafe.h │ │ ├── TABSafe.m │ │ ├── UIView+Frame.h │ │ └── UIView+Frame.m │ ├── Code │ │ ├── .DS_Store │ │ ├── Index │ │ │ ├── .DS_Store │ │ │ ├── Model │ │ │ │ ├── Game.h │ │ │ │ └── Game.m │ │ │ ├── TestViewController.h │ │ │ ├── TestViewController.m │ │ │ └── View │ │ │ │ ├── TestTableViewCell.h │ │ │ │ └── TestTableViewCell.m │ │ └── My │ │ │ ├── MyViewController.h │ │ │ └── MyViewController.m │ ├── Info.plist │ ├── LargeNavTitle │ │ ├── LargeTitleBaseViewController.h │ │ ├── LargeTitleBaseViewController.m │ │ ├── TouchModel.h │ │ └── TouchModel.m │ ├── Source │ │ ├── head.jpg │ │ └── test.jpg │ ├── TABAnimated │ │ ├── .DS_Store │ │ ├── TABAnimated.h │ │ ├── TABMethod.h │ │ ├── TABMethod.m │ │ ├── TABViewAnimated.h │ │ ├── TABViewAnimated.m │ │ ├── UICollectionView+Animated.h │ │ ├── UICollectionView+Animated.m │ │ ├── UICollectionViewCell+Animated.h │ │ ├── UICollectionViewCell+Animated.m │ │ ├── UITableView+Animated.h │ │ ├── UITableView+Animated.m │ │ ├── UITableViewCell+Animated.h │ │ ├── UITableViewCell+Animated.m │ │ ├── UIView+Animated.h │ │ ├── UIView+Animated.m │ │ ├── UIView+TABLayerout.h │ │ └── UIView+TABLayerout.m │ └── main.m ├── LargeNavTitleDemoTests │ ├── Info.plist │ └── LargeNavTitleDemoTests.m ├── LargeNavTitleDemoUITests │ ├── Info.plist │ └── LargeNavTitleDemoUITests.m ├── Podfile ├── Podfile.lock └── Pods │ ├── Headers │ ├── Private │ │ └── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ └── ViewController+MASAdditions.h │ └── Public │ │ └── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraintMaker.h │ │ ├── MASLayoutConstraint.h │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewConstraint.h │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── View+MASAdditions.h │ │ ├── View+MASShorthandAdditions.h │ │ └── ViewController+MASAdditions.h │ ├── Manifest.lock │ ├── Masonry │ ├── LICENSE │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASCompositeConstraint.m │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraint.m │ │ ├── MASConstraintMaker.h │ │ ├── MASConstraintMaker.m │ │ ├── MASLayoutConstraint.h │ │ ├── MASLayoutConstraint.m │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewAttribute.m │ │ ├── MASViewConstraint.h │ │ ├── MASViewConstraint.m │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASAdditions.m │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ ├── View+MASAdditions.h │ │ ├── View+MASAdditions.m │ │ ├── View+MASShorthandAdditions.h │ │ ├── ViewController+MASAdditions.h │ │ └── ViewController+MASAdditions.m │ └── README.md │ ├── Pods.xcodeproj │ └── project.pbxproj │ └── Target Support Files │ ├── Masonry │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ └── Masonry.xcconfig │ └── Pods-LargeNavTitleDemo │ ├── Pods-LargeNavTitleDemo-acknowledgements.markdown │ ├── Pods-LargeNavTitleDemo-acknowledgements.plist │ ├── Pods-LargeNavTitleDemo-dummy.m │ ├── Pods-LargeNavTitleDemo-frameworks.sh │ ├── Pods-LargeNavTitleDemo-resources.sh │ ├── Pods-LargeNavTitleDemo.debug.xcconfig │ └── Pods-LargeNavTitleDemo.release.xcconfig └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 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 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/.DS_Store -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/.DS_Store -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LargeNavTitleDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/26. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LargeNavTitleDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/26. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "TestViewController.h" 12 | #import "MyViewController.h" 13 | #import "BaseTabbarController.h" 14 | 15 | #import "TABDefine.h" 16 | 17 | #define titleArray @[@"首页",@"我的"] 18 | #define normalImageArray @[@"index_normal",@"my_normal"] 19 | #define selectImageArray @[@"index_select",@"my_select"] 20 | 21 | @interface AppDelegate () { 22 | NSMutableArray *controllerArray; // 控制器 23 | } 24 | 25 | @end 26 | 27 | @implementation AppDelegate 28 | 29 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 30 | // Override point for customization after application launch. 31 | 32 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 33 | self.window.backgroundColor = [UIColor whiteColor]; 34 | [self.window makeKeyAndVisible]; 35 | 36 | BaseTabbarController *tab = [[BaseTabbarController alloc] 37 | initWithTabbarControllerArray:self.controllerArray 38 | TitleArray:titleArray 39 | NormalImageArray:normalImageArray 40 | SelectImageArray:selectImageArray 41 | DefaultColor:[UIColor grayColor] 42 | SelectColor:kNavigationColor 43 | TitleFont:kFont(11) 44 | NavBackColor:kNavigationColor 45 | NavTitleColor:[UIColor blackColor] 46 | NavTitleFont:kFont(16)]; 47 | 48 | self.window.rootViewController = tab; 49 | return YES; 50 | } 51 | 52 | - (NSMutableArray *)controllerArray { 53 | if (!controllerArray) { 54 | controllerArray = [NSMutableArray array]; 55 | 56 | TestViewController *index = [[TestViewController alloc]init]; 57 | MyViewController *my = [[MyViewController alloc]init]; 58 | [controllerArray addObject:index]; 59 | [controllerArray addObject:my]; 60 | } 61 | return controllerArray; 62 | } 63 | 64 | - (void)applicationWillResignActive:(UIApplication *)application { 65 | // 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. 66 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 67 | } 68 | 69 | 70 | - (void)applicationDidEnterBackground:(UIApplication *)application { 71 | // 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. 72 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 73 | } 74 | 75 | 76 | - (void)applicationWillEnterForeground:(UIApplication *)application { 77 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 78 | } 79 | 80 | 81 | - (void)applicationDidBecomeActive:(UIApplication *)application { 82 | // 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. 83 | } 84 | 85 | - (void)applicationWillTerminate:(UIApplication *)application { 86 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "12.0", 8 | "subtype" : "2688h", 9 | "scale" : "3x" 10 | }, 11 | { 12 | "orientation" : "landscape", 13 | "idiom" : "iphone", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "12.0", 16 | "subtype" : "2688h", 17 | "scale" : "3x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "iphone", 22 | "extent" : "full-screen", 23 | "minimum-system-version" : "12.0", 24 | "subtype" : "1792h", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "orientation" : "landscape", 29 | "idiom" : "iphone", 30 | "extent" : "full-screen", 31 | "minimum-system-version" : "12.0", 32 | "subtype" : "1792h", 33 | "scale" : "2x" 34 | }, 35 | { 36 | "orientation" : "portrait", 37 | "idiom" : "iphone", 38 | "extent" : "full-screen", 39 | "minimum-system-version" : "11.0", 40 | "subtype" : "2436h", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "orientation" : "landscape", 45 | "idiom" : "iphone", 46 | "extent" : "full-screen", 47 | "minimum-system-version" : "11.0", 48 | "subtype" : "2436h", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "orientation" : "portrait", 53 | "idiom" : "iphone", 54 | "extent" : "full-screen", 55 | "minimum-system-version" : "8.0", 56 | "subtype" : "736h", 57 | "scale" : "3x" 58 | }, 59 | { 60 | "orientation" : "landscape", 61 | "idiom" : "iphone", 62 | "extent" : "full-screen", 63 | "minimum-system-version" : "8.0", 64 | "subtype" : "736h", 65 | "scale" : "3x" 66 | }, 67 | { 68 | "orientation" : "portrait", 69 | "idiom" : "iphone", 70 | "extent" : "full-screen", 71 | "minimum-system-version" : "8.0", 72 | "subtype" : "667h", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "orientation" : "portrait", 77 | "idiom" : "iphone", 78 | "extent" : "full-screen", 79 | "minimum-system-version" : "7.0", 80 | "scale" : "2x" 81 | }, 82 | { 83 | "orientation" : "portrait", 84 | "idiom" : "iphone", 85 | "extent" : "full-screen", 86 | "minimum-system-version" : "7.0", 87 | "subtype" : "retina4", 88 | "scale" : "2x" 89 | }, 90 | { 91 | "orientation" : "portrait", 92 | "idiom" : "ipad", 93 | "extent" : "full-screen", 94 | "minimum-system-version" : "7.0", 95 | "scale" : "1x" 96 | }, 97 | { 98 | "orientation" : "landscape", 99 | "idiom" : "ipad", 100 | "extent" : "full-screen", 101 | "minimum-system-version" : "7.0", 102 | "scale" : "1x" 103 | }, 104 | { 105 | "orientation" : "portrait", 106 | "idiom" : "ipad", 107 | "extent" : "full-screen", 108 | "minimum-system-version" : "7.0", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "orientation" : "landscape", 113 | "idiom" : "ipad", 114 | "extent" : "full-screen", 115 | "minimum-system-version" : "7.0", 116 | "scale" : "2x" 117 | }, 118 | { 119 | "orientation" : "portrait", 120 | "idiom" : "iphone", 121 | "extent" : "full-screen", 122 | "scale" : "1x" 123 | }, 124 | { 125 | "orientation" : "portrait", 126 | "idiom" : "iphone", 127 | "extent" : "full-screen", 128 | "scale" : "2x" 129 | }, 130 | { 131 | "orientation" : "portrait", 132 | "idiom" : "iphone", 133 | "extent" : "full-screen", 134 | "subtype" : "retina4", 135 | "scale" : "2x" 136 | }, 137 | { 138 | "orientation" : "portrait", 139 | "idiom" : "ipad", 140 | "extent" : "to-status-bar", 141 | "scale" : "1x" 142 | }, 143 | { 144 | "orientation" : "portrait", 145 | "idiom" : "ipad", 146 | "extent" : "full-screen", 147 | "scale" : "1x" 148 | }, 149 | { 150 | "orientation" : "landscape", 151 | "idiom" : "ipad", 152 | "extent" : "to-status-bar", 153 | "scale" : "1x" 154 | }, 155 | { 156 | "orientation" : "landscape", 157 | "idiom" : "ipad", 158 | "extent" : "full-screen", 159 | "scale" : "1x" 160 | }, 161 | { 162 | "orientation" : "portrait", 163 | "idiom" : "ipad", 164 | "extent" : "to-status-bar", 165 | "scale" : "2x" 166 | }, 167 | { 168 | "orientation" : "portrait", 169 | "idiom" : "ipad", 170 | "extent" : "full-screen", 171 | "scale" : "2x" 172 | }, 173 | { 174 | "orientation" : "landscape", 175 | "idiom" : "ipad", 176 | "extent" : "to-status-bar", 177 | "scale" : "2x" 178 | }, 179 | { 180 | "orientation" : "landscape", 181 | "idiom" : "ipad", 182 | "extent" : "full-screen", 183 | "scale" : "2x" 184 | } 185 | ], 186 | "info" : { 187 | "version" : 1, 188 | "author" : "xcode" 189 | } 190 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/back.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "返回@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "返回@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/back.imageset/返回@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/back.imageset/返回@2x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/back.imageset/返回@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/back.imageset/返回@3x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/collection.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "已收藏@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "已收藏@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/collection.imageset/已收藏@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/collection.imageset/已收藏@2x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/collection.imageset/已收藏@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/collection.imageset/已收藏@3x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "首页-默认@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "首页-默认@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_normal.imageset/首页-默认@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_normal.imageset/首页-默认@2x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_normal.imageset/首页-默认@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_normal.imageset/首页-默认@3x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "首页-选中@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "首页-选中@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_select.imageset/首页-选中@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_select.imageset/首页-选中@2x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_select.imageset/首页-选中@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/index_select.imageset/首页-选中@3x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "我的-默认@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "我的-默认@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_normal.imageset/我的-默认@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_normal.imageset/我的-默认@2x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_normal.imageset/我的-默认@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_normal.imageset/我的-默认@3x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "我的-选中@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "我的-选中@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_select.imageset/我的-选中@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_select.imageset/我的-选中@2x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_select.imageset/我的-选中@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Assets.xcassets/my_select.imageset/我的-选中@3x.png -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Base/.DS_Store -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/BaseClass/TABDefine.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABDefine.h 3 | // TABBaseProject 4 | // 5 | // Created by tigerAndBull on 2018/10/26. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABDefine_h 10 | #define TABDefine_h 11 | 12 | #define kAPPDELEGATE ((AppDelegate *)[UIApplication sharedApplication].delegate) 13 | 14 | #define kScreenWidth [UIScreen mainScreen].bounds.size.width 15 | #define kScreenHeight [UIScreen mainScreen].bounds.size.height 16 | 17 | // use to iPad 18 | #define isIPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 19 | // use to iphone 5,5s,6,7,8 20 | #define isIPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 21 | // use to iphone 6P,7P,8P 22 | #define isIPhonePlus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242,2208), [[UIScreen mainScreen] currentMode].size) : NO) 23 | // use to iphoneX,XR,XS,XS Max 24 | #define isIPhoneFill ([UIScreen mainScreen].bounds.size.height == 812) || ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !isIPad : NO) || ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !isIPad : NO) || ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !isIPad : NO) 25 | 26 | #define kFont(x) [UIFont systemFontOfSize:((isIPhonePlus)?(x + 1):((isIPhoneFill)?(x + 2):x))] 27 | #define kBlodFont(x) [UIFont boldSystemFontOfSize:((isIPhonePlus)?(x + 1):((isIPhoneFill)?(x + 2):x))] 28 | 29 | #define kColor(c) [UIColor colorWithRed:((c>>24)&0xFF)/255.0 green:((c>>16)&0xFF)/255.0 blue:((c>>8)&0xFF)/255.0 alpha:((c)&0xFF)/255.0] 30 | #define kBackColor kColor(0xEEEEEEFF) 31 | #define kNavigationColor ([UIColor colorWithRed:139/255.0 green:221/255.0 blue:94/255.0 alpha:1]) 32 | 33 | #define BLOCK_EXEC(block, ...) if (block) { block(__VA_ARGS__); }; 34 | 35 | #endif /* TABDefine_h */ 36 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/.DS_Store -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/BaseNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JC_BaseNavigationController.h 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @class BaseViewController; 11 | 12 | typedef void(^NavBackAction)(void); 13 | 14 | @interface BaseNavigationController : UINavigationController 15 | 16 | @property (nonatomic, copy) NavBackAction backAction; 17 | 18 | 19 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController 20 | NavBackColor:(UIColor *)backColor 21 | NavTitleColor:(UIColor *)titleColor 22 | NavTitleFont:(UIFont *)titleFont; 23 | 24 | - (void)pushViewController:(BaseViewController *)viewController animated:(BOOL)animated hideTabbar:(BOOL)hide; 25 | 26 | #pragma mark - 屏幕旋转 27 | 28 | @property (nonatomic) BOOL supportPortraitOnly; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/BaseNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseNavigationController.m 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import "BaseNavigationController.h" 9 | #import "BaseViewController.h" 10 | #import "BaseTabbarController.h" 11 | 12 | @interface BaseNavigationController () 13 | 14 | @end 15 | 16 | @implementation BaseNavigationController 17 | 18 | 19 | - (void)viewWillAppear:(BOOL)animated { 20 | [super viewWillAppear:animated]; 21 | } 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | // Do any additional setup after loading the view. 26 | 27 | } 28 | 29 | - (void)didReceiveMemoryWarning { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | - (void)pushViewController:(BaseViewController *)viewController animated:(BOOL)animated hideTabbar:(BOOL)hide { 35 | viewController.hideTabbar = hide; 36 | viewController.hidesBottomBarWhenPushed = hide; 37 | viewController.backButtonEnable = YES; 38 | [self pushViewController:viewController animated:animated]; 39 | } 40 | 41 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { 42 | [super pushViewController:viewController animated:animated]; 43 | } 44 | 45 | - (UIViewController *)popViewControllerAnimated:(BOOL)animated { 46 | return [super popViewControllerAnimated:animated]; 47 | } 48 | 49 | #pragma mark - 屏幕旋转 50 | 51 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { 52 | if (self.supportPortraitOnly) { 53 | return UIInterfaceOrientationMaskPortrait; 54 | } else { 55 | return [self.topViewController supportedInterfaceOrientations]; 56 | } 57 | } 58 | 59 | - (BOOL)shouldAutorotate { 60 | if (self.supportPortraitOnly) { 61 | return NO; 62 | } else { 63 | return [self.topViewController shouldAutorotate]; 64 | } 65 | } 66 | 67 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 68 | if (self.supportPortraitOnly) { 69 | return UIInterfaceOrientationPortrait == toInterfaceOrientation; 70 | } else { 71 | return [self.topViewController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; 72 | } 73 | } 74 | 75 | - (UIViewController *)childViewControllerForStatusBarStyle { 76 | return self.topViewController; 77 | } 78 | 79 | - (UIViewController *)childViewControllerForStatusBarHidden { 80 | return self.topViewController; 81 | } 82 | 83 | #pragma mark - Initize Method 84 | 85 | - (instancetype)initWithRootViewController:(UIViewController *)rootViewController 86 | NavBackColor:(UIColor *)navBackColor 87 | NavTitleColor:(UIColor *)navTitleColor 88 | NavTitleFont:(UIFont *)navTitleFont { 89 | 90 | self = [super initWithRootViewController:rootViewController]; 91 | 92 | if (self) { 93 | 94 | self.navigationBar.tintColor = navBackColor; 95 | self.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:navTitleColor, NSForegroundColorAttributeName, navTitleFont, NSFontAttributeName, nil]; 96 | self.navigationBar.translucent = NO; 97 | self.interactivePopGestureRecognizer.delegate = (id)self; 98 | } 99 | return self; 100 | } 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/BaseTabbarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTabbarController.h 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | #import "CustomTabBar.h" 11 | #import "BaseViewController.h" 12 | 13 | @interface BaseTabbarController : UITabBarController 14 | 15 | @property (nonatomic, strong) CustomTabBar *customBar; 16 | 17 | - (instancetype)initWithTabbarControllerArray:(NSArray *)controllerArray 18 | TitleArray:(NSArray *)titleArray 19 | NormalImageArray:(NSArray *)normalImageArray 20 | SelectImageArray:(NSArray *)selectImageArray 21 | DefaultColor:(UIColor *)defaultColor 22 | SelectColor:(UIColor *)selectColor 23 | TitleFont:(UIFont *)titleFont 24 | NavBackColor:(UIColor *)navBackColor 25 | NavTitleColor:(UIColor *)navTitleColor 26 | NavTitleFont:(UIFont *)navTitleFont; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/BaseTabbarController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTabbarController.m 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import "BaseTabbarController.h" 9 | #import "BaseNavigationController.h" 10 | 11 | #import "TABDefine.h" 12 | 13 | @interface BaseTabbarController () 14 | 15 | @end 16 | 17 | @implementation BaseTabbarController 18 | 19 | #pragma mark - LifeCycle 20 | 21 | - (void)viewWillAppear:(BOOL)animated { 22 | [super viewWillAppear:animated]; 23 | [self.tabBar bringSubviewToFront:self.customBar]; 24 | } 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | // Do any additional setup after loading the view. 29 | 30 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hideTabbarNotification:) name:@"hideTabbarNotification" object:nil]; 31 | 32 | self.selectedIndex = 0; 33 | 34 | self.tabBar.translucent = NO; 35 | [self.tabBar addSubview:self.customBar]; 36 | self.customBar.frame = self.tabBar.bounds; 37 | 38 | CGRect rect = self.customBar.frame; 39 | rect.origin.x -= 20; 40 | rect.size.width += 40; 41 | self.customBar.frame = rect; 42 | } 43 | 44 | - (void)didReceiveMemoryWarning { 45 | [super didReceiveMemoryWarning]; 46 | // Dispose of any resources that can be recreated. 47 | } 48 | 49 | - (void)addChildViewController:(BaseViewController *)vc 50 | title:(NSString *)title 51 | imageName:(NSString *)imageName 52 | selectedImageName:(NSString *)selectedImageName 53 | NavBackColor:(UIColor *)navBackColor 54 | NavTitleColor:(UIColor *)navTitleColor 55 | NavTitleFont:(UIFont *)navTitleFont { 56 | 57 | BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:vc NavBackColor:navBackColor NavTitleColor:navTitleColor NavTitleFont:navTitleFont]; 58 | // nav.dele 59 | vc.title = title; 60 | 61 | NSMutableArray *titles = self.customBar.titles ? self.customBar.titles.mutableCopy : @[].mutableCopy; 62 | NSMutableArray *images = self.customBar.images ? self.customBar.images.mutableCopy : @[].mutableCopy; 63 | NSMutableArray *selectedImages = self.customBar.seletedImages ? self.customBar.seletedImages.mutableCopy : @[].mutableCopy; 64 | [titles addObject:title]; 65 | [images addObject:imageName]; 66 | [selectedImages addObject:selectedImageName]; 67 | 68 | self.customBar.titles = titles; 69 | self.customBar.images = images; 70 | self.customBar.seletedImages = selectedImages; 71 | [self.customBar updateBar]; 72 | 73 | [self addChildViewController:nav]; 74 | } 75 | 76 | #pragma mark - Notification Method 77 | 78 | - (void)hideTabbarNotification:(NSNotification *)notification { 79 | 80 | } 81 | 82 | #pragma mark - CustomTabBarDelegate 83 | 84 | - (void)didSelectIndex:(NSInteger)index { 85 | self.selectedIndex = index; 86 | } 87 | 88 | #pragma mark - 屏幕旋转 89 | 90 | // 是否自动旋转,返回YES可以自动旋转 91 | - (BOOL)shouldAutorotate { 92 | return [self.selectedViewController shouldAutorotate]; 93 | } 94 | 95 | // 返回支持的方向 96 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { 97 | return [self.selectedViewController supportedInterfaceOrientations]; 98 | } 99 | 100 | // 这个是返回优先方向 101 | - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { 102 | return [self.selectedViewController preferredInterfaceOrientationForPresentation]; 103 | } 104 | 105 | - (UIViewController *)childViewControllerForStatusBarStyle { 106 | return self.selectedViewController; 107 | } 108 | 109 | - (UIViewController *)childViewControllerForStatusBarHidden { 110 | return self.selectedViewController; 111 | } 112 | 113 | #pragma mark - Initize Method 114 | 115 | - (instancetype)initWithTabbarControllerArray:(NSArray *)controllerArray 116 | TitleArray:(NSArray *)titleArray 117 | NormalImageArray:(NSArray *)normalImageArray 118 | SelectImageArray:(NSArray *)selectImageArray 119 | DefaultColor:(UIColor *)defaultColor 120 | SelectColor:(UIColor *)selectColor 121 | TitleFont:(UIFont *)titleFont 122 | NavBackColor:(UIColor *)navBackColor 123 | NavTitleColor:(UIColor *)navTitleColor 124 | NavTitleFont:(UIFont *)navTitleFont { 125 | 126 | self = [super init]; 127 | 128 | if (self) { 129 | 130 | self.customBar.defaultColor = defaultColor; 131 | self.customBar.selectedColor = selectColor; 132 | self.customBar.titleFont = titleFont; 133 | 134 | for (int i = 0; i < controllerArray.count; i++) { 135 | BaseViewController *vc = controllerArray[i]; 136 | NSString *title = titleArray[i]; 137 | NSString *normalImg = normalImageArray[i]; 138 | NSString *selectImg = selectImageArray[i]; 139 | [self addChildViewController:vc title:title imageName:normalImg selectedImageName:selectImg NavBackColor:navBackColor NavTitleColor:navTitleColor NavTitleFont:navTitleFont]; 140 | } 141 | } 142 | return self; 143 | } 144 | 145 | #pragma mark - Lazy Method 146 | 147 | - (CustomTabBar *)customBar { 148 | if (!_customBar) { 149 | _customBar = [[CustomTabBar alloc] init]; 150 | _customBar.imageTitleSpace = 3.f; 151 | _customBar.delegate = self; 152 | _customBar.backgroundColor = [UIColor whiteColor]; 153 | } 154 | return _customBar; 155 | } 156 | 157 | @end 158 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/BaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABBaseViewController.h 3 | // TABBaseProject 4 | // 5 | // Created by tigerAndBull on 2018/10/5. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseNavigationController.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | typedef void(^BackBlock)(void); 16 | 17 | @interface BaseViewController : UIViewController 18 | 19 | /** 是否隐藏tab栏 */ 20 | @property (nonatomic, assign) BOOL hideTabbar; 21 | @property (nonatomic, copy) BackBlock backAction; 22 | @property (nonatomic, strong) UIButton *backButton; 23 | 24 | /** 是否出现公共的返回按钮 */ 25 | @property (nonatomic, assign) BOOL backButtonEnable; 26 | 27 | /** 是否隐藏导航栏 */ 28 | @property (nonatomic, assign) BOOL hideNavigationBar; 29 | @property (nonatomic, strong) BaseNavigationController *navController; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/Controller/BaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABBaseViewController.m 3 | // TABBaseProject 4 | // 5 | // Created by tigerAndBull on 2018/10/5. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "BaseViewController.h" 10 | 11 | #import "TABDefine.h" 12 | 13 | @interface BaseViewController () 14 | 15 | @end 16 | 17 | @implementation BaseViewController 18 | 19 | #pragma mark - LifeCycle 20 | 21 | - (void)loadView { 22 | 23 | CGFloat statusHeight = self.hideNavigationBar ? 0 : self.statusHeight; 24 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - statusHeight - self.navigationBarHeight - self.tabbarHeight)]; 25 | self.view = view; 26 | } 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | // Do any additional setup after loading the view. 31 | [self addNotification]; 32 | [self initUI]; 33 | } 34 | 35 | - (void)viewWillAppear:(BOOL)animated { 36 | [super viewWillAppear:animated]; 37 | 38 | [[NSNotificationCenter defaultCenter] postNotificationName:@"hideTabbarNotification" object:nil userInfo:@{@"hideTabbar":@(self.hideTabbar)}]; 39 | 40 | if (self.backButtonEnable) { 41 | if (self.hideNavigationBar) { 42 | [self.view addSubview:self.backButton]; 43 | } else { 44 | self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backButton]; 45 | } 46 | } 47 | self.navigationController.navigationBarHidden = self.hideNavigationBar; 48 | self.tabBarController.tabBar.hidden = self.hideTabbar; 49 | } 50 | 51 | - (void)viewDidDisappear:(BOOL)animated { 52 | [super viewDidDisappear:animated]; 53 | } 54 | 55 | - (void)viewDidAppear:(BOOL)animated { 56 | [super viewDidAppear:animated]; 57 | } 58 | 59 | - (void)dealloc { 60 | 61 | } 62 | 63 | - (void)didReceiveMemoryWarning { 64 | [super didReceiveMemoryWarning]; 65 | // Dispose of any resources that can be recreated. 66 | } 67 | 68 | #pragma mark - Target Methods 69 | 70 | - (void)clickBackButtonAction:(UIButton *)button { 71 | 72 | if (self.navigationController.viewControllers.count > 1) { 73 | if (self.backAction) { 74 | BLOCK_EXEC(self.backAction); 75 | } 76 | [self.navController popViewControllerAnimated:YES]; 77 | } else { 78 | [self.navController dismissViewControllerAnimated:YES completion:^{ 79 | if (self.backAction) { 80 | BLOCK_EXEC(self.backAction); 81 | } 82 | }]; 83 | } 84 | } 85 | 86 | #pragma mark - Private Methods 87 | 88 | - (BaseNavigationController *)navController { 89 | return (BaseNavigationController *)self.navigationController; 90 | } 91 | 92 | #pragma mark - Initize Methods 93 | 94 | /** 95 | add notificaiton 96 | 添加通知 97 | */ 98 | - (void)addNotification { 99 | 100 | } 101 | 102 | /** 103 | initialize view 104 | 初始化视图 105 | */ 106 | - (void)initUI { 107 | 108 | } 109 | 110 | #pragma mark - Lazy Methods 111 | 112 | - (UIButton *)backButton { 113 | if (!_backButton) { 114 | _backButton = [UIButton buttonWithType:(UIButtonTypeCustom)]; 115 | _backButton.frame = CGRectMake(isIPad?30:20, self.statusHeight+8, 30, 30); 116 | [_backButton setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateNormal)]; 117 | [_backButton setImage:[UIImage imageNamed:@"back"] forState:(UIControlStateHighlighted)]; 118 | [_backButton addTarget:self action:@selector(clickBackButtonAction:) forControlEvents:(UIControlEventTouchUpInside)]; 119 | } 120 | return _backButton; 121 | } 122 | 123 | - (CGFloat)statusHeight { 124 | 125 | // 这里不用[UIApplication sharedApplication].statusBarFrame 因为播放页面隐藏状态栏 返回首页后此方法将获得值为0 126 | if (isIPhoneFill) { 127 | return 44; 128 | } 129 | return 20; 130 | } 131 | 132 | - (CGFloat)navigationBarHeight { 133 | self.navigationController.navigationBar.hidden = self.hideNavigationBar; 134 | if (self.hideNavigationBar) { 135 | return 0.f; 136 | } 137 | return self.navigationController.navigationBar.frame.size.height; 138 | } 139 | 140 | - (CGFloat)tabbarHeight { 141 | if (self.hideTabbar) { 142 | return 0.f; 143 | } 144 | return isIPhoneFill ? 83 : 49; 145 | } 146 | 147 | - (void)setHideNavigationBar:(BOOL)hideNavigationBar { 148 | _hideNavigationBar = hideNavigationBar; 149 | self.navigationController.navigationBar.hidden = hideNavigationBar; 150 | } 151 | 152 | @end 153 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/View/ButtonView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ButtonView.h 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | typedef enum : NSInteger { 11 | UnknowType = -1, 12 | NormalTypeTitlesOnly, 13 | NormalTypeImagesOnly, 14 | NormalTypeImageTitles, 15 | ChangeTypeTitlesOnly, 16 | ChangeTypeImagesOnly, 17 | ChangeTypeImageTitles, 18 | } ContentType; 19 | 20 | @protocol ButtonViewDelegate 21 | 22 | - (void)didSelectButton:(UIButton *)button atIndex:(NSInteger)index title:(NSString *)title; 23 | 24 | @end 25 | 26 | @interface ButtonView : UIView 27 | 28 | @property (nonatomic, assign) ContentType type; 29 | /** 图片 */ 30 | @property (nonatomic, strong) NSArray *images; 31 | /** 标题 */ 32 | @property (nonatomic, strong) NSArray *titles; 33 | @property (nonatomic, weak) id delegate; 34 | @property (nonatomic, strong) NSArray *seletedImages; 35 | /** 默认字体颜色 */ 36 | @property (nonatomic, strong) UIColor *defaultColor; 37 | /** 选中字体颜色 */ 38 | @property (nonatomic, strong) UIColor *selectedColor; 39 | /** 是否显示下划线 默认NO */ 40 | @property (nonatomic, assign, getter=canShowPageLine) BOOL showPageLine; 41 | /** 文字的字体 */ 42 | @property (nonatomic, strong) UIFont *titleFont; 43 | /** 标题和图片间隙 */ 44 | @property (nonatomic, assign) CGFloat spacing; 45 | /** 判断是否需要状态变化 */ 46 | @property (nonatomic, assign) BOOL stateChangeSwitch; 47 | /** 当前选中的下标 */ 48 | @property (nonatomic, assign) NSInteger currentIndex; 49 | /** 是否对于选中的按钮不可再次点击 默认yes */ 50 | @property (nonatomic, assign) BOOL lockEnable; 51 | /** 按钮的大小 默认 44*44 */ 52 | @property (nonatomic, assign) CGSize buttonSize; 53 | @property (nonatomic, strong) UIColor *lineColor; 54 | /** 存放按钮的数组 */ 55 | @property (nonatomic, strong) NSMutableArray *buttonArray; 56 | 57 | - (instancetype)initWithType:(ContentType)type; 58 | 59 | /** 仅显示图片+文字的buttonView 没有状态变化 */ 60 | - (instancetype)initWithFrame:(CGRect)frame 61 | Images:(NSArray *)images 62 | titles:(NSArray *)titles 63 | delegate:(id)delegate; 64 | /** 重新布局 */ 65 | - (void)reloadView; 66 | 67 | /** 自定义tabbar样式 状态跟随点击变化 */ 68 | - (instancetype)initWithFrame:(CGRect)frame 69 | Images:(NSArray *)images 70 | selectedImages:(NSArray *)selectedImages 71 | titles:(NSArray *)titles 72 | defaultColor:(UIColor *)defaultColor 73 | selectedColor:(UIColor *)selectedColor 74 | delegate:(id)delegate; 75 | 76 | #pragma mark - 新增功能 选中放大 77 | 78 | // 选中颜色变化开关 开启此开关后纯文字形式才能切换选中色彩 79 | @property (nonatomic, assign) BOOL colorChangeEnable; 80 | // 选中状态变化开关 81 | @property (nonatomic, assign) BOOL sizeChangeEnable; 82 | // 缩放系数 建议0.5~2 只有sizeChangeEnable开关打开时候生效 83 | @property (nonatomic, assign) CGFloat scale; 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/View/CustomNavigationBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomNavigationBar.h 3 | // 4 | // Created by tigerAndBull on 2018/9/3. 5 | // Copyright © 2018年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @protocol CustomNavigationBarDelegate 11 | 12 | @optional 13 | 14 | - (void)customNavigationBarBackAction; 15 | 16 | @end 17 | 18 | @interface CustomNavigationBar : UIView 19 | 20 | /** searchBar */ 21 | @property (nonatomic, strong) UISearchBar *customSearchBar; 22 | 23 | @property (nonatomic, assign) id delegate; 24 | 25 | - (instancetype)initWithFrame:(CGRect)frame 26 | showBackButton:(BOOL)show 27 | delegate:(id)delegate; 28 | 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/View/CustomNavigationBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomNavigationBar.m 3 | // 4 | // Created by tigerAndBull on 2018/9/3. 5 | // Copyright © 2018年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import "CustomNavigationBar.h" 9 | 10 | #import "TABDefine.h" 11 | 12 | #import "Masonry.h" 13 | 14 | @interface CustomNavigationBar () 15 | 16 | @property (nonatomic, assign) BOOL showBackButton; 17 | @property (nonatomic, strong) UIButton *backButton; 18 | @property (nonatomic, strong) UIView *statusView; 19 | @property (nonatomic, strong) UIView *navigationView; 20 | @property (nonatomic, strong) UIView *sepView; 21 | 22 | @end 23 | 24 | @implementation CustomNavigationBar 25 | 26 | - (void)layoutSubviews { 27 | [super layoutSubviews]; 28 | 29 | [self.statusView mas_remakeConstraints:^(MASConstraintMaker *make) { 30 | make.left.right.top.mas_equalTo(self); 31 | 32 | CGFloat statusHeight; 33 | if (isIPhoneFill) { 34 | statusHeight = 44; 35 | }else { 36 | statusHeight = 20; 37 | } 38 | make.height.mas_equalTo(statusHeight); 39 | // 由于present了一个隐藏statusBar的vc,此方法可能得到一个空值。 40 | // make.height.mas_equalTo([UIApplication sharedApplication].statusBarFrame.size.height); 41 | }]; 42 | 43 | [self.navigationView mas_remakeConstraints:^(MASConstraintMaker *make) { 44 | make.left.right.bottom.mas_equalTo(self); 45 | make.top.mas_equalTo(self.statusView.mas_bottom); 46 | }]; 47 | 48 | if (self.showBackButton) { 49 | 50 | [self.backButton mas_remakeConstraints:^(MASConstraintMaker *make) { 51 | make.width.height.mas_equalTo(44); 52 | make.centerY.mas_equalTo(self.navigationView); 53 | make.left.mas_equalTo(0); 54 | }]; 55 | 56 | [self.customSearchBar mas_remakeConstraints:^(MASConstraintMaker *make) { 57 | make.centerY.mas_equalTo(self.backButton); 58 | make.left.mas_equalTo(self.backButton.mas_right).offset(0); 59 | make.right.mas_equalTo(self).offset(-10); 60 | }]; 61 | } else { 62 | 63 | [self.customSearchBar mas_remakeConstraints:^(MASConstraintMaker *make) { 64 | make.centerY.mas_equalTo(self.navigationView); 65 | make.left.mas_equalTo(self).offset(30); 66 | make.right.mas_equalTo(self).offset(-30); 67 | }]; 68 | } 69 | 70 | [self.sepView mas_remakeConstraints:^(MASConstraintMaker *make) { 71 | make.left.right.bottom.mas_equalTo(self); 72 | make.height.mas_equalTo(0.5); 73 | }]; 74 | } 75 | 76 | #pragma mark - Class Method 77 | 78 | + (CGSize)selfSize { 79 | CGFloat statuHeight = [UIApplication sharedApplication].statusBarFrame.size.height; 80 | CGFloat navigationHeight = 44; 81 | return CGSizeMake(kScreenWidth, statuHeight + navigationHeight); 82 | } 83 | 84 | #pragma mark - Target 85 | 86 | - (void)backAction:(UIButton *)button { 87 | if ([self.delegate respondsToSelector:@selector(customNavigationBarBackAction)]) { 88 | [self.delegate customNavigationBarBackAction]; 89 | } 90 | } 91 | 92 | #pragma mark - Initize Method 93 | 94 | - (instancetype)initWithFrame:(CGRect)frame 95 | showBackButton:(BOOL)show 96 | delegate:(id)delegate { 97 | 98 | CGSize size = [CustomNavigationBar selfSize]; 99 | 100 | self = [super initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, size.width, size.height)]; 101 | 102 | if (self) { 103 | 104 | self.showBackButton = show; 105 | self.delegate = delegate; 106 | 107 | [self addSubview:self.statusView]; 108 | [self addSubview:self.navigationView]; 109 | [self addSubview:self.sepView]; 110 | 111 | if (show) { 112 | [self.navigationView addSubview:self.backButton]; 113 | } 114 | [self.navigationView addSubview:self.customSearchBar]; 115 | } 116 | return self; 117 | } 118 | 119 | #pragma mark - Lazy Method 120 | 121 | // 代替状态栏位置的视图 122 | - (UIView *)statusView { 123 | if (!_statusView) { 124 | _statusView = [[UIView alloc] init]; 125 | _statusView.backgroundColor = [UIColor clearColor]; 126 | } 127 | return _statusView; 128 | } 129 | 130 | // 导航栏显示区域 131 | - (UIView *)navigationView { 132 | if (!_navigationView) { 133 | _navigationView = [[UIView alloc] init]; 134 | _navigationView.backgroundColor = [UIColor clearColor]; 135 | } 136 | return _navigationView; 137 | } 138 | 139 | - (UISearchBar *)customSearchBar { 140 | if (!_customSearchBar) { 141 | _customSearchBar = [[UISearchBar alloc] init]; 142 | _customSearchBar.barTintColor = [UIColor clearColor]; 143 | _customSearchBar.backgroundImage = [[UIImage alloc] init]; 144 | } 145 | return _customSearchBar; 146 | } 147 | 148 | - (UIView *)sepView { 149 | if (!_sepView) { 150 | _sepView = [[UIView alloc] init]; 151 | _sepView.backgroundColor = kColor(0xF0F0F0FF); 152 | } 153 | return _sepView; 154 | } 155 | 156 | - (UIButton *)backButton { 157 | if (!_backButton) { 158 | _backButton = [UIButton buttonWithType:UIButtonTypeCustom]; 159 | UIImage *image = [UIImage imageNamed:@"back"]; 160 | [_backButton setImage:image forState:UIControlStateNormal]; 161 | [_backButton setImage:image forState:(UIControlStateHighlighted)]; 162 | [_backButton addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside]; 163 | } 164 | return _backButton; 165 | } 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/View/CustomTabBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomTabBar.h 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @protocol CustomTabBarDelegate 11 | 12 | - (void)didSelectIndex:(NSInteger)index; 13 | 14 | @end 15 | 16 | @interface CustomTabBar : UIView 17 | 18 | /** 图片 */ 19 | @property (nonatomic, strong) NSArray *images; 20 | /** 标题 */ 21 | @property (nonatomic, strong) NSArray *titles; 22 | /** 选中图片 */ 23 | @property (nonatomic, strong) NSArray *seletedImages; 24 | /** 默认字体颜色 */ 25 | @property (nonatomic, strong) UIColor *defaultColor; 26 | /** 选中字体颜色 */ 27 | @property (nonatomic, strong) UIColor *selectedColor; 28 | @property (nonatomic, strong) UIView *centerView; 29 | /** 执行选中事件的代理对象 */ 30 | @property (nonatomic, weak) id delegate; 31 | @property (nonatomic, assign) CGFloat imageTitleSpace; 32 | // 字体 33 | @property (nonatomic, strong) UIFont *titleFont; 34 | 35 | - (void)updateBar; 36 | 37 | /** 以图片为主 */ 38 | - (instancetype)initWithImages:(NSArray *)images 39 | selectedImage:(NSArray *)selectedImages 40 | titles:(NSArray *)titles 41 | selectedColor:(UIColor *)selectedColor 42 | delegate:(id)delegate; 43 | + (CGSize)barSize; 44 | 45 | - (void)setSelectedIndex:(NSInteger)index; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Base/View/CustomTabBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomTabBar.m 3 | // 4 | // Created by tigerAndBull on 2018/10/27. 5 | // Copyright © 2018年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import "CustomTabBar.h" 9 | #import "ButtonView.h" 10 | 11 | #import "TABDefine.h" 12 | 13 | #import "Masonry.h" 14 | 15 | @interface CustomTabBar () 16 | 17 | @property (nonatomic, strong) ButtonView *buttonView; 18 | 19 | @end 20 | 21 | @implementation CustomTabBar 22 | 23 | #pragma mark - Super Method 24 | 25 | - (void)layoutSubviews { 26 | [super layoutSubviews]; 27 | 28 | [self.buttonView mas_makeConstraints:^(MASConstraintMaker *make) { 29 | make.top.left.right.mas_equalTo(self); 30 | make.height.mas_equalTo(49); 31 | }]; 32 | } 33 | 34 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 35 | if (CGRectContainsPoint(self.centerView.frame, point) && !self.isHidden) { 36 | return self.centerView; 37 | } 38 | return [super hitTest:point withEvent:event]; 39 | } 40 | 41 | #pragma mark - Public Method 42 | 43 | - (void)updateBar { 44 | [self.buttonView reloadView]; 45 | } 46 | 47 | #pragma mark - Private Method 48 | 49 | - (void)didSelectButton:(UIButton *)button atIndex:(NSInteger)index title:(NSString *)title { 50 | [self.delegate didSelectIndex:index]; 51 | } 52 | 53 | #pragma mark - Class Method 54 | 55 | + (CGSize)barSize { 56 | CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; 57 | CGFloat height = 49; 58 | if (isIPhoneFill) { 59 | height = 49 + 34; 60 | } 61 | return CGSizeMake(screenWidth, height); 62 | } 63 | 64 | #pragma mark - Initize Method 65 | 66 | - (instancetype)initWithImages:(NSArray *)images 67 | selectedImage:(NSArray *)selectedImages 68 | titles:(NSArray *)titles 69 | selectedColor:(UIColor *)selectedColor 70 | delegate:(id)delegate { 71 | 72 | CGSize size = [CustomTabBar barSize]; 73 | 74 | self = [super initWithFrame:CGRectMake(0, 0, size.width, size.height)]; 75 | 76 | if (self) { 77 | CGRect frame = CGRectMake(0, 0, size.width, 49); 78 | self.buttonView = [[ButtonView alloc] initWithFrame:frame Images:images selectedImages:selectedImages titles:titles defaultColor:[UIColor lightGrayColor] selectedColor:selectedColor delegate:self]; 79 | [self addSubview:self.buttonView]; 80 | } 81 | return self; 82 | } 83 | 84 | - (instancetype)init { 85 | self = [super init]; 86 | if (self) { 87 | self.buttonView = [[ButtonView alloc] init]; 88 | self.buttonView.delegate = self; 89 | [self addSubview:self.buttonView]; 90 | } 91 | return self; 92 | } 93 | 94 | #pragma mark - Getter & Setter 95 | 96 | - (void)setImageTitleSpace:(CGFloat)imageTitleSpace { 97 | _imageTitleSpace = imageTitleSpace; 98 | self.buttonView.spacing = imageTitleSpace; 99 | } 100 | 101 | - (void)setSeletedImages:(NSArray *)seletedImages { 102 | _seletedImages = seletedImages; 103 | self.buttonView.seletedImages = seletedImages; 104 | } 105 | 106 | - (void)setImages:(NSArray *)images { 107 | _images = images; 108 | self.buttonView.images = images; 109 | } 110 | 111 | - (void)setTitles:(NSArray *)titles { 112 | _titles = titles; 113 | self.buttonView.titles = titles; 114 | } 115 | 116 | - (void)setCenterView:(UIView *)centerView { 117 | _centerView = centerView; 118 | } 119 | 120 | - (void)setDefaultColor:(UIColor *)defaultColor { 121 | _defaultColor = defaultColor; 122 | self.buttonView.defaultColor = defaultColor; 123 | } 124 | 125 | - (void)setSelectedColor:(UIColor *)selectedColor { 126 | _selectedColor = selectedColor; 127 | self.buttonView.selectedColor = selectedColor; 128 | } 129 | 130 | - (void)setSelectedIndex:(NSInteger)index { 131 | self.buttonView.currentIndex = index; 132 | } 133 | 134 | - (void)setTitleFont:(UIFont *)titleFont { 135 | self.buttonView.titleFont = titleFont; 136 | [self updateBar]; 137 | } 138 | @end 139 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/CategoryUtil/TABSafe.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+TABSafe.h 3 | // TABBaseProject 4 | // 5 | // Created by tigerAndBull on 2018/10/4. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSString (TABSafe) 14 | 15 | /** 16 | 验证NSString是否为空 17 | 18 | @return YES or NO 19 | */ 20 | - (BOOL)tab_isValue; 21 | 22 | @end 23 | 24 | @interface NSData (TABSafe) 25 | 26 | /** 27 | 验证NSData是否为空 28 | 29 | @return YES or NO 30 | */ 31 | - (BOOL)tab_isValue; 32 | 33 | @end 34 | 35 | @interface NSObject (TABSafe) 36 | 37 | /** 38 | 验证NSString是否为空 39 | 40 | @return YES or NO 41 | */ 42 | - (BOOL)tab_isValue; 43 | 44 | @end 45 | 46 | @interface NSArray (TABSafe) 47 | 48 | /** 49 | 验证NSArray是否为空 50 | 51 | @return YES or NO 52 | */ 53 | - (BOOL)tab_isValue; 54 | 55 | /** 56 | 获取数组中指定索引对应的对象 57 | @param index 索引值 58 | @return 对象 59 | */ 60 | - (id)tab_safeObjectAtIndex:(NSUInteger)index; 61 | 62 | @end 63 | 64 | @interface NSMutableArray (TABSafe) 65 | 66 | /** 67 | 添加对象 68 | @param object object对象 69 | */ 70 | - (void)tab_addObject:(id)object; 71 | 72 | /** 73 | 添加一个对象到指定位置 74 | @param object 对象 75 | @param index 索引位置 76 | */ 77 | - (void)tab_insertObject:(id)object atIndex:(NSUInteger)index; 78 | 79 | @end 80 | 81 | @interface NSDictionary (TABSafe) 82 | /** 83 | 验证NSDictionary是否为空 84 | 85 | @return YES or NO 86 | */ 87 | - (BOOL)tab_isValue; 88 | 89 | /** 90 | 根据key获取int值 91 | 92 | @param key key值 93 | @return int值 94 | */ 95 | - (int)tab_safeIntForKey:(NSString *)key; 96 | 97 | /** 98 | 根据key获取BOOL值 99 | 100 | @param key key值 101 | @return bool值 102 | */ 103 | - (BOOL)tab_safeBoolForKey:(NSString *)key; 104 | 105 | /** 106 | 根据key获取float值 107 | 108 | @param key key值 109 | @return float值 110 | */ 111 | - (float)tab_safeFloatForKey:(NSString *)key; 112 | 113 | /** 114 | 根据key获取double值 115 | 116 | @param key key值 117 | @return double值 118 | */ 119 | - (double)tab_safeDoubleForKey:(NSString *)key; 120 | 121 | /** 122 | 根据key值获取long long值 123 | 124 | @param key key值 125 | @return long long值 126 | */ 127 | - (long long)tab_safeLongLongForKey:(NSString *)key; 128 | 129 | /** 130 | 根据key获取NSString对象 131 | 132 | @param key key值 133 | @return NSString对象 134 | */ 135 | - (NSString *)tab_safeStringForKey:(NSString *)key; 136 | 137 | /** 138 | 根据key获取NSDictionary对象 139 | 140 | @param key key值 141 | @return NSDictionary对象 142 | */ 143 | - (NSDictionary *)tab_safeDictionaryForKey:(NSString *)key; 144 | 145 | /** 146 | 根据key获取NSArray对象 147 | 148 | @param key key值 149 | @return NSArray对象 150 | */ 151 | - (NSArray *)tab_safeArrayForKey:(NSString *)key; 152 | 153 | /** 154 | 根据key获取Object对象 155 | 156 | @param key key值 157 | @return Object对象 158 | */ 159 | - (id)tab_safeObjectForKey:(NSString *)key; 160 | 161 | @end 162 | 163 | @interface NSMutableDictionary(TABSafe) 164 | 165 | /** 166 | 根据key设置Object对象 167 | 168 | @param object Object对象 169 | @param key key值 170 | */ 171 | - (void)tab_setObject:(id)object Key:(NSString *)key; 172 | 173 | @end 174 | 175 | @interface NSNumber (TABSafe) 176 | 177 | /** 178 | 验证NSNumber是否为空 179 | 180 | @return YES or NO 181 | */ 182 | - (BOOL)tab_isValue; 183 | 184 | @end 185 | 186 | NS_ASSUME_NONNULL_END 187 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/CategoryUtil/TABSafe.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+TABSafe.m 3 | // TABBaseProject 4 | // 5 | // Created by tigerAndBull on 2018/10/4. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABSafe.h" 10 | 11 | @implementation NSString (TABSafe) 12 | 13 | - (BOOL)tab_isValue { 14 | 15 | if (self != nil && ![self isKindOfClass:[NSNull class]] && self.length > 0) { 16 | return YES; 17 | }else { 18 | return NO; 19 | } 20 | } 21 | 22 | @end 23 | 24 | @implementation NSData (TABSafe) 25 | 26 | - (BOOL)tab_isValue { 27 | 28 | if (self != nil && ![self isKindOfClass:[NSNull class]]) { 29 | return YES; 30 | } 31 | return NO; 32 | } 33 | 34 | @end 35 | 36 | @implementation NSObject (TABSafe) 37 | 38 | - (BOOL)tab_isValue { 39 | 40 | if (self != nil && ![self isKindOfClass:[NSNull class]]) { 41 | return YES; 42 | } 43 | return NO; 44 | } 45 | 46 | @end 47 | 48 | @implementation NSArray (TABSafe) 49 | 50 | - (BOOL)tab_isValue { 51 | 52 | if (self != nil && ![self isKindOfClass:[NSNull class]] && self.count > 0) { 53 | return YES; 54 | } 55 | return NO; 56 | } 57 | 58 | - (id)tab_safeObjectAtIndex:(NSUInteger)index { 59 | 60 | if ([self tab_isValue] && index < self.count) { 61 | id value = [self objectAtIndex:index]; 62 | return value; 63 | } 64 | return nil; 65 | } 66 | 67 | @end 68 | 69 | @implementation NSMutableArray (TABSafe) 70 | 71 | - (void)tab_addObject:(id)object { 72 | 73 | if ([object tab_isValue]) { 74 | [self addObject:object]; 75 | } 76 | } 77 | 78 | - (void)tab_insertObject:(id)object atIndex:(NSUInteger)index { 79 | 80 | if ([object tab_isValue] && index <= self.count) { 81 | [self insertObject:object atIndex:index]; 82 | } 83 | } 84 | 85 | @end 86 | 87 | @implementation NSDictionary (TABSafe) 88 | 89 | - (BOOL)tab_isValue { 90 | 91 | if (self != nil && ![self isKindOfClass:[NSNull class]]) { 92 | return YES; 93 | } 94 | return NO; 95 | } 96 | 97 | - (int)tab_safeIntForKey:(NSString *)key { 98 | 99 | if ([self tab_isValue] && [key tab_isValue]) { 100 | 101 | id value = [self objectForKey:key]; 102 | 103 | if ([value tab_isValue]) { 104 | return [value intValue]; 105 | } 106 | } 107 | return 0; 108 | } 109 | 110 | - (BOOL)tab_safeBoolForKey:(NSString *)key { 111 | 112 | if ([self tab_isValue] && [key tab_isValue]) { 113 | 114 | id value = [self objectForKey:key]; 115 | 116 | if ([value tab_isValue]) { 117 | return [value boolValue]; 118 | } 119 | } 120 | return NO; 121 | } 122 | 123 | - (float)tab_safeFloatForKey:(NSString *)key { 124 | 125 | if ([self tab_isValue] && [key tab_isValue]) { 126 | 127 | id value = [self objectForKey:key]; 128 | 129 | if ([value tab_isValue]) { 130 | return [value floatValue]; 131 | } 132 | } 133 | return 0.0f; 134 | } 135 | 136 | - (double)tab_safeDoubleForKey:(NSString *)key { 137 | 138 | if ([self tab_isValue] && [key tab_isValue]) { 139 | 140 | id value = [self objectForKey:key]; 141 | 142 | if ([value tab_isValue]) { 143 | return [value doubleValue]; 144 | } 145 | } 146 | return 0.0f; 147 | } 148 | 149 | - (long long)tab_safeLongLongForKey:(NSString *)key { 150 | 151 | if ([self tab_isValue] && [key tab_isValue]) { 152 | 153 | id value = [self objectForKey:key]; 154 | 155 | if ([value tab_isValue]) { 156 | return [value longLongValue]; 157 | } 158 | } 159 | return 0.0f; 160 | } 161 | 162 | - (NSString *)tab_safeStringForKey:(NSString *)key { 163 | 164 | if ([self tab_isValue] && [key tab_isValue]) { 165 | 166 | id value = [self objectForKey:key]; 167 | 168 | if ([value isKindOfClass:[NSString class]] && [value tab_isValue]) { 169 | return [NSString stringWithFormat:@"%@",value]; 170 | } 171 | } 172 | return @""; 173 | } 174 | 175 | - (NSDictionary *)tab_safeDictionaryForKey:(NSString *)key { 176 | 177 | if ([self tab_isValue] && [key tab_isValue]) { 178 | 179 | id value = [self objectForKey:key]; 180 | 181 | if ([value isKindOfClass:[NSDictionary class]] && [value tab_isValue]) { 182 | return value; 183 | } 184 | } 185 | return nil; 186 | } 187 | 188 | - (NSArray *)tab_safeArrayForKey:(NSString *)key { 189 | 190 | if ([self tab_isValue] && [key tab_isValue]) { 191 | 192 | id value = [self objectForKey:key]; 193 | 194 | if ([value isKindOfClass:[NSArray class]] && [value tab_isValue]) { 195 | return value; 196 | } 197 | } 198 | return nil; 199 | } 200 | 201 | - (id)tab_safeObjectForKey:(NSString *)key { 202 | 203 | if ([self tab_isValue] && [key tab_isValue]) { 204 | 205 | id value = [self objectForKey:key]; 206 | 207 | if ([value isKindOfClass:[NSObject class]] && [value tab_isValue]) { 208 | return value; 209 | } 210 | } 211 | return nil; 212 | } 213 | 214 | @end 215 | 216 | @implementation NSMutableDictionary (TABSafe) 217 | 218 | - (void)tab_setObject:(id)object Key:(NSString *)key { 219 | 220 | if ([self tab_isValue] && [object tab_isValue] && [key tab_isValue]) { 221 | [self setObject:object forKey:key]; 222 | } 223 | } 224 | 225 | @end 226 | 227 | @implementation NSNumber (TABSafe) 228 | 229 | - (BOOL)tab_isValue { 230 | 231 | if (self != nil && ![self isKindOfClass:[NSNull class]]) { 232 | return YES; 233 | } 234 | return NO; 235 | } 236 | 237 | @end 238 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/CategoryUtil/UIView+Frame.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Frame.h 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface UIView (Frame) 11 | 12 | @property (nonatomic, assign) CGFloat right; 13 | @property (nonatomic, assign) CGFloat top; 14 | @property (nonatomic, assign) CGFloat left; 15 | @property (nonatomic, assign) CGFloat bottom; 16 | @property (nonatomic, assign) CGFloat width; 17 | @property (nonatomic, assign) CGFloat height; 18 | @property (nonatomic, assign) CGFloat centerX; 19 | @property (nonatomic, assign) CGFloat centerY; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/CategoryUtil/UIView+Frame.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Frame.m 3 | // 4 | // Created by tigerAndBull on 2017/12/11. 5 | // Copyright © 2017年 tigerAndBull. All rights reserved. 6 | // 7 | 8 | #import "UIView+Frame.h" 9 | 10 | @implementation UIView (Frame) 11 | 12 | - (CGFloat)left { 13 | return self.frame.origin.x; 14 | } 15 | - (void)setLeft:(CGFloat)left { 16 | CGRect rect = self.frame; 17 | rect.origin.x = left; 18 | self.frame = rect; 19 | } 20 | - (CGFloat)top { 21 | return self.frame.origin.y; 22 | } 23 | - (void)setTop:(CGFloat)top { 24 | CGRect rect = self.frame; 25 | rect.origin.y = top; 26 | self.frame = rect; 27 | } 28 | - (CGFloat)width { 29 | return self.frame.size.width; 30 | } 31 | - (void)setWidth:(CGFloat)width { 32 | CGRect rect = self.frame; 33 | rect.size.width = width; 34 | self.frame = rect; 35 | } 36 | - (CGFloat)height { 37 | return self.frame.size.height; 38 | } 39 | - (void)setHeight:(CGFloat)height { 40 | CGRect rect = self.frame; 41 | rect.size.height = height; 42 | self.frame = rect; 43 | } 44 | - (CGFloat)right { 45 | return self.left + self.width; 46 | } 47 | - (void)setRight:(CGFloat)right { 48 | [self setLeft:(right - self.width)]; 49 | } 50 | - (CGFloat)bottom { 51 | return self.top + self.height; 52 | } 53 | - (void)setBottom:(CGFloat)bottom { 54 | [self setTop:(bottom - self.height)]; 55 | } 56 | 57 | - (CGFloat)centerX { 58 | return self.center.x; 59 | } 60 | 61 | - (void)setCenterX:(CGFloat)centerX { 62 | CGPoint center = self.center; 63 | center.x = centerX; 64 | self.center = center; 65 | } 66 | 67 | - (CGFloat)centerY { 68 | return self.center.y; 69 | } 70 | 71 | - (void)setCenterY:(CGFloat)centerY { 72 | CGPoint center = self.center; 73 | center.y = centerY; 74 | self.center = center; 75 | } 76 | @end 77 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Code/.DS_Store -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/.DS_Store -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/Model/Game.h: -------------------------------------------------------------------------------- 1 | // 2 | // Game.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/15. 6 | // Copyright © 2018年 tigerAndBulll. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Game : NSObject 12 | 13 | @property (nonatomic,strong) NSString *gameId; 14 | 15 | @property (nonatomic,strong) NSString *content; 16 | 17 | @property (nonatomic,strong) NSString *title; 18 | 19 | @property (nonatomic,strong) NSString *cover; 20 | 21 | @property (nonatomic,strong) NSString *author; 22 | 23 | @property (nonatomic) long long openTime; 24 | 25 | @property (nonatomic) long long endTime; 26 | 27 | @property (nonatomic) long long erollTime; 28 | 29 | @property (nonatomic) long long erollEndTime; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/Model/Game.m: -------------------------------------------------------------------------------- 1 | // 2 | // Game.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/15. 6 | // Copyright © 2018年 tigerAndBulll. All rights reserved. 7 | // 8 | 9 | #import "Game.h" 10 | 11 | @implementation Game 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/TestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewController.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBulll. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "LargeTitleBaseViewController.h" 12 | 13 | @interface TestViewController : LargeTitleBaseViewController 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/TestViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestViewController.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TestViewController.h" 10 | 11 | #import "TestTableViewCell.h" 12 | 13 | #import "Game.h" 14 | 15 | #import "TABDefine.h" 16 | 17 | #import "AppDelegate.h" 18 | 19 | #import "TABAnimated.h" 20 | 21 | @interface TestViewController () { 22 | 23 | NSMutableArray *dataArray; 24 | } 25 | 26 | @end 27 | 28 | @implementation TestViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view. 33 | 34 | [self initData]; 35 | [self initUI]; 36 | 37 | // 假设3秒后,获取到数据了,代码具体位置看你项目了。 38 | [self performSelector:@selector(afterGetData) withObject:nil afterDelay:3.0]; 39 | } 40 | 41 | - (void)viewWillAppear:(BOOL)animated { 42 | [super viewWillAppear:animated]; 43 | } 44 | 45 | - (void)viewWillDisappear:(BOOL)animated { 46 | [super viewWillDisappear:animated]; 47 | 48 | } 49 | 50 | - (void)didReceiveMemoryWarning { 51 | [super didReceiveMemoryWarning]; 52 | // Dispose of any resources that can be recreated. 53 | } 54 | 55 | - (void)dealloc { 56 | NSLog(@"========== dealloc =========="); 57 | } 58 | 59 | #pragma mark - Target 60 | 61 | /** 62 | 获取到数据后 63 | */ 64 | - (void)afterGetData { 65 | 66 | // 模拟数据 67 | for (int i = 0; i < 20; i ++) { 68 | 69 | Game *game = [[Game alloc]init]; 70 | game.gameId = [NSString stringWithFormat:@"%d",i]; 71 | game.title = [NSString stringWithFormat:@"这里是赛事标题%d",i+1]; 72 | game.cover = @"test.jpg"; 73 | [dataArray addObject:game]; 74 | } 75 | 76 | // 停止动画,并刷新数据 77 | self.tableView.animatedStyle = TABTableViewAnimationEnd; 78 | [self.tableView reloadData]; 79 | } 80 | 81 | #pragma mark - UITableView Delegate & Datasource 82 | 83 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 84 | return 1; 85 | } 86 | 87 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 88 | return dataArray.count; 89 | } 90 | 91 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 92 | return .1; 93 | } 94 | 95 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 96 | return .1; 97 | } 98 | 99 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 100 | 101 | static NSString *str = @"TestTableViewCell"; 102 | TestTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str]; 103 | if (!cell) { 104 | cell = [[TestTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str]; 105 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 106 | } 107 | 108 | if (tableView.animatedStyle != TABTableViewAnimationStart) { 109 | [cell initWithData:dataArray[indexPath.row]]; 110 | } 111 | 112 | return cell; 113 | } 114 | 115 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 116 | BaseViewController *vc = [[BaseViewController alloc]init]; 117 | vc.title = @"标题"; 118 | [self.navController pushViewController:vc animated:YES hideTabbar:YES]; 119 | } 120 | 121 | #pragma mark - Initize Methods 122 | 123 | /** 124 | load data 125 | 加载数据 126 | */ 127 | - (void)initData { 128 | 129 | dataArray = [NSMutableArray array]; 130 | } 131 | 132 | /** 133 | initize view 134 | 视图初始化 135 | */ 136 | - (void)initUI { 137 | 138 | self.navTitle = @"首页"; 139 | 140 | [self.view addSubview:self.tableView]; 141 | self.tableView.delegate = self; 142 | self.tableView.dataSource = self; 143 | self.tableView.rowHeight = 100; 144 | self.tableView.animatedStyle = TABTableViewAnimationStart; 145 | } 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/View/TestTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // GameTableViewCell.h 3 | // lifeAndSport 4 | // 5 | // Created by tigerAndBull on 2018/6/6. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class Game; 12 | 13 | @interface TestTableViewCell : UITableViewCell 14 | 15 | - (void)initWithData:(Game *)game; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/Index/View/TestTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // GameTableViewCell.m 3 | // lifeAndSport 4 | // 5 | // Created by tigerAndBull on 2018/6/6. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TestTableViewCell.h" 10 | 11 | #import "Game.h" 12 | 13 | #import "TABMethod.h" 14 | 15 | #import "TABDefine.h" 16 | 17 | #import "TABAnimated.h" 18 | 19 | @interface TestTableViewCell () { 20 | 21 | UIImageView *gameImg; 22 | UILabel *titleLab; 23 | UILabel *timeLab; 24 | UIButton *statusBtn; 25 | } 26 | 27 | @end 28 | 29 | @implementation TestTableViewCell 30 | 31 | - (void)awakeFromNib { 32 | [super awakeFromNib]; 33 | // Initialization code 34 | } 35 | 36 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 37 | [super setSelected:selected animated:animated]; 38 | // Configure the view for the selected state 39 | } 40 | 41 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 42 | 43 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 44 | 45 | if (self) { 46 | [self initUI]; 47 | } 48 | return self; 49 | } 50 | 51 | - (void)layoutSubviews { 52 | [super layoutSubviews]; 53 | 54 | //获取对应组件文本大小 55 | CGSize titleSize = [TABMethod tab_getSizeWithText:titleLab.text sizeWithFont:kFont(15) constrainedToSize:CGSizeMake(MAXFLOAT, 20)]; 56 | CGSize timeSize = [TABMethod tab_getSizeWithText:timeLab.text sizeWithFont:kFont(12) constrainedToSize:CGSizeMake(MAXFLOAT, 25)]; 57 | 58 | //布局 59 | gameImg.frame = CGRectMake(15, 10, (self.frame.size.height-20)*1.5, (self.frame.size.height-20)); 60 | gameImg.layer.cornerRadius = 5; 61 | 62 | titleLab.frame = CGRectMake(CGRectGetMaxX(gameImg.frame)+15, 10, titleSize.width, 20); 63 | timeLab.frame = CGRectMake(CGRectGetMaxX(gameImg.frame)+15, CGRectGetMaxY(titleLab.frame)+5, timeSize.width,25); 64 | statusBtn.frame = CGRectMake(CGRectGetMaxX(gameImg.frame)+15, CGRectGetMaxY(timeLab.frame)+5+5,70, 20); 65 | 66 | if ( timeSize.width > 0 ) { 67 | statusBtn.layer.cornerRadius = 5; 68 | } 69 | } 70 | 71 | #pragma mark - Public Methods 72 | 73 | - (void)initWithData:(Game *)game { 74 | 75 | titleLab.text = [NSString stringWithFormat:@"赛事标题赛事标题%@~",game.gameId]; 76 | timeLab.text = @"报名时间:2018-09-12"; 77 | [gameImg setImage:[UIImage imageNamed:@"test.jpg"]]; 78 | 79 | [statusBtn setTitle:@"已结束" forState:UIControlStateNormal]; 80 | [statusBtn setBackgroundColor:[UIColor grayColor]]; 81 | } 82 | 83 | #pragma mark - Initize Methods 84 | 85 | - (void)initUI { 86 | 87 | { 88 | UIImageView *iv = [[UIImageView alloc] init]; 89 | iv.contentMode = UIViewContentModeScaleAspectFill; 90 | iv.layer.masksToBounds = YES; 91 | iv.loadStyle = TABViewLoadAnimationWithOnlySkeleton; 92 | 93 | gameImg = iv; 94 | [self.contentView addSubview:iv]; 95 | } 96 | 97 | { 98 | UILabel *lab = [[UILabel alloc]init]; 99 | [lab setFont:kFont(15)]; 100 | [lab setTextColor:[UIColor blackColor]]; 101 | [lab setText:@""]; 102 | lab.loadStyle = TABViewLoadAnimationShort; 103 | titleLab = lab; 104 | [self.contentView addSubview:lab]; 105 | } 106 | 107 | { 108 | UILabel *lab = [[UILabel alloc]init]; 109 | [lab setFont:kFont(12)]; 110 | [lab setTextColor:[UIColor grayColor]]; 111 | [lab setText:@""]; 112 | lab.loadStyle = TABViewLoadAnimationLong; 113 | timeLab = lab; 114 | [self.contentView addSubview:lab]; 115 | } 116 | 117 | { 118 | UIButton *btn = [[UIButton alloc]init]; 119 | [btn setTitle:@"" forState:UIControlStateNormal]; 120 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 121 | [btn.titleLabel setFont:kFont(12)]; 122 | btn.loadStyle = TABViewLoadAnimationWithOnlySkeleton; 123 | 124 | statusBtn = btn; 125 | [self.contentView addSubview:btn]; 126 | } 127 | } 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/My/MyViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyViewController.h 3 | // LargeNavTitleDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/27. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "LargeTitleBaseViewController.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface MyViewController : LargeTitleBaseViewController 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Code/My/MyViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MyViewController.m 3 | // LargeNavTitleDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/27. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "MyViewController.h" 10 | 11 | @interface MyViewController () 12 | 13 | @end 14 | 15 | @implementation MyViewController 16 | 17 | #pragma mark - LifeCycle 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view. 22 | [self initUI]; 23 | } 24 | 25 | - (void)viewWillAppear:(BOOL)animated { 26 | [super viewWillAppear:animated]; 27 | } 28 | 29 | - (void)viewDidDisappear:(BOOL)animated { 30 | [super viewDidDisappear:animated]; 31 | } 32 | 33 | - (void)viewDidAppear:(BOOL)animated { 34 | [super viewDidAppear:animated]; 35 | } 36 | 37 | - (void)dealloc { 38 | } 39 | 40 | - (void)didReceiveMemoryWarning { 41 | [super didReceiveMemoryWarning]; 42 | // Dispose of any resources that can be recreated. 43 | } 44 | 45 | #pragma mark - UITableViewDataSource & UITableViewDelegate 46 | 47 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 48 | return 1; 49 | } 50 | 51 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 52 | return 6; 53 | } 54 | 55 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 56 | return .1; 57 | } 58 | 59 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 60 | return .1; 61 | } 62 | 63 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 64 | 65 | static NSString *str = @"UITableViewCell"; 66 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str]; 67 | if (!cell) { 68 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str]; 69 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 70 | } 71 | 72 | cell.imageView.image = [UIImage imageNamed:@"collection"]; 73 | if (indexPath.row == 0) { 74 | cell.textLabel.text = @"我的等级"; 75 | }else { 76 | if (indexPath.row == 1) { 77 | cell.textLabel.text = @"我的收藏"; 78 | }else { 79 | if (indexPath.row == 2) { 80 | cell.textLabel.text = @"我的下载"; 81 | }else { 82 | if (indexPath.row == 3) { 83 | cell.textLabel.text = @"我的关注"; 84 | }else { 85 | if (indexPath.row == 4) { 86 | cell.textLabel.text = @"意见反馈"; 87 | }else { 88 | if (indexPath.row == 5) { 89 | cell.textLabel.text = @"联系我们"; 90 | } 91 | } 92 | } 93 | } 94 | } 95 | } 96 | 97 | return cell; 98 | } 99 | 100 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 101 | 102 | } 103 | 104 | #pragma mark - Initize Methods 105 | 106 | /** 107 | initialize view 108 | 初始化视图 109 | */ 110 | - (void)initUI { 111 | 112 | [self.view addSubview:self.tableView]; 113 | self.tableView.delegate = self; 114 | self.tableView.dataSource = self; 115 | self.tableView.rowHeight = 60; 116 | 117 | self.navTitle = @"我的"; 118 | } 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | 33 | UISupportedInterfaceOrientations~ipad 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationPortraitUpsideDown 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/LargeNavTitle/LargeTitleBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABBaseViewController.h 3 | // ChildStory 4 | // 5 | // Created by tigerAndBull on 2018/10/20. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "BaseViewController.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface LargeTitleBaseViewController : BaseViewController 16 | 17 | @property (nonatomic, strong) UITableView *tableView; 18 | 19 | @property (nonatomic, strong) NSString *navTitle; 20 | 21 | - (void)refreshNavViewWithNavStatus:(BOOL)show; // reflash nav when the nav is showing 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/LargeNavTitle/TouchModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ToucnModel.h 3 | // ChildStory 4 | // 5 | // Created by tigerAndBull on 2018/10/25. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface TouchModel : NSObject 14 | 15 | @property (nonatomic, strong) NSString *isTouch; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/LargeNavTitle/TouchModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ToucnModel.m 3 | // ChildStory 4 | // 5 | // Created by tigerAndBull on 2018/10/25. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TouchModel.h" 10 | 11 | @implementation TouchModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Source/head.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Source/head.jpg -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/Source/test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/Source/test.jpg -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tigerAndBull/TABNavTitle/c72dce03ff2770af0a656f87393a3648446b5f93/LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/.DS_Store -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/TABAnimated.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABAnimated.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/15. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #ifndef TABAnimated_h 10 | #define TABAnimated_h 11 | 12 | #import "UIView+Animated.h" 13 | 14 | #import "UITableView+Animated.h" 15 | #import "UITableViewCell+Animated.h" 16 | 17 | #import "UICollectionView+Animated.h" 18 | #import "UICollectionViewCell+Animated.h" 19 | 20 | #import "TABViewAnimated.h" 21 | #import "TABMethod.h" 22 | 23 | #endif /* TABAnimated_h */ 24 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/TABMethod.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABMethod.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | // judge is iphone 14 | #define tab_kIsIPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 15 | // judge is iphoneX 16 | #define tab_kIsIPhone_X (tab_kIsIPhone && [[UIScreen mainScreen] bounds].size.height == 812.0) 17 | // get screen width 18 | #define tab_kScreenWidth [[UIScreen mainScreen] bounds].size.width 19 | // get screen height 20 | #define tab_kScreenHeight ((tab_kIsIPhone_X)?([[UIScreen mainScreen] bounds].size.height-49):([[UIScreen mainScreen] bounds].size.height)) 21 | 22 | #define tab_kFont(x) [UIFont systemFontOfSize:x] 23 | #define tab_kColor(c) [UIColor colorWithRed:((c>>24)&0xFF)/255.0 green:((c>>16)&0xFF)/255.0 blue:((c>>8)&0xFF)/255.0 alpha:((c)&0xFF)/255.0] 24 | #define tab_kBackColor tab_kColor(0xEEEEEEFF) 25 | 26 | @interface TABMethod : NSObject 27 | 28 | /** 29 | get text size 30 | 31 | @param text text content 32 | @param font font size 33 | @param size max text area 34 | @return CGSize new text size 35 | */ 36 | + (CGSize)tab_getSizeWithText:(NSString *)text sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size; 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/TABMethod.m: -------------------------------------------------------------------------------- 1 | // 2 | // TABMethod.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "TABMethod.h" 10 | 11 | @implementation TABMethod 12 | 13 | + (CGSize)tab_getSizeWithText:(NSString *)text sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size { 14 | 15 | NSDictionary *attributesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil]; 16 | CGRect frame = [text boundingRectWithSize:size options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:attributesDictionary context:nil]; 17 | 18 | return frame.size; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/TABViewAnimated.h: -------------------------------------------------------------------------------- 1 | // 2 | // TABViewAnimated.h 3 | // lifeAndSport 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "UIView+Animated.h" 13 | 14 | @interface TABViewAnimated : NSObject 15 | 16 | @property (nonatomic) CGFloat animatedDuration; // default is 0.4. the duartion of your animations. 17 | @property (nonatomic, strong) UIColor *animatedColor; // default is 0xEEEEEE. the backgroundcolor of your animations. 18 | @property (nonatomic) CGFloat longToValue; // toValue for LongAnimation 19 | @property (nonatomic) CGFloat shortToValue; // toValue for ShortAnimation 20 | 21 | /** 22 | SingleTon 23 | 24 | @return return object 25 | */ 26 | + (TABViewAnimated *)sharedAnimated; 27 | 28 | /** 29 | start/end animations to UIView. 30 | 31 | @param view to the UIView 32 | */ 33 | - (void)startOrEndViewAnimated:(UIView *)view; 34 | 35 | /** 36 | start/end animations to UITableView. 37 | 38 | @param cell to UITableViewCell 39 | */ 40 | - (void)startOrEndTableAnimated:(UITableViewCell *)cell; 41 | 42 | /** 43 | start/end animations to UICollectionView. 44 | 45 | @param cell to UICollectionViewCell. 46 | */ 47 | - (void)startOrEndCollectionAnimated:(UICollectionViewCell *)cell; 48 | 49 | /** 50 | set animation duration and backgroundcolor. 51 | 52 | @param duration back and forth 53 | @param color backgroundcolor 54 | */ 55 | - (void)initWithAnimatedDuration:(CGFloat)duration 56 | withColor:(UIColor *)color; 57 | 58 | 59 | /** 60 | to set toValue 61 | 62 | @param duration back and forth 63 | @param color backgroundcolor 64 | @param longToValue toValue for LongAnimation 65 | @param shortToValue toValue for ShortAnimation 66 | */ 67 | - (void)initWithAnimatedDuration:(CGFloat)duration 68 | withColor:(UIColor *)color 69 | withLongToValue:(CGFloat)longToValue 70 | withShortToValue:(CGFloat)shortToValue; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UICollectionView+Animated.h: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionView+Animated.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/12. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "UIView+Animated.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UICollectionView (Animated) 16 | 17 | @property (nonatomic) TABViewAnimationStyle animatedStyle; 18 | 19 | @property (nonatomic) NSInteger animatedCount; // default is six. count of cell during animating. 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UICollectionView+Animated.m: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionView+Animated.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/12. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UICollectionView+Animated.h" 10 | 11 | #import "UIView+Animated.h" 12 | 13 | #import 14 | 15 | @implementation UICollectionView (Animated) 16 | 17 | + (void)load { 18 | 19 | // Ensure that the exchange method executed only once. 20 | static dispatch_once_t onceToken; 21 | 22 | dispatch_once(&onceToken, ^{ 23 | 24 | // Gets the viewDidLoad method to the class,whose type is a pointer to a objc_method structure. 25 | Method originMethod = class_getInstanceMethod([self class], @selector(setDelegate:)); 26 | 27 | // Get the method you created. 28 | Method newMethod = class_getInstanceMethod([self class], @selector(tab_setDelegate:)); 29 | 30 | IMP newIMP = method_getImplementation(newMethod); 31 | 32 | BOOL isAdd = class_addMethod([self class], @selector(tab_setDelegate:), newIMP, method_getTypeEncoding(newMethod)); 33 | 34 | if (isAdd) { 35 | 36 | // replace 37 | class_replaceMethod([self class], @selector(setDelegate:), newIMP, method_getTypeEncoding(newMethod)); 38 | } else { 39 | // exchange 40 | method_exchangeImplementations(originMethod, newMethod); 41 | } 42 | 43 | }); 44 | } 45 | 46 | - (void)tab_setDelegate:(id)delegate { 47 | 48 | SEL oldSelector = @selector(numberOfSectionsInCollectionView:); 49 | SEL newSelector = @selector(tab_numberOfSectionsInCollectionView:); 50 | 51 | SEL oldSectionSelector = @selector(collectionView:numberOfItemsInSection:); 52 | SEL newSectionSelector = @selector(tab_collectionView:numberOfItemsInSection:); 53 | 54 | [self exchangeCollectionDelegateMethod:oldSectionSelector withNewSel:newSectionSelector withCollectionDelegate:delegate]; 55 | [self exchangeCollectionDelegateMethod:oldSelector withNewSel:newSelector withCollectionDelegate:delegate]; 56 | 57 | [self tab_setDelegate:delegate]; 58 | 59 | } 60 | 61 | #pragma mark - TABCollectionViewDelegate 62 | 63 | - (NSInteger)tab_numberOfSectionsInCollectionView:(UICollectionView *)collectionView { 64 | 65 | // get the count of sections safely. 66 | NSNumber *value = objc_getAssociatedObject(self, @selector(numberOfSections)); 67 | 68 | if (collectionView.animatedStyle == TABCollectionViewAnimationStart) { 69 | return ([value integerValue] > 0)?[value integerValue]:1; 70 | } 71 | 72 | // judge is add tab_numberOfSectionsInCollectionView or not. 73 | Method newMethod = class_getInstanceMethod([self class], @selector(tab_numberOfSectionsInCollectionView:)); 74 | IMP newIMP = method_getImplementation(newMethod); 75 | 76 | BOOL isAdd = class_addMethod([collectionView class], @selector(tab_numberOfSectionsInCollectionView:), newIMP, method_getTypeEncoding(newMethod)); 77 | 78 | if (isAdd) { 79 | return [self tab_numberOfSectionsInCollectionView:collectionView]; 80 | } 81 | return 1; 82 | } 83 | 84 | - (NSInteger)tab_collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 85 | 86 | if (collectionView.animatedStyle == TABCollectionViewAnimationStart) { 87 | return collectionView.animatedCount; 88 | } 89 | return [self tab_collectionView:collectionView numberOfItemsInSection:section]; 90 | } 91 | 92 | #pragma mark - Private Methods 93 | 94 | - (void)exchangeCollectionDelegateMethod:(SEL)oldSelector 95 | withNewSel:(SEL)newSelector 96 | withCollectionDelegate:(id)delegate { 97 | 98 | Method oldMethod_del = class_getInstanceMethod([delegate class], oldSelector); 99 | Method oldMethod_self = class_getInstanceMethod([self class], oldSelector); 100 | Method newMethod = class_getInstanceMethod([self class], newSelector); 101 | 102 | BOOL isSuccess = class_addMethod([delegate class], oldSelector, class_getMethodImplementation([self class], newSelector), method_getTypeEncoding(newMethod)); 103 | 104 | if (isSuccess) { 105 | 106 | class_replaceMethod([delegate class], newSelector, class_getMethodImplementation([self class], oldSelector), method_getTypeEncoding(oldMethod_self)); 107 | } else { 108 | 109 | // exchange 110 | BOOL isVictory = class_addMethod([delegate class], newSelector, class_getMethodImplementation([delegate class], oldSelector), method_getTypeEncoding(oldMethod_del)); 111 | if (isVictory) { 112 | class_replaceMethod([delegate class], oldSelector, class_getMethodImplementation([self class], newSelector), method_getTypeEncoding(newMethod)); 113 | } 114 | } 115 | } 116 | 117 | 118 | #pragma mark - Getter / Setter 119 | 120 | - (TABViewAnimationStyle)animatedStyle { 121 | 122 | NSNumber *value = objc_getAssociatedObject(self, @selector(animatedStyle)); 123 | return value.intValue; 124 | } 125 | 126 | - (void)setAnimatedStyle:(TABViewAnimationStyle)animatedStyle { 127 | 128 | // If the animation started, disable touch events. 129 | if (animatedStyle == 4) { 130 | [self setScrollEnabled:NO]; 131 | [self setAllowsSelection:NO]; 132 | } else { 133 | [self setScrollEnabled:YES]; 134 | [self setAllowsSelection:YES]; 135 | } 136 | objc_setAssociatedObject(self, @selector(animatedStyle), @(animatedStyle), OBJC_ASSOCIATION_ASSIGN); 137 | } 138 | 139 | - (NSInteger)animatedCount { 140 | NSNumber *value = objc_getAssociatedObject(self, @selector(animatedCount)); 141 | return (value.integerValue == 0)?(6):(value.integerValue); 142 | } 143 | 144 | - (void)setAnimatedCount:(NSInteger)animatedCount { 145 | objc_setAssociatedObject(self, @selector(animatedCount), @(animatedCount), OBJC_ASSOCIATION_ASSIGN); 146 | } 147 | 148 | @end 149 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UICollectionViewCell+Animated.h: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionViewCell+Animated.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/12. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UICollectionViewCell (Animated) 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UICollectionViewCell+Animated.m: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionViewCell+Animated.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/12. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UICollectionViewCell+Animated.h" 10 | 11 | #import "UICollectionView+Animated.h" 12 | 13 | #import "TABMethod.h" 14 | 15 | #import "TABViewAnimated.h" 16 | 17 | #import 18 | 19 | @implementation UICollectionViewCell (Animated) 20 | 21 | + (void)load { 22 | 23 | 24 | static dispatch_once_t onceToken; 25 | 26 | dispatch_once(&onceToken, ^{ 27 | 28 | // Gets the viewDidLoad method to the class,whose type is a pointer to a objc_method structure. 29 | // 获取到这个类的viewDidLoad方法,它的类型是一个objc_method结构体的指针 30 | Method originMethod = class_getInstanceMethod([self class], @selector(layoutSubviews)); 31 | 32 | // Get the method you created. 33 | // 获取自己创建的方法 34 | Method newMethod = class_getInstanceMethod([self class], @selector(tab_collection_layoutSubviews)); 35 | 36 | IMP newIMP = method_getImplementation(newMethod); 37 | 38 | BOOL isAdd = class_addMethod([self class], @selector(tab_collection_layoutSubviews), newIMP, method_getTypeEncoding(newMethod)); 39 | 40 | if (isAdd) { 41 | // replace 42 | class_replaceMethod([self class], @selector(layoutSubviews), newIMP, method_getTypeEncoding(newMethod)); 43 | } else { 44 | // exchange 45 | method_exchangeImplementations(originMethod, newMethod); 46 | 47 | } 48 | }); 49 | } 50 | 51 | #pragma mark - Exchange Method 52 | 53 | - (void)tab_collection_layoutSubviews { 54 | 55 | [self tab_collection_layoutSubviews]; 56 | 57 | // start animation/end animation 58 | dispatch_async(dispatch_get_main_queue(), ^{ 59 | 60 | [[TABViewAnimated sharedAnimated]startOrEndCollectionAnimated:self]; 61 | }); 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UITableView+Animated.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+Animated.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // the animation status of UITableView. 12 | typedef NS_ENUM(NSInteger,TABTableViewAnimationStyle) { 13 | TABTableViewAnimationDefault = 0, // default, no animation. 14 | TABTableViewAnimationStart, // start animation. 15 | TABTableViewAnimationEnd // end animation. 16 | }; 17 | 18 | @interface UITableView (Animated) 19 | 20 | @property (nonatomic) TABTableViewAnimationStyle animatedStyle; 21 | 22 | @property (nonatomic) NSInteger animatedCount; // default is three. count of cell during animating. 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UITableView+Animated.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+Animated.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UITableView+Animated.h" 10 | 11 | #import 12 | 13 | #import "TABViewAnimated.h" 14 | 15 | @implementation UITableView (Animated) 16 | 17 | + (void)load { 18 | 19 | // Ensure that the exchange method executed only once. 20 | static dispatch_once_t onceToken; 21 | 22 | dispatch_once(&onceToken, ^{ 23 | 24 | // Gets the viewDidLoad method to the class,whose type is a pointer to a objc_method structure. 25 | Method originMethod = class_getInstanceMethod([self class], @selector(setDataSource:)); 26 | 27 | // Get the method you created. 28 | Method newMethod = class_getInstanceMethod([self class], @selector(tab_setDataSource:)); 29 | 30 | IMP newIMP = method_getImplementation(newMethod); 31 | 32 | BOOL isAdd = class_addMethod([self class], @selector(tab_setDataSource:), newIMP, method_getTypeEncoding(newMethod)); 33 | 34 | if (isAdd) { 35 | 36 | // replace 37 | class_replaceMethod([self class], @selector(setDataSource:), newIMP, method_getTypeEncoding(newMethod)); 38 | }else { 39 | 40 | // exchange 41 | method_exchangeImplementations(originMethod, newMethod); 42 | } 43 | 44 | }); 45 | } 46 | 47 | - (void)tab_setDataSource:(id)dataSource { 48 | 49 | SEL oldSelector = @selector(tableView:numberOfRowsInSection:); 50 | SEL newSelector = @selector(tab_tableView:numberOfRowsInSection:); 51 | 52 | if ([self.delegate respondsToSelector:oldSelector]) { 53 | [self exchangeTableDelegateMethod:oldSelector withNewSel:newSelector withTableDelegate:dataSource]; 54 | } 55 | 56 | [self tab_setDataSource:dataSource]; 57 | } 58 | 59 | #pragma mark - TABTableViewDataSource 60 | 61 | - (NSInteger)tab_tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 62 | 63 | // If the animation running, return animatedCount. 64 | if (tableView.animatedStyle == TABTableViewAnimationStart) { 65 | return tableView.animatedCount; 66 | } 67 | return [self tab_tableView:tableView numberOfRowsInSection:section]; 68 | } 69 | 70 | #pragma mark - Private Methods 71 | 72 | 73 | /** 74 | exchange method 75 | 76 | @param oldSelector old method's sel 77 | @param newSelector new method's sel 78 | @param delegate return nil 79 | */ 80 | - (void)exchangeTableDelegateMethod:(SEL)oldSelector 81 | withNewSel:(SEL)newSelector 82 | withTableDelegate:(id)delegate { 83 | 84 | Method oldMethod_del = class_getInstanceMethod([delegate class], oldSelector); 85 | Method oldMethod_self = class_getInstanceMethod([self class], oldSelector); 86 | Method newMethod = class_getInstanceMethod([self class], newSelector); 87 | 88 | if ([self isKindOfClass:[delegate class]]) { 89 | method_exchangeImplementations(oldMethod_del, newMethod); 90 | } else { 91 | 92 | BOOL isSuccess = class_addMethod([delegate class], oldSelector, class_getMethodImplementation([self class], newSelector), method_getTypeEncoding(newMethod)); 93 | 94 | if (isSuccess) { 95 | 96 | class_replaceMethod([delegate class], newSelector, class_getMethodImplementation([self class], oldSelector), method_getTypeEncoding(oldMethod_self)); 97 | } else { 98 | 99 | BOOL isVictory = class_addMethod([delegate class], newSelector, class_getMethodImplementation([delegate class], oldSelector), method_getTypeEncoding(oldMethod_del)); 100 | if (isVictory) { 101 | class_replaceMethod([delegate class], oldSelector, class_getMethodImplementation([self class], newSelector), method_getTypeEncoding(newMethod)); 102 | } 103 | } 104 | } 105 | } 106 | 107 | #pragma mark - Getter / Setter 108 | 109 | - (TABTableViewAnimationStyle)animatedStyle { 110 | 111 | NSNumber *value = objc_getAssociatedObject(self, @selector(animatedStyle)); 112 | 113 | // If the animation is running, disable touch events. 114 | if (value.intValue == 1) { 115 | self.scrollEnabled = NO; 116 | self.allowsSelection = NO; 117 | }else { 118 | self.scrollEnabled = YES; 119 | self.allowsSelection = YES; 120 | } 121 | return value.intValue; 122 | } 123 | 124 | - (void)setAnimatedStyle:(TABTableViewAnimationStyle)animatedStyle { 125 | objc_setAssociatedObject(self, @selector(animatedStyle), @(animatedStyle), OBJC_ASSOCIATION_ASSIGN); 126 | } 127 | 128 | - (NSInteger)animatedCount { 129 | NSNumber *value = objc_getAssociatedObject(self, @selector(animatedCount)); 130 | return (value.integerValue == 0)?(3):(value.integerValue); 131 | } 132 | 133 | - (void)setAnimatedCount:(NSInteger)animatedCount { 134 | objc_setAssociatedObject(self, @selector(animatedCount), @(animatedCount), OBJC_ASSOCIATION_ASSIGN); 135 | } 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UITableViewCell+Animated.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+Animated.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/21. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UITableViewCell (Animated) 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UITableViewCell+Animated.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+Animated.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/21. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UITableViewCell+Animated.h" 10 | #import "UITableView+Animated.h" 11 | 12 | #import "TABMethod.h" 13 | #import "TABViewAnimated.h" 14 | 15 | #import 16 | 17 | @implementation UITableViewCell (Animated) 18 | 19 | + (void)load { 20 | 21 | static dispatch_once_t onceToken; 22 | 23 | dispatch_once(&onceToken, ^{ 24 | 25 | // Gets the viewDidLoad method to the class,whose type is a pointer to a objc_method structure. 26 | Method originMethod = class_getInstanceMethod([self class], @selector(layoutSubviews)); 27 | 28 | // Get the method you created. 29 | Method newMethod = class_getInstanceMethod([self class], @selector(tab_cell_layoutSubviews)); 30 | 31 | IMP newIMP = method_getImplementation(newMethod); 32 | 33 | BOOL isAdd = class_addMethod([self class], @selector(tab_cell_layoutSubviews), newIMP, method_getTypeEncoding(newMethod)); 34 | 35 | if (isAdd) { 36 | // replace 37 | class_replaceMethod([self class], @selector(layoutSubviews), newIMP, method_getTypeEncoding(newMethod)); 38 | } else { 39 | // exchange 40 | method_exchangeImplementations(originMethod, newMethod); 41 | 42 | } 43 | }); 44 | } 45 | 46 | #pragma mark - Exchange Method 47 | 48 | - (void)tab_cell_layoutSubviews { 49 | 50 | [self tab_cell_layoutSubviews]; 51 | 52 | // start/end animation. 53 | dispatch_async(dispatch_get_main_queue(), ^{ 54 | [[TABViewAnimated sharedAnimated]startOrEndTableAnimated:self]; 55 | }); 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UIView+Animated.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Animated.h 3 | // lifeAndSport 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // the type of animation. 12 | typedef NS_ENUM(NSInteger,TABViewLoadAnimationStyle) { 13 | TABViewLoadAnimationDefault = 0, // default,没有动画 14 | TABViewLoadAnimationShort, // 动画先变短再变长 15 | TABViewLoadAnimationLong, // 动画先变长再变短 16 | TABViewLoadAnimationWithOnlySkeleton, // 只有骨架层 17 | }; 18 | 19 | // the animation status to UIView or UICollectionView. 20 | typedef NS_ENUM(NSInteger,TABViewAnimationStyle) { 21 | TABViewAnimationDefault = 0, // 默认,没有动画 22 | TABViewAnimationStart, // 开始动画 23 | TABViewAnimationRuning, // 动画中 24 | TABViewAnimationEnd, // 结束动画 25 | TABCollectionViewAnimationStart, // CollectionView 开始动画 26 | TABCollectionViewAnimationRunning, // CollectionView 动画中 27 | TABCollectionViewAnimationEnd // CollectionView 结束动画 28 | }; 29 | 30 | @interface UIView (Animated) 31 | 32 | @property (nonatomic) TABViewLoadAnimationStyle loadStyle; 33 | @property (nonatomic) TABViewAnimationStyle animatedStyle; 34 | 35 | @property (nonatomic) CGFloat tabViewWidth; // width of view to you appiont it, default is your phone screen's width / 3, you can also custom it. 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UIView+Animated.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Animated.m 3 | // lifeAndSport 4 | // 5 | // Created by tigerAndBull on 2018/9/14. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UIView+Animated.h" 10 | 11 | #import 12 | 13 | #import "TABViewAnimated.h" 14 | 15 | #import "TABMethod.h" 16 | 17 | @implementation UIView (Animated) 18 | 19 | #pragma mark - Getter/Setter 20 | 21 | - (TABViewLoadAnimationStyle)loadStyle { 22 | 23 | NSNumber *value = objc_getAssociatedObject(self, @selector(loadStyle)); 24 | return value.intValue; 25 | } 26 | 27 | - (void)setLoadStyle:(TABViewLoadAnimationStyle)loadStyle { 28 | 29 | objc_setAssociatedObject(self, @selector(loadStyle), @(loadStyle), OBJC_ASSOCIATION_ASSIGN); 30 | } 31 | 32 | - (TABViewAnimationStyle)animatedStyle { 33 | 34 | NSNumber *value = objc_getAssociatedObject(self, @selector(animatedStyle)); 35 | return value.intValue; 36 | } 37 | 38 | - (void)setAnimatedStyle:(TABViewAnimationStyle)animatedStyle { 39 | 40 | objc_setAssociatedObject(self, @selector(animatedStyle), @(animatedStyle), OBJC_ASSOCIATION_ASSIGN); 41 | } 42 | 43 | - (CGFloat)tabViewWidth { 44 | 45 | NSNumber *value = objc_getAssociatedObject(self, @selector(tabViewWidth)); 46 | return value.floatValue; 47 | } 48 | 49 | - (void)setTabViewWidth:(CGFloat)tabViewWidth { 50 | 51 | objc_setAssociatedObject(self, @selector(tabViewWidth), @(tabViewWidth), OBJC_ASSOCIATION_ASSIGN); 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UIView+TABLayerout.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TABLayerout.h 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/21. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIView (TABLayerout) 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/TABAnimated/UIView+TABLayerout.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TABLayerout.m 3 | // AnimatedDemo 4 | // 5 | // Created by tigerAndBull on 2018/9/21. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import "UIView+TABLayerout.h" 10 | #import "UIView+Animated.h" 11 | #import "TABViewAnimated.h" 12 | #import "TABMethod.h" 13 | #import 14 | 15 | @implementation UIView (TABLayerout) 16 | 17 | + (void)load { 18 | 19 | static dispatch_once_t onceToken; 20 | 21 | dispatch_once(&onceToken, ^{ 22 | 23 | // Gets the viewDidLoad method to the class,whose type is a pointer to a objc_method structure. 24 | // 获取到这个类的viewDidLoad方法,它的类型是一个objc_method结构体的指针 25 | Method originMethod = class_getInstanceMethod([self class], @selector(layoutSubviews)); 26 | 27 | // Get the method you created. 28 | // 获取自己创建的方法 29 | Method newMethod = class_getInstanceMethod([self class], @selector(tab_layoutSubviews)); 30 | 31 | IMP newIMP = method_getImplementation(newMethod); 32 | 33 | BOOL isAdd = class_addMethod([self class], @selector(tab_layoutSubviews), newIMP, method_getTypeEncoding(newMethod)); 34 | 35 | if (isAdd) { 36 | // replace 37 | class_replaceMethod([self class], @selector(layoutSubviews), newIMP, method_getTypeEncoding(newMethod)); 38 | } else { 39 | // exchange 40 | method_exchangeImplementations(originMethod, newMethod); 41 | } 42 | }); 43 | } 44 | 45 | #pragma mark - Exchange Method 46 | 47 | - (void)tab_layoutSubviews { 48 | 49 | [self tab_layoutSubviews]; 50 | 51 | // start animation/end animation 52 | dispatch_async(dispatch_get_main_queue(), ^{ 53 | 54 | if ( self.animatedStyle != TABViewAnimationRuning ) { 55 | [[TABViewAnimated sharedAnimated]startOrEndViewAnimated:self]; 56 | } 57 | }); 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LargeNavTitleDemo 4 | // 5 | // Created by tigerAndBull on 2018/10/26. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemoTests/LargeNavTitleDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LargeNavTitleDemoTests.m 3 | // LargeNavTitleDemoTests 4 | // 5 | // Created by tigerAndBull on 2018/10/26. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LargeNavTitleDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LargeNavTitleDemoTests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | } 20 | 21 | - (void)tearDown { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | - (void)testExample { 26 | // This is an example of a functional test case. 27 | // Use XCTAssert and related functions to verify your tests produce the correct results. 28 | } 29 | 30 | - (void)testPerformanceExample { 31 | // This is an example of a performance test case. 32 | [self measureBlock:^{ 33 | // Put the code you want to measure the time of here. 34 | }]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/LargeNavTitleDemoUITests/LargeNavTitleDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LargeNavTitleDemoUITests.m 3 | // LargeNavTitleDemoUITests 4 | // 5 | // Created by tigerAndBull on 2018/10/26. 6 | // Copyright © 2018年 tigerAndBull. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LargeNavTitleDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation LargeNavTitleDemoUITests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | 20 | // In UI tests it is usually best to stop immediately when a failure occurs. 21 | self.continueAfterFailure = NO; 22 | 23 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 24 | [[[XCUIApplication alloc] init] launch]; 25 | 26 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 27 | } 28 | 29 | - (void)tearDown { 30 | // Put teardown code here. This method is called after the invocation of each test method in the class. 31 | } 32 | 33 | - (void)testExample { 34 | // Use recording to get started writing UI tests. 35 | // Use XCTAssert and related functions to verify your tests produce the correct results. 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '8.0' 3 | 4 | target 'LargeNavTitleDemo' do 5 | 6 | pod 'Masonry', '~> 1.1.0' 7 | 8 | end 9 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.1.0) 3 | 4 | DEPENDENCIES: 5 | - Masonry (~> 1.1.0) 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - Masonry 10 | 11 | SPEC CHECKSUMS: 12 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 13 | 14 | PODFILE CHECKSUM: 080bc7887878a9f07693c4f94dbb16f04a6bed2d 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Private/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Headers/Public/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.1.0) 3 | 4 | DEPENDENCIES: 5 | - Masonry (~> 1.1.0) 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - Masonry 10 | 11 | SPEC CHECKSUMS: 12 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 13 | 14 | PODFILE CHECKSUM: 080bc7887878a9f07693c4f94dbb16f04a6bed2d 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASCompositeConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASCompositeConstraint.h" 10 | #import "MASConstraint+Private.h" 11 | 12 | @interface MASCompositeConstraint () 13 | 14 | @property (nonatomic, strong) id mas_key; 15 | @property (nonatomic, strong) NSMutableArray *childConstraints; 16 | 17 | @end 18 | 19 | @implementation MASCompositeConstraint 20 | 21 | - (id)initWithChildren:(NSArray *)children { 22 | self = [super init]; 23 | if (!self) return nil; 24 | 25 | _childConstraints = [children mutableCopy]; 26 | for (MASConstraint *constraint in _childConstraints) { 27 | constraint.delegate = self; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | #pragma mark - MASConstraintDelegate 34 | 35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { 36 | NSUInteger index = [self.childConstraints indexOfObject:constraint]; 37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); 38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint]; 39 | } 40 | 41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 42 | id strongDelegate = self.delegate; 43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 44 | newConstraint.delegate = self; 45 | [self.childConstraints addObject:newConstraint]; 46 | return newConstraint; 47 | } 48 | 49 | #pragma mark - NSLayoutConstraint multiplier proxies 50 | 51 | - (MASConstraint * (^)(CGFloat))multipliedBy { 52 | return ^id(CGFloat multiplier) { 53 | for (MASConstraint *constraint in self.childConstraints) { 54 | constraint.multipliedBy(multiplier); 55 | } 56 | return self; 57 | }; 58 | } 59 | 60 | - (MASConstraint * (^)(CGFloat))dividedBy { 61 | return ^id(CGFloat divider) { 62 | for (MASConstraint *constraint in self.childConstraints) { 63 | constraint.dividedBy(divider); 64 | } 65 | return self; 66 | }; 67 | } 68 | 69 | #pragma mark - MASLayoutPriority proxy 70 | 71 | - (MASConstraint * (^)(MASLayoutPriority))priority { 72 | return ^id(MASLayoutPriority priority) { 73 | for (MASConstraint *constraint in self.childConstraints) { 74 | constraint.priority(priority); 75 | } 76 | return self; 77 | }; 78 | } 79 | 80 | #pragma mark - NSLayoutRelation proxy 81 | 82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { 83 | return ^id(id attr, NSLayoutRelation relation) { 84 | for (MASConstraint *constraint in self.childConstraints.copy) { 85 | constraint.equalToWithRelation(attr, relation); 86 | } 87 | return self; 88 | }; 89 | } 90 | 91 | #pragma mark - attribute chaining 92 | 93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 95 | return self; 96 | } 97 | 98 | #pragma mark - Animator proxy 99 | 100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) 101 | 102 | - (MASConstraint *)animator { 103 | for (MASConstraint *constraint in self.childConstraints) { 104 | [constraint animator]; 105 | } 106 | return self; 107 | } 108 | 109 | #endif 110 | 111 | #pragma mark - debug helpers 112 | 113 | - (MASConstraint * (^)(id))key { 114 | return ^id(id key) { 115 | self.mas_key = key; 116 | int i = 0; 117 | for (MASConstraint *constraint in self.childConstraints) { 118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]); 119 | } 120 | return self; 121 | }; 122 | } 123 | 124 | #pragma mark - NSLayoutConstraint constant setters 125 | 126 | - (void)setInsets:(MASEdgeInsets)insets { 127 | for (MASConstraint *constraint in self.childConstraints) { 128 | constraint.insets = insets; 129 | } 130 | } 131 | 132 | - (void)setInset:(CGFloat)inset { 133 | for (MASConstraint *constraint in self.childConstraints) { 134 | constraint.inset = inset; 135 | } 136 | } 137 | 138 | - (void)setOffset:(CGFloat)offset { 139 | for (MASConstraint *constraint in self.childConstraints) { 140 | constraint.offset = offset; 141 | } 142 | } 143 | 144 | - (void)setSizeOffset:(CGSize)sizeOffset { 145 | for (MASConstraint *constraint in self.childConstraints) { 146 | constraint.sizeOffset = sizeOffset; 147 | } 148 | } 149 | 150 | - (void)setCenterOffset:(CGPoint)centerOffset { 151 | for (MASConstraint *constraint in self.childConstraints) { 152 | constraint.centerOffset = centerOffset; 153 | } 154 | } 155 | 156 | #pragma mark - MASConstraint 157 | 158 | - (void)activate { 159 | for (MASConstraint *constraint in self.childConstraints) { 160 | [constraint activate]; 161 | } 162 | } 163 | 164 | - (void)deactivate { 165 | for (MASConstraint *constraint in self.childConstraints) { 166 | [constraint deactivate]; 167 | } 168 | } 169 | 170 | - (void)install { 171 | for (MASConstraint *constraint in self.childConstraints) { 172 | constraint.updateExisting = self.updateExisting; 173 | [constraint install]; 174 | } 175 | } 176 | 177 | - (void)uninstall { 178 | for (MASConstraint *constraint in self.childConstraints) { 179 | [constraint uninstall]; 180 | } 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraintMaker.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | typedef NS_OPTIONS(NSInteger, MASAttribute) { 13 | MASAttributeLeft = 1 << NSLayoutAttributeLeft, 14 | MASAttributeRight = 1 << NSLayoutAttributeRight, 15 | MASAttributeTop = 1 << NSLayoutAttributeTop, 16 | MASAttributeBottom = 1 << NSLayoutAttributeBottom, 17 | MASAttributeLeading = 1 << NSLayoutAttributeLeading, 18 | MASAttributeTrailing = 1 << NSLayoutAttributeTrailing, 19 | MASAttributeWidth = 1 << NSLayoutAttributeWidth, 20 | MASAttributeHeight = 1 << NSLayoutAttributeHeight, 21 | MASAttributeCenterX = 1 << NSLayoutAttributeCenterX, 22 | MASAttributeCenterY = 1 << NSLayoutAttributeCenterY, 23 | MASAttributeBaseline = 1 << NSLayoutAttributeBaseline, 24 | 25 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 26 | 27 | MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, 28 | MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline, 29 | 30 | #endif 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 33 | 34 | MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin, 35 | MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin, 36 | MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin, 37 | MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin, 38 | MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin, 39 | MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin, 40 | MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins, 41 | MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins, 42 | 43 | #endif 44 | 45 | }; 46 | 47 | /** 48 | * Provides factory methods for creating MASConstraints. 49 | * Constraints are collected until they are ready to be installed 50 | * 51 | */ 52 | @interface MASConstraintMaker : NSObject 53 | 54 | /** 55 | * The following properties return a new MASViewConstraint 56 | * with the first item set to the makers associated view and the appropriate MASViewAttribute 57 | */ 58 | @property (nonatomic, strong, readonly) MASConstraint *left; 59 | @property (nonatomic, strong, readonly) MASConstraint *top; 60 | @property (nonatomic, strong, readonly) MASConstraint *right; 61 | @property (nonatomic, strong, readonly) MASConstraint *bottom; 62 | @property (nonatomic, strong, readonly) MASConstraint *leading; 63 | @property (nonatomic, strong, readonly) MASConstraint *trailing; 64 | @property (nonatomic, strong, readonly) MASConstraint *width; 65 | @property (nonatomic, strong, readonly) MASConstraint *height; 66 | @property (nonatomic, strong, readonly) MASConstraint *centerX; 67 | @property (nonatomic, strong, readonly) MASConstraint *centerY; 68 | @property (nonatomic, strong, readonly) MASConstraint *baseline; 69 | 70 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 71 | 72 | @property (nonatomic, strong, readonly) MASConstraint *firstBaseline; 73 | @property (nonatomic, strong, readonly) MASConstraint *lastBaseline; 74 | 75 | #endif 76 | 77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 78 | 79 | @property (nonatomic, strong, readonly) MASConstraint *leftMargin; 80 | @property (nonatomic, strong, readonly) MASConstraint *rightMargin; 81 | @property (nonatomic, strong, readonly) MASConstraint *topMargin; 82 | @property (nonatomic, strong, readonly) MASConstraint *bottomMargin; 83 | @property (nonatomic, strong, readonly) MASConstraint *leadingMargin; 84 | @property (nonatomic, strong, readonly) MASConstraint *trailingMargin; 85 | @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins; 86 | @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins; 87 | 88 | #endif 89 | 90 | /** 91 | * Returns a block which creates a new MASCompositeConstraint with the first item set 92 | * to the makers associated view and children corresponding to the set bits in the 93 | * MASAttribute parameter. Combine multiple attributes via binary-or. 94 | */ 95 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); 96 | 97 | /** 98 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges 99 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right) 100 | * with the first item set to the makers associated view 101 | */ 102 | @property (nonatomic, strong, readonly) MASConstraint *edges; 103 | 104 | /** 105 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize 106 | * which generates the appropriate MASViewConstraint children (width, height) 107 | * with the first item set to the makers associated view 108 | */ 109 | @property (nonatomic, strong, readonly) MASConstraint *size; 110 | 111 | /** 112 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter 113 | * which generates the appropriate MASViewConstraint children (centerX, centerY) 114 | * with the first item set to the makers associated view 115 | */ 116 | @property (nonatomic, strong, readonly) MASConstraint *center; 117 | 118 | /** 119 | * Whether or not to check for an existing constraint instead of adding constraint 120 | */ 121 | @property (nonatomic, assign) BOOL updateExisting; 122 | 123 | /** 124 | * Whether or not to remove existing constraints prior to installing 125 | */ 126 | @property (nonatomic, assign) BOOL removeExisting; 127 | 128 | /** 129 | * initialises the maker with a default view 130 | * 131 | * @param view any MASConstraint are created with this view as the first item 132 | * 133 | * @return a new MASConstraintMaker 134 | */ 135 | - (id)initWithView:(MAS_VIEW *)view; 136 | 137 | /** 138 | * Calls install method on any MASConstraints which have been created by this maker 139 | * 140 | * @return an array of all the installed MASConstraints 141 | */ 142 | - (NSArray *)install; 143 | 144 | - (MASConstraint * (^)(dispatch_block_t))group; 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASUtilities.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 19/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | #if TARGET_OS_IPHONE || TARGET_OS_TV 14 | 15 | #import 16 | #define MAS_VIEW UIView 17 | #define MAS_VIEW_CONTROLLER UIViewController 18 | #define MASEdgeInsets UIEdgeInsets 19 | 20 | typedef UILayoutPriority MASLayoutPriority; 21 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; 22 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; 23 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; 24 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; 25 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; 26 | 27 | #elif TARGET_OS_MAC 28 | 29 | #import 30 | #define MAS_VIEW NSView 31 | #define MASEdgeInsets NSEdgeInsets 32 | 33 | typedef NSLayoutPriority MASLayoutPriority; 34 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; 35 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; 36 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; 37 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; 38 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; 39 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; 40 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; 41 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; 42 | 43 | #endif 44 | 45 | /** 46 | * Allows you to attach keys to objects matching the variable names passed. 47 | * 48 | * view1.mas_key = @"view1", view2.mas_key = @"view2"; 49 | * 50 | * is equivalent to: 51 | * 52 | * MASAttachKeys(view1, view2); 53 | */ 54 | #define MASAttachKeys(...) \ 55 | { \ 56 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ 57 | for (id key in keyPairs.allKeys) { \ 58 | id obj = keyPairs[key]; \ 59 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ 60 | @"Cannot attach mas_key to %@", obj); \ 61 | [obj setMas_key:key]; \ 62 | } \ 63 | } 64 | 65 | /** 66 | * Used to create object hashes 67 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html 68 | */ 69 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) 70 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) 71 | 72 | /** 73 | * Given a scalar or struct value, wraps it in NSValue 74 | * Based on EXPObjectify: https://github.com/specta/expecta 75 | */ 76 | static inline id _MASBoxValue(const char *type, ...) { 77 | va_list v; 78 | va_start(v, type); 79 | id obj = nil; 80 | if (strcmp(type, @encode(id)) == 0) { 81 | id actual = va_arg(v, id); 82 | obj = actual; 83 | } else if (strcmp(type, @encode(CGPoint)) == 0) { 84 | CGPoint actual = (CGPoint)va_arg(v, CGPoint); 85 | obj = [NSValue value:&actual withObjCType:type]; 86 | } else if (strcmp(type, @encode(CGSize)) == 0) { 87 | CGSize actual = (CGSize)va_arg(v, CGSize); 88 | obj = [NSValue value:&actual withObjCType:type]; 89 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { 90 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); 91 | obj = [NSValue value:&actual withObjCType:type]; 92 | } else if (strcmp(type, @encode(double)) == 0) { 93 | double actual = (double)va_arg(v, double); 94 | obj = [NSNumber numberWithDouble:actual]; 95 | } else if (strcmp(type, @encode(float)) == 0) { 96 | float actual = (float)va_arg(v, double); 97 | obj = [NSNumber numberWithFloat:actual]; 98 | } else if (strcmp(type, @encode(int)) == 0) { 99 | int actual = (int)va_arg(v, int); 100 | obj = [NSNumber numberWithInt:actual]; 101 | } else if (strcmp(type, @encode(long)) == 0) { 102 | long actual = (long)va_arg(v, long); 103 | obj = [NSNumber numberWithLong:actual]; 104 | } else if (strcmp(type, @encode(long long)) == 0) { 105 | long long actual = (long long)va_arg(v, long long); 106 | obj = [NSNumber numberWithLongLong:actual]; 107 | } else if (strcmp(type, @encode(short)) == 0) { 108 | short actual = (short)va_arg(v, int); 109 | obj = [NSNumber numberWithShort:actual]; 110 | } else if (strcmp(type, @encode(char)) == 0) { 111 | char actual = (char)va_arg(v, int); 112 | obj = [NSNumber numberWithChar:actual]; 113 | } else if (strcmp(type, @encode(bool)) == 0) { 114 | bool actual = (bool)va_arg(v, int); 115 | obj = [NSNumber numberWithBool:actual]; 116 | } else if (strcmp(type, @encode(unsigned char)) == 0) { 117 | unsigned char actual = (unsigned char)va_arg(v, unsigned int); 118 | obj = [NSNumber numberWithUnsignedChar:actual]; 119 | } else if (strcmp(type, @encode(unsigned int)) == 0) { 120 | unsigned int actual = (unsigned int)va_arg(v, unsigned int); 121 | obj = [NSNumber numberWithUnsignedInt:actual]; 122 | } else if (strcmp(type, @encode(unsigned long)) == 0) { 123 | unsigned long actual = (unsigned long)va_arg(v, unsigned long); 124 | obj = [NSNumber numberWithUnsignedLong:actual]; 125 | } else if (strcmp(type, @encode(unsigned long long)) == 0) { 126 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); 127 | obj = [NSNumber numberWithUnsignedLongLong:actual]; 128 | } else if (strcmp(type, @encode(unsigned short)) == 0) { 129 | unsigned short actual = (unsigned short)va_arg(v, unsigned int); 130 | obj = [NSNumber numberWithUnsignedShort:actual]; 131 | } 132 | va_end(v); 133 | return obj; 134 | } 135 | 136 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) 137 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/NSArray+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.m 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | #import "View+MASAdditions.h" 11 | 12 | @implementation NSArray (MASAdditions) 13 | 14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block { 15 | NSMutableArray *constraints = [NSMutableArray array]; 16 | for (MAS_VIEW *view in self) { 17 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 18 | [constraints addObjectsFromArray:[view mas_makeConstraints:block]]; 19 | } 20 | return constraints; 21 | } 22 | 23 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block { 24 | NSMutableArray *constraints = [NSMutableArray array]; 25 | for (MAS_VIEW *view in self) { 26 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 27 | [constraints addObjectsFromArray:[view mas_updateConstraints:block]]; 28 | } 29 | return constraints; 30 | } 31 | 32 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { 33 | NSMutableArray *constraints = [NSMutableArray array]; 34 | for (MAS_VIEW *view in self) { 35 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 36 | [constraints addObjectsFromArray:[view mas_remakeConstraints:block]]; 37 | } 38 | return constraints; 39 | } 40 | 41 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 42 | if (self.count < 2) { 43 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 44 | return; 45 | } 46 | 47 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 48 | if (axisType == MASAxisTypeHorizontal) { 49 | MAS_VIEW *prev; 50 | for (int i = 0; i < self.count; i++) { 51 | MAS_VIEW *v = self[i]; 52 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 53 | if (prev) { 54 | make.width.equalTo(prev); 55 | make.left.equalTo(prev.mas_right).offset(fixedSpacing); 56 | if (i == self.count - 1) {//last one 57 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 58 | } 59 | } 60 | else {//first one 61 | make.left.equalTo(tempSuperView).offset(leadSpacing); 62 | } 63 | 64 | }]; 65 | prev = v; 66 | } 67 | } 68 | else { 69 | MAS_VIEW *prev; 70 | for (int i = 0; i < self.count; i++) { 71 | MAS_VIEW *v = self[i]; 72 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 73 | if (prev) { 74 | make.height.equalTo(prev); 75 | make.top.equalTo(prev.mas_bottom).offset(fixedSpacing); 76 | if (i == self.count - 1) {//last one 77 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 78 | } 79 | } 80 | else {//first one 81 | make.top.equalTo(tempSuperView).offset(leadSpacing); 82 | } 83 | 84 | }]; 85 | prev = v; 86 | } 87 | } 88 | } 89 | 90 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 91 | if (self.count < 2) { 92 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 93 | return; 94 | } 95 | 96 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 97 | if (axisType == MASAxisTypeHorizontal) { 98 | MAS_VIEW *prev; 99 | for (int i = 0; i < self.count; i++) { 100 | MAS_VIEW *v = self[i]; 101 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 102 | make.width.equalTo(@(fixedItemLength)); 103 | if (prev) { 104 | if (i == self.count - 1) {//last one 105 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 106 | } 107 | else { 108 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 109 | make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 110 | } 111 | } 112 | else {//first one 113 | make.left.equalTo(tempSuperView).offset(leadSpacing); 114 | } 115 | }]; 116 | prev = v; 117 | } 118 | } 119 | else { 120 | MAS_VIEW *prev; 121 | for (int i = 0; i < self.count; i++) { 122 | MAS_VIEW *v = self[i]; 123 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 124 | make.height.equalTo(@(fixedItemLength)); 125 | if (prev) { 126 | if (i == self.count - 1) {//last one 127 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 128 | } 129 | else { 130 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 131 | make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 132 | } 133 | } 134 | else {//first one 135 | make.top.equalTo(tempSuperView).offset(leadSpacing); 136 | } 137 | }]; 138 | prev = v; 139 | } 140 | } 141 | } 142 | 143 | - (MAS_VIEW *)mas_commonSuperviewOfViews 144 | { 145 | MAS_VIEW *commonSuperview = nil; 146 | MAS_VIEW *previousView = nil; 147 | for (id object in self) { 148 | if ([object isKindOfClass:[MAS_VIEW class]]) { 149 | MAS_VIEW *view = (MAS_VIEW *)object; 150 | if (previousView) { 151 | commonSuperview = [view mas_closestCommonSuperview:commonSuperview]; 152 | } else { 153 | commonSuperview = view; 154 | } 155 | previousView = view; 156 | } 157 | } 158 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy."); 159 | return commonSuperview; 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSLayoutConstraint+MASDebugAdditions.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | 13 | @implementation NSLayoutConstraint (MASDebugAdditions) 14 | 15 | #pragma mark - description maps 16 | 17 | + (NSDictionary *)layoutRelationDescriptionsByValue { 18 | static dispatch_once_t once; 19 | static NSDictionary *descriptionMap; 20 | dispatch_once(&once, ^{ 21 | descriptionMap = @{ 22 | @(NSLayoutRelationEqual) : @"==", 23 | @(NSLayoutRelationGreaterThanOrEqual) : @">=", 24 | @(NSLayoutRelationLessThanOrEqual) : @"<=", 25 | }; 26 | }); 27 | return descriptionMap; 28 | } 29 | 30 | + (NSDictionary *)layoutAttributeDescriptionsByValue { 31 | static dispatch_once_t once; 32 | static NSDictionary *descriptionMap; 33 | dispatch_once(&once, ^{ 34 | descriptionMap = @{ 35 | @(NSLayoutAttributeTop) : @"top", 36 | @(NSLayoutAttributeLeft) : @"left", 37 | @(NSLayoutAttributeBottom) : @"bottom", 38 | @(NSLayoutAttributeRight) : @"right", 39 | @(NSLayoutAttributeLeading) : @"leading", 40 | @(NSLayoutAttributeTrailing) : @"trailing", 41 | @(NSLayoutAttributeWidth) : @"width", 42 | @(NSLayoutAttributeHeight) : @"height", 43 | @(NSLayoutAttributeCenterX) : @"centerX", 44 | @(NSLayoutAttributeCenterY) : @"centerY", 45 | @(NSLayoutAttributeBaseline) : @"baseline", 46 | 47 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 48 | @(NSLayoutAttributeFirstBaseline) : @"firstBaseline", 49 | @(NSLayoutAttributeLastBaseline) : @"lastBaseline", 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 53 | @(NSLayoutAttributeLeftMargin) : @"leftMargin", 54 | @(NSLayoutAttributeRightMargin) : @"rightMargin", 55 | @(NSLayoutAttributeTopMargin) : @"topMargin", 56 | @(NSLayoutAttributeBottomMargin) : @"bottomMargin", 57 | @(NSLayoutAttributeLeadingMargin) : @"leadingMargin", 58 | @(NSLayoutAttributeTrailingMargin) : @"trailingMargin", 59 | @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins", 60 | @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins", 61 | #endif 62 | 63 | }; 64 | 65 | }); 66 | return descriptionMap; 67 | } 68 | 69 | 70 | + (NSDictionary *)layoutPriorityDescriptionsByValue { 71 | static dispatch_once_t once; 72 | static NSDictionary *descriptionMap; 73 | dispatch_once(&once, ^{ 74 | #if TARGET_OS_IPHONE || TARGET_OS_TV 75 | descriptionMap = @{ 76 | @(MASLayoutPriorityDefaultHigh) : @"high", 77 | @(MASLayoutPriorityDefaultLow) : @"low", 78 | @(MASLayoutPriorityDefaultMedium) : @"medium", 79 | @(MASLayoutPriorityRequired) : @"required", 80 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size", 81 | }; 82 | #elif TARGET_OS_MAC 83 | descriptionMap = @{ 84 | @(MASLayoutPriorityDefaultHigh) : @"high", 85 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window", 86 | @(MASLayoutPriorityDefaultMedium) : @"medium", 87 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put", 88 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window", 89 | @(MASLayoutPriorityDefaultLow) : @"low", 90 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size", 91 | @(MASLayoutPriorityRequired) : @"required", 92 | }; 93 | #endif 94 | }); 95 | return descriptionMap; 96 | } 97 | 98 | #pragma mark - description override 99 | 100 | + (NSString *)descriptionForObject:(id)obj { 101 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) { 102 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]]; 103 | } 104 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj]; 105 | } 106 | 107 | - (NSString *)description { 108 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"]; 109 | 110 | [description appendString:[self.class descriptionForObject:self]]; 111 | 112 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]]; 113 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) { 114 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]]; 115 | } 116 | 117 | [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]]; 118 | 119 | if (self.secondItem) { 120 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]]; 121 | } 122 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) { 123 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]]; 124 | } 125 | 126 | if (self.multiplier != 1) { 127 | [description appendFormat:@" * %g", self.multiplier]; 128 | } 129 | 130 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) { 131 | [description appendFormat:@" %g", self.constant]; 132 | } else { 133 | if (self.constant) { 134 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)]; 135 | } 136 | } 137 | 138 | if (self.priority != MASLayoutPriorityRequired) { 139 | [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]]; 140 | } 141 | 142 | [description appendString:@">"]; 143 | return description; 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | /** 14 | * Provides constraint maker block 15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs 16 | */ 17 | @interface MAS_VIEW (MASAdditions) 18 | 19 | /** 20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute 21 | */ 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; 31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; 32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; 33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); 34 | 35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 36 | 37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; 39 | 40 | #endif 41 | 42 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 43 | 44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; 49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; 50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; 51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; 52 | 53 | #endif 54 | 55 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 56 | 57 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 59 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 60 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 61 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 62 | 63 | #endif 64 | 65 | /** 66 | * a key to associate with this view 67 | */ 68 | @property (nonatomic, strong) id mas_key; 69 | 70 | /** 71 | * Finds the closest common superview between this view and another view 72 | * 73 | * @param view other view 74 | * 75 | * @return returns nil if common superview could not be found 76 | */ 77 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 78 | 79 | /** 80 | * Creates a MASConstraintMaker with the callee view. 81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 82 | * 83 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 84 | * 85 | * @return Array of created MASConstraints 86 | */ 87 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 88 | 89 | /** 90 | * Creates a MASConstraintMaker with the callee view. 91 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 92 | * If an existing constraint exists then it will be updated instead. 93 | * 94 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 95 | * 96 | * @return Array of created/updated MASConstraints 97 | */ 98 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 99 | 100 | /** 101 | * Creates a MASConstraintMaker with the callee view. 102 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 103 | * All constraints previously installed for the view will be removed. 104 | * 105 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 106 | * 107 | * @return Array of created/updated MASConstraints 108 | */ 109 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand view additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface MAS_VIEW (MASShorthandAdditions) 18 | 19 | @property (nonatomic, strong, readonly) MASViewAttribute *left; 20 | @property (nonatomic, strong, readonly) MASViewAttribute *top; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *right; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *width; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *height; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 33 | 34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; 35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; 36 | 37 | #endif 38 | 39 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 40 | 41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; 42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; 43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; 44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; 49 | 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 53 | 54 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 55 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 56 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 57 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | 59 | #endif 60 | 61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 62 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 63 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 64 | 65 | @end 66 | 67 | #define MAS_ATTR_FORWARD(attr) \ 68 | - (MASViewAttribute *)attr { \ 69 | return [self mas_##attr]; \ 70 | } 71 | 72 | @implementation MAS_VIEW (MASShorthandAdditions) 73 | 74 | MAS_ATTR_FORWARD(top); 75 | MAS_ATTR_FORWARD(left); 76 | MAS_ATTR_FORWARD(bottom); 77 | MAS_ATTR_FORWARD(right); 78 | MAS_ATTR_FORWARD(leading); 79 | MAS_ATTR_FORWARD(trailing); 80 | MAS_ATTR_FORWARD(width); 81 | MAS_ATTR_FORWARD(height); 82 | MAS_ATTR_FORWARD(centerX); 83 | MAS_ATTR_FORWARD(centerY); 84 | MAS_ATTR_FORWARD(baseline); 85 | 86 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 87 | 88 | MAS_ATTR_FORWARD(firstBaseline); 89 | MAS_ATTR_FORWARD(lastBaseline); 90 | 91 | #endif 92 | 93 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 94 | 95 | MAS_ATTR_FORWARD(leftMargin); 96 | MAS_ATTR_FORWARD(rightMargin); 97 | MAS_ATTR_FORWARD(topMargin); 98 | MAS_ATTR_FORWARD(bottomMargin); 99 | MAS_ATTR_FORWARD(leadingMargin); 100 | MAS_ATTR_FORWARD(trailingMargin); 101 | MAS_ATTR_FORWARD(centerXWithinMargins); 102 | MAS_ATTR_FORWARD(centerYWithinMargins); 103 | 104 | #endif 105 | 106 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 107 | 108 | MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); 109 | MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); 110 | MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); 111 | MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); 112 | 113 | #endif 114 | 115 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 116 | return [self mas_attribute]; 117 | } 118 | 119 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 120 | return [self mas_makeConstraints:block]; 121 | } 122 | 123 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 124 | return [self mas_updateConstraints:block]; 125 | } 126 | 127 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 128 | return [self mas_remakeConstraints:block]; 129 | } 130 | 131 | @end 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Masonry/Masonry.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Masonry" 4 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Pods-LargeNavTitleDemo/Pods-LargeNavTitleDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Masonry 5 | 6 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | Generated by CocoaPods - https://cocoapods.org 26 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Pods-LargeNavTitleDemo/Pods-LargeNavTitleDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | License 37 | MIT 38 | Title 39 | Masonry 40 | Type 41 | PSGroupSpecifier 42 | 43 | 44 | FooterText 45 | Generated by CocoaPods - https://cocoapods.org 46 | Title 47 | 48 | Type 49 | PSGroupSpecifier 50 | 51 | 52 | StringsTable 53 | Acknowledgements 54 | Title 55 | Acknowledgements 56 | 57 | 58 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Pods-LargeNavTitleDemo/Pods-LargeNavTitleDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LargeNavTitleDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LargeNavTitleDemo 5 | @end 6 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Pods-LargeNavTitleDemo/Pods-LargeNavTitleDemo-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Pods-LargeNavTitleDemo/Pods-LargeNavTitleDemo-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Pods-LargeNavTitleDemo/Pods-LargeNavTitleDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Masonry" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /LargeNavTitleDemo/Pods/Target Support Files/Pods-LargeNavTitleDemo/Pods-LargeNavTitleDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Masonry" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Masonry" -framework "Foundation" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 前言 2 | iOS11+,大标题风格比较流行,但是系统的大标题风格有着以下不足 3 | 4 | >1. 仅支持ios11以上的系统 5 | >2. 可拓展性较差 6 | >3. 用的故事板开发,遇到了大标题隐藏的bug 7 | 8 | 自定义实现的缺点 9 | 10 | > 实现方式是headView,目前在导航栏过场动画上有所局限 11 | 12 | ## 效果图 13 | ![效果图.gif](https://upload-images.jianshu.io/upload_images/5632003-12ed42f861bf3118.gif?imageMogr2/auto-orient/strip) 14 | 15 | ## 简要说明 16 | >1. 利用scrollDelegate计算位置,实现推阻效果 17 | >2. 下拉字体逐渐变大 18 | >3. 不卡顿 19 | >4. 没有写UICollectionView的实现 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | --------------------------------------------------------------------------------