├── .gitignore ├── CYLTabBarController-Swift.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── CYLTabBarController-Swift.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── CYLTabBarController-Swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-40.png │ │ ├── Icon-40@2x.png │ │ ├── Icon-40@3x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-72.png │ │ ├── Icon-72@2x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-83.5@2x.png │ │ ├── Icon-Small-50.png │ │ ├── Icon-Small-50@2x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ ├── Icon.png │ │ └── Icon@2x.png │ ├── Contents.json │ └── TabBarIcon │ │ ├── Contents.json │ │ ├── account_highlight.imageset │ │ ├── Contents.json │ │ └── account_highlight@2x.png │ │ ├── account_normal.imageset │ │ ├── Contents.json │ │ └── account_normal@2x.png │ │ ├── home_highlight.imageset │ │ ├── Contents.json │ │ └── home_highlight@2x.png │ │ ├── home_normal.imageset │ │ ├── Contents.json │ │ └── home_normal@2x.png │ │ ├── message_highlight.imageset │ │ ├── Contents.json │ │ └── message_highlight@2x.png │ │ ├── message_normal.imageset │ │ ├── Contents.json │ │ └── message_normal@2x.png │ │ ├── mycity_highlight.imageset │ │ ├── Contents.json │ │ └── mycity_highlight@2x.png │ │ ├── mycity_normal.imageset │ │ ├── Contents.json │ │ └── mycity_normal@2x.png │ │ ├── post_normal.imageset │ │ ├── Contents.json │ │ └── post_normal@2x.png │ │ ├── tabbar_background.imageset │ │ ├── Contents.json │ │ └── tabbar_background@2x.png │ │ └── tapbar_top_line.imageset │ │ ├── Contents.json │ │ └── tapbar_top_line@2x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Classes │ ├── Connection │ │ └── ConnectionViewController.swift │ ├── Home │ │ ├── HomeViewController.swift │ │ ├── NextHomeViewController.swift │ │ └── NextHomeViewController.xib │ ├── Main │ │ ├── CYLPlusButtonSubclass.swift │ │ └── MainTabBarController.swift │ ├── Message │ │ └── MessageViewController.swift │ ├── Other │ │ ├── AppDelegate.swift │ │ └── ViewController.swift │ ├── Personal │ │ └── PersonalViewController.swift │ └── Publish │ │ └── PublishViewController.swift └── Info.plist ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── CYLTabBarController │ ├── CYLTabBarController │ │ ├── CAAnimation+CYLBadgeExtention.h │ │ ├── CAAnimation+CYLBadgeExtention.m │ │ ├── CYLBadgeProtocol.h │ │ ├── CYLBaseNavigationController.h │ │ ├── CYLBaseNavigationController.m │ │ ├── CYLBaseTableViewController.h │ │ ├── CYLBaseTableViewController.m │ │ ├── CYLBaseViewController.h │ │ ├── CYLBaseViewController.m │ │ ├── CYLConstants.h │ │ ├── CYLPlusButton.h │ │ ├── CYLPlusButton.m │ │ ├── CYLTabBar+CYLTabBarControllerExtention.h │ │ ├── CYLTabBar+CYLTabBarControllerExtention.m │ │ ├── CYLTabBar.h │ │ ├── CYLTabBar.m │ │ ├── CYLTabBarController.h │ │ ├── CYLTabBarController.m │ │ ├── NSObject+CYLTabBarControllerExtention.h │ │ ├── NSObject+CYLTabBarControllerExtention.m │ │ ├── UIBarButtonItem+CYLBadgeExtention.h │ │ ├── UIBarButtonItem+CYLBadgeExtention.m │ │ ├── UIColor+CYLTabBarControllerExtention.h │ │ ├── UIColor+CYLTabBarControllerExtention.m │ │ ├── UIControl+CYLTabBarControllerExtention.h │ │ ├── UIControl+CYLTabBarControllerExtention.m │ │ ├── UIImage+CYLTabBarControllerExtention.h │ │ ├── UIImage+CYLTabBarControllerExtention.m │ │ ├── UITabBarItem+CYLBadgeExtention.h │ │ ├── UITabBarItem+CYLBadgeExtention.m │ │ ├── UITabBarItem+CYLTabBarControllerExtention.h │ │ ├── UITabBarItem+CYLTabBarControllerExtention.m │ │ ├── UIView+CYLBadgeExtention.h │ │ ├── UIView+CYLBadgeExtention.m │ │ ├── UIView+CYLTabBarControllerExtention.h │ │ ├── UIView+CYLTabBarControllerExtention.m │ │ ├── UIViewController+CYLNavigationControllerExtention.h │ │ ├── UIViewController+CYLNavigationControllerExtention.m │ │ ├── UIViewController+CYLTabBarControllerExtention.h │ │ └── UIViewController+CYLTabBarControllerExtention.m │ ├── LICENSE │ └── README.md ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── CYLTabBarController │ ├── CYLTabBarController-Info.plist │ ├── CYLTabBarController-dummy.m │ ├── CYLTabBarController-prefix.pch │ ├── CYLTabBarController-umbrella.h │ ├── CYLTabBarController.debug.xcconfig │ ├── CYLTabBarController.modulemap │ ├── CYLTabBarController.release.xcconfig │ ├── CYLTabBarController.xcconfig │ └── Info.plist │ └── Pods-CYLTabBarController-Swift │ ├── Info.plist │ ├── Pods-CYLTabBarController-Swift-Info.plist │ ├── Pods-CYLTabBarController-Swift-acknowledgements.markdown │ ├── Pods-CYLTabBarController-Swift-acknowledgements.plist │ ├── Pods-CYLTabBarController-Swift-dummy.m │ ├── Pods-CYLTabBarController-Swift-frameworks.sh │ ├── Pods-CYLTabBarController-Swift-resources.sh │ ├── Pods-CYLTabBarController-Swift-umbrella.h │ ├── Pods-CYLTabBarController-Swift.debug.xcconfig │ ├── Pods-CYLTabBarController-Swift.modulemap │ └── Pods-CYLTabBarController-Swift.release.xcconfig └── README.md /.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 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | # Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/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 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "Icon-Small.png", 17 | "scale" : "1x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "Icon-Small@2x.png", 23 | "scale" : "2x" 24 | }, 25 | { 26 | "size" : "29x29", 27 | "idiom" : "iphone", 28 | "filename" : "Icon-Small@3x.png", 29 | "scale" : "3x" 30 | }, 31 | { 32 | "size" : "40x40", 33 | "idiom" : "iphone", 34 | "filename" : "Icon-40@2x.png", 35 | "scale" : "2x" 36 | }, 37 | { 38 | "size" : "40x40", 39 | "idiom" : "iphone", 40 | "filename" : "Icon-40@3x.png", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "size" : "57x57", 45 | "idiom" : "iphone", 46 | "filename" : "Icon.png", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "size" : "57x57", 51 | "idiom" : "iphone", 52 | "filename" : "Icon@2x.png", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "size" : "60x60", 57 | "idiom" : "iphone", 58 | "filename" : "Icon-60@2x.png", 59 | "scale" : "2x" 60 | }, 61 | { 62 | "size" : "60x60", 63 | "idiom" : "iphone", 64 | "filename" : "Icon-60@3x.png", 65 | "scale" : "3x" 66 | }, 67 | { 68 | "idiom" : "ipad", 69 | "size" : "20x20", 70 | "scale" : "1x" 71 | }, 72 | { 73 | "idiom" : "ipad", 74 | "size" : "20x20", 75 | "scale" : "2x" 76 | }, 77 | { 78 | "size" : "29x29", 79 | "idiom" : "ipad", 80 | "filename" : "Icon-Small.png", 81 | "scale" : "1x" 82 | }, 83 | { 84 | "size" : "29x29", 85 | "idiom" : "ipad", 86 | "filename" : "Icon-Small@2x.png", 87 | "scale" : "2x" 88 | }, 89 | { 90 | "size" : "40x40", 91 | "idiom" : "ipad", 92 | "filename" : "Icon-40.png", 93 | "scale" : "1x" 94 | }, 95 | { 96 | "size" : "40x40", 97 | "idiom" : "ipad", 98 | "filename" : "Icon-40@2x.png", 99 | "scale" : "2x" 100 | }, 101 | { 102 | "size" : "50x50", 103 | "idiom" : "ipad", 104 | "filename" : "Icon-Small-50.png", 105 | "scale" : "1x" 106 | }, 107 | { 108 | "size" : "50x50", 109 | "idiom" : "ipad", 110 | "filename" : "Icon-Small-50@2x.png", 111 | "scale" : "2x" 112 | }, 113 | { 114 | "size" : "72x72", 115 | "idiom" : "ipad", 116 | "filename" : "Icon-72.png", 117 | "scale" : "1x" 118 | }, 119 | { 120 | "size" : "72x72", 121 | "idiom" : "ipad", 122 | "filename" : "Icon-72@2x.png", 123 | "scale" : "2x" 124 | }, 125 | { 126 | "size" : "76x76", 127 | "idiom" : "ipad", 128 | "filename" : "Icon-76.png", 129 | "scale" : "1x" 130 | }, 131 | { 132 | "size" : "76x76", 133 | "idiom" : "ipad", 134 | "filename" : "Icon-76@2x.png", 135 | "scale" : "2x" 136 | }, 137 | { 138 | "size" : "83.5x83.5", 139 | "idiom" : "ipad", 140 | "filename" : "Icon-83.5@2x.png", 141 | "scale" : "2x" 142 | }, 143 | { 144 | "idiom" : "ios-marketing", 145 | "size" : "1024x1024", 146 | "scale" : "1x" 147 | } 148 | ], 149 | "info" : { 150 | "version" : 1, 151 | "author" : "xcode" 152 | } 153 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-72.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-72@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-50.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small-50@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/AppIcon.appiconset/Icon@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/account_highlight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "account_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/account_highlight.imageset/account_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/account_highlight.imageset/account_highlight@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/account_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "account_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/account_normal.imageset/account_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/account_normal.imageset/account_normal@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/home_highlight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/home_highlight.imageset/home_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/home_highlight.imageset/home_highlight@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/home_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/home_normal.imageset/home_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/home_normal.imageset/home_normal@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/message_highlight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "message_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/message_highlight.imageset/message_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/message_highlight.imageset/message_highlight@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/message_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "message_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/message_normal.imageset/message_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/message_normal.imageset/message_normal@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/mycity_highlight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mycity_highlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/mycity_highlight.imageset/mycity_highlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/mycity_highlight.imageset/mycity_highlight@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/mycity_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mycity_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/mycity_normal.imageset/mycity_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/mycity_normal.imageset/mycity_normal@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/post_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "post_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/post_normal.imageset/post_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/post_normal.imageset/post_normal@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/tabbar_background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tabbar_background@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/tabbar_background.imageset/tabbar_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/tabbar_background.imageset/tabbar_background@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/tapbar_top_line.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tapbar_top_line@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "original" 23 | } 24 | } -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/tapbar_top_line.imageset/tapbar_top_line@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WeMadeCode/CYLTabBarController-Swift/c8f034a1de492c45052d9fbac04cbdc96f5df013/CYLTabBarController-Swift/Assets.xcassets/TabBarIcon/tapbar_top_line.imageset/tapbar_top_line@2x.png -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Connection/ConnectionViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectionViewController.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/12/29. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ConnectionViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | self.view.backgroundColor = UIColor.blue 17 | 18 | } 19 | 20 | override func didReceiveMemoryWarning() { 21 | super.didReceiveMemoryWarning() 22 | // Dispose of any resources that can be recreated. 23 | } 24 | 25 | 26 | /* 27 | // MARK: - Navigation 28 | 29 | // In a storyboard-based application, you will often want to do a little preparation before navigation 30 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 31 | // Get the new view controller using segue.destinationViewController. 32 | // Pass the selected object to the new view controller. 33 | } 34 | */ 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Home/HomeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/12/29. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let cellIdentifier = "cell" 12 | 13 | final class HomeViewController: UITableViewController { 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | self.navigationItem.title = "首页" 18 | self.navigationController?.tabBarItem.badgeValue = "3" 19 | self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellIdentifier) 20 | } 21 | } 22 | 23 | 24 | extension HomeViewController{ 25 | 26 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 27 | let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) 28 | cell.textLabel?.text = "我是第\(indexPath.row)行" 29 | return cell 30 | } 31 | 32 | 33 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 34 | return 50 35 | } 36 | 37 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 38 | 39 | let vc = NextHomeViewController() 40 | vc.hidesBottomBarWhenPushed = true 41 | self.navigationController?.pushViewController(vc, animated: true) 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Home/NextHomeViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NextHomeViewController.swift 3 | // CYLTabBarController-Swift 4 | // 5 | // Created by Anthony on 2018/5/11. 6 | // Copyright © 2018年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CYLTabBarController 11 | 12 | class NextHomeViewController: UIViewController { 13 | @IBAction func firstBtnClick(_ sender: UIButton) { 14 | 15 | self.cyl_popSelectTabBarChildViewController(at: 1) 16 | 17 | } 18 | @IBAction func secondBtnClick(_ sender: UIButton) { 19 | 20 | self.cyl_popSelectTabBarChildViewController(at: 2) 21 | 22 | //重要:改变选中字体的颜色 23 | CYLExternPlusButton.isSelected = true 24 | 25 | 26 | } 27 | 28 | override func viewDidLoad() { 29 | super.viewDidLoad() 30 | 31 | // Do any additional setup after loading the view. 32 | } 33 | 34 | override func didReceiveMemoryWarning() { 35 | super.didReceiveMemoryWarning() 36 | // Dispose of any resources that can be recreated. 37 | } 38 | 39 | 40 | /* 41 | // MARK: - Navigation 42 | 43 | // In a storyboard-based application, you will often want to do a little preparation before navigation 44 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 45 | // Get the new view controller using segue.destinationViewController. 46 | // Pass the selected object to the new view controller. 47 | } 48 | */ 49 | 50 | } 51 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Home/NextHomeViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Main/CYLPlusButtonSubclass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CYLPlusButtonSubclass.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/12/29. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CYLTabBarController 11 | 12 | class CYLPlusButtonSubclass: CYLPlusButton,CYLPlusButtonSubclassing { 13 | 14 | 15 | static func plusButton() -> Any { 16 | let button = CYLPlusButtonSubclass() 17 | button.setImage(UIImage(named: "post_normal"), for: .normal) 18 | button.titleLabel?.textAlignment = .center 19 | 20 | button.titleLabel?.font = UIFont.systemFont(ofSize: 10) 21 | 22 | button.setTitle("发布", for: .normal) 23 | button.setTitleColor(UIColor.gray, for: .normal) 24 | 25 | button.setTitle("选中", for: .selected) 26 | button.setTitleColor(UIColor(red:255.0/255.0,green:102.0/255.0,blue:0,alpha:1.0), for: .selected) 27 | 28 | button.adjustsImageWhenHighlighted = false 29 | button.sizeToFit() 30 | return button 31 | } 32 | 33 | static func indexOfPlusButtonInTabBar() -> UInt { 34 | return 2 35 | } 36 | 37 | static func multiplier(ofTabBarHeight tabBarHeight: CGFloat) -> CGFloat { 38 | return 0.3 39 | } 40 | 41 | static func constantOfPlusButtonCenterYOffset(forTabBarHeight tabBarHeight: CGFloat) -> CGFloat { 42 | return -10 43 | } 44 | 45 | static func plusChildViewController() -> UIViewController { 46 | let vc = PublishViewController() 47 | let nav = UINavigationController(rootViewController: vc) 48 | return nav 49 | } 50 | 51 | 52 | static func shouldSelectPlusChildViewController() -> Bool { 53 | return true 54 | } 55 | 56 | override func layoutSubviews() { 57 | super.layoutSubviews() 58 | 59 | // tabbar UI layout setup 60 | let imageViewEdgeWidth:CGFloat = self.bounds.size.width * 0.7 61 | let imageViewEdgeHeight:CGFloat = imageViewEdgeWidth * 0.9 62 | 63 | let centerOfView = self.bounds.size.width * 0.5 64 | let labelLineHeight = self.titleLabel!.font.lineHeight 65 | let verticalMargin = (self.bounds.size.height - labelLineHeight - imageViewEdgeHeight ) * 0.5 66 | 67 | let centerOfImageView = verticalMargin + imageViewEdgeHeight * 0.5 68 | let centerOfTitleLabel = imageViewEdgeHeight + verticalMargin * 2 + labelLineHeight * 0.5 + 10 69 | 70 | //imageView position layout 71 | self.imageView!.bounds = CGRect(x:0, y:0, width:imageViewEdgeWidth, height:imageViewEdgeHeight) 72 | self.imageView!.center = CGPoint(x:centerOfView, y:centerOfImageView) 73 | 74 | //title position layout 75 | self.titleLabel!.bounds = CGRect(x:0, y:0, width:self.bounds.size.width,height:labelLineHeight) 76 | self.titleLabel!.center = CGPoint(x:centerOfView, y:centerOfTitleLabel) 77 | 78 | } 79 | 80 | 81 | } 82 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Main/MainTabBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainTabBarController.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/12/29. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CYLTabBarController 11 | 12 | class MainTabBarController: CYLTabBarController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | self.delegate = self 18 | } 19 | 20 | 21 | 22 | } 23 | 24 | extension MainTabBarController{ 25 | 26 | override func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool { 27 | self.updateSelectionStatusIfNeeded(for: tabBarController, shouldSelect: viewController) 28 | return true 29 | } 30 | 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Message/MessageViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessageViewController.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/12/29. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MessageViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | self.view.backgroundColor = UIColor.gray 17 | 18 | } 19 | 20 | override func didReceiveMemoryWarning() { 21 | super.didReceiveMemoryWarning() 22 | // Dispose of any resources that can be recreated. 23 | } 24 | 25 | 26 | /* 27 | // MARK: - Navigation 28 | 29 | // In a storyboard-based application, you will often want to do a little preparation before navigation 30 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 31 | // Get the new view controller using segue.destinationViewController. 32 | // Pass the selected object to the new view controller. 33 | } 34 | */ 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Other/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/10/12. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import CYLTabBarController 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate,UITabBarControllerDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | 19 | CYLPlusButtonSubclass.register() 20 | 21 | 22 | let mainTabBarVc = MainTabBarController(viewControllers: self.viewControllers(), tabBarItemsAttributes: self.tabBarItemsAttributesForController()) 23 | 24 | self.window = UIWindow() 25 | self.window?.frame = UIScreen.main.bounds 26 | self.window?.rootViewController = mainTabBarVc 27 | self.window?.makeKeyAndVisible() 28 | 29 | //tabbar背景色 30 | UITabBar.appearance().backgroundColor = UIColor.white 31 | //tabbar字体颜色 32 | UITabBar.appearance().tintColor = UIColor(red:255.0/255.0,green:102.0/255.0,blue:0,alpha:1.0) 33 | 34 | return true 35 | } 36 | 37 | 38 | func viewControllers() -> [UINavigationController]{ 39 | let home = UINavigationController(rootViewController: HomeViewController()) 40 | let connection = UINavigationController(rootViewController: ConnectionViewController()) 41 | let message = UINavigationController(rootViewController: MessageViewController()) 42 | let personal = UINavigationController(rootViewController: PersonalViewController()) 43 | let viewControllers = [home, connection, message, personal] 44 | 45 | return viewControllers 46 | 47 | } 48 | 49 | 50 | func tabBarItemsAttributesForController() -> [[String : String]] { 51 | 52 | let tabBarItemOne = [CYLTabBarItemTitle:"首页", 53 | CYLTabBarItemImage:"home_normal", 54 | CYLTabBarItemSelectedImage:"home_highlight"] 55 | 56 | let tabBarItemTwo = [CYLTabBarItemTitle:"同城", 57 | CYLTabBarItemImage:"mycity_normal", 58 | CYLTabBarItemSelectedImage:"mycity_highlight"] 59 | 60 | let tabBarItemThree = [CYLTabBarItemTitle:"消息", 61 | CYLTabBarItemImage:"message_normal", 62 | CYLTabBarItemSelectedImage:"message_highlight"] 63 | 64 | let tabBarItemFour = [CYLTabBarItemTitle:"我的", 65 | CYLTabBarItemImage:"account_normal", 66 | CYLTabBarItemSelectedImage:"account_highlight"] 67 | let tabBarItemsAttributes = [tabBarItemOne,tabBarItemTwo,tabBarItemThree,tabBarItemFour] 68 | return tabBarItemsAttributes 69 | } 70 | 71 | 72 | 73 | } 74 | 75 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Other/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/10/12. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class ViewController: UIViewController{ 13 | 14 | override func viewDidLoad() { 15 | 16 | super.viewDidLoad() 17 | 18 | 19 | } 20 | 21 | 22 | } 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Personal/PersonalViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PersonalViewController.swift 3 | // SwiftDemo 4 | // 5 | // Created by Anthony on 2017/12/29. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PersonalViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | self.view.backgroundColor = UIColor.green 17 | 18 | } 19 | 20 | override func didReceiveMemoryWarning() { 21 | super.didReceiveMemoryWarning() 22 | // Dispose of any resources that can be recreated. 23 | } 24 | 25 | 26 | /* 27 | // MARK: - Navigation 28 | 29 | // In a storyboard-based application, you will often want to do a little preparation before navigation 30 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 31 | // Get the new view controller using segue.destinationViewController. 32 | // Pass the selected object to the new view controller. 33 | } 34 | */ 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/Classes/Publish/PublishViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PublishViewController.swift 3 | // CYLTabbarController-Swift 4 | // 5 | // Created by Anthony on 2017/12/29. 6 | // Copyright © 2017年 Anthony. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class PublishViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | self.view.backgroundColor = UIColor.red 17 | 18 | // Do any additional setup after loading the view. 19 | } 20 | 21 | override func didReceiveMemoryWarning() { 22 | super.didReceiveMemoryWarning() 23 | // Dispose of any resources that can be recreated. 24 | } 25 | 26 | 27 | /* 28 | // MARK: - Navigation 29 | 30 | // In a storyboard-based application, you will often want to do a little preparation before navigation 31 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 32 | // Get the new view controller using segue.destinationViewController. 33 | // Pass the selected object to the new view controller. 34 | } 35 | */ 36 | 37 | } 38 | -------------------------------------------------------------------------------- /CYLTabBarController-Swift/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 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Anthony 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 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'CYLTabBarController-Swift' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | pod 'CYLTabBarController', '~> 1.29.0' 9 | 10 | # Pods for CYLTabBarController-Swift 11 | 12 | end 13 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CYLTabBarController (1.29.2): 3 | - CYLTabBarController/Core (= 1.29.2) 4 | - CYLTabBarController/Core (1.29.2) 5 | 6 | DEPENDENCIES: 7 | - CYLTabBarController (~> 1.29.0) 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - CYLTabBarController 12 | 13 | SPEC CHECKSUMS: 14 | CYLTabBarController: db44b5901a28693a8a4279e4721b3aafdd36c178 15 | 16 | PODFILE CHECKSUM: 435b9bc7cbc4668fd6d376281341c3746a5e149b 17 | 18 | COCOAPODS: 1.11.2 19 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CAAnimation+CYLBadgeExtention.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | typedef NS_ENUM(NSUInteger, CYLAxis) { 15 | CYLAxisX = 0, 16 | CYLAxisY, 17 | CYLAxisZ 18 | }; 19 | 20 | // Degrees to radians 21 | #define CYL_DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI) 22 | #define CYL_RADIANS_TO_DEGREES(radians) ((radians) * (180.0 / M_PI)) 23 | 24 | @interface CAAnimation (CYLBadgeExtention) 25 | 26 | /** 27 | * breathing forever 28 | * 29 | * @param time duritaion, from clear to fully seen 30 | * 31 | * @return animation obj 32 | */ 33 | + (CABasicAnimation *)cyl_opacityForever_Animation:(float)time; 34 | 35 | /** 36 | * breathing with fixed repeated times 37 | * 38 | * @param repeatTimes times 39 | * @param time duritaion, from clear to fully seen 40 | * 41 | * @return animation obj 42 | */ 43 | + (CABasicAnimation *)cyl_opacityTimes_Animation:(float)repeatTimes durTimes:(float)time; 44 | 45 | /** 46 | * //rotate 47 | * 48 | * @param dur duration 49 | * @param degree rotate degree in radian(弧度) 50 | * @param axis axis 51 | * @param repeatCount repeat count 52 | * 53 | * @return animation obj 54 | */ 55 | + (CABasicAnimation *)cyl_rotation:(float)dur degree:(float)degree direction:(CYLAxis)axis repeatCount:(int)repeatCount; 56 | 57 | 58 | /** 59 | * scale animation 60 | * 61 | * @param fromScale the original scale value, 1.0 by default 62 | * @param toScale target scale 63 | * @param time duration 64 | * @param repeatTimes repeat counts 65 | * 66 | * @return animaiton obj 67 | */ 68 | + (CABasicAnimation *)cyl_scaleFrom:(CGFloat)fromScale toScale:(CGFloat)toScale durTimes:(float)time rep:(float)repeatTimes; 69 | /** 70 | * shake 71 | * 72 | * @param repeatTimes time 73 | * @param time duration 74 | * @param obj always be CALayer at present 75 | * @return aniamtion obj 76 | */ 77 | + (CAKeyframeAnimation *)cyl_shake_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj; 78 | 79 | /** 80 | * bounce 81 | * 82 | * @param repeatTimes time 83 | * @param time duration 84 | * @param obj always be CALayer at present 85 | * @return aniamtion obj 86 | */ 87 | + (CAKeyframeAnimation *)cyl_bounce_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj; 88 | 89 | @end 90 | 91 | NS_ASSUME_NONNULL_END 92 | 93 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CAAnimation+CYLBadgeExtention.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import "CAAnimation+CYLBadgeExtention.h" 10 | #import 11 | 12 | @implementation CAAnimation (CYLBadgeExtention) 13 | /** 14 | * breathing forever 15 | * 16 | * @param time duritaion, from clear to fully seen 17 | * 18 | * @return animation obj 19 | */ 20 | + (CABasicAnimation *)cyl_opacityForever_Animation:(float)time { 21 | CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"opacity"]; 22 | animation.fromValue=[NSNumber numberWithFloat:1.0]; 23 | animation.toValue=[NSNumber numberWithFloat:0.1]; 24 | animation.autoreverses=YES; 25 | animation.duration=time; 26 | animation.repeatCount=FLT_MAX; 27 | animation.removedOnCompletion=NO; 28 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 29 | animation.fillMode=kCAFillModeForwards; 30 | return animation; 31 | } 32 | 33 | /** 34 | * breathing with fixed repeated times 35 | * 36 | * @param repeatTimes times 37 | * @param time duritaion, from clear to fully seen 38 | * 39 | * @return animation obj 40 | */ 41 | + (CABasicAnimation *)cyl_opacityTimes_Animation:(float)repeatTimes durTimes:(float)time { 42 | CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"opacity"]; 43 | animation.fromValue=[NSNumber numberWithFloat:1.0]; 44 | animation.toValue=[NSNumber numberWithFloat:0.4]; 45 | animation.repeatCount=repeatTimes; 46 | animation.duration=time; 47 | animation.removedOnCompletion=NO; 48 | animation.fillMode=kCAFillModeForwards; 49 | animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 50 | animation.autoreverses=YES; 51 | return animation; 52 | } 53 | 54 | /** 55 | * //rotate 56 | * 57 | * @param dur duration 58 | * @param degree rotate degree in radian(弧度) 59 | * @param axis axis 60 | * @param repeatCount repeat count 61 | * 62 | * @return animation obj 63 | */ 64 | + (CABasicAnimation *)cyl_rotation:(float)dur degree:(float)degree direction:(CYLAxis)axis repeatCount:(int)repeatCount { 65 | CABasicAnimation* animation; 66 | NSArray *axisArr = @[@"transform.rotation.x", @"transform.rotation.y", @"transform.rotation.z"]; 67 | animation = [CABasicAnimation animationWithKeyPath:axisArr[axis]]; 68 | animation.fromValue = [NSNumber numberWithFloat:0]; 69 | animation.toValue= [NSNumber numberWithFloat:degree]; 70 | animation.duration= dur; 71 | animation.autoreverses= NO; 72 | animation.cumulative= YES; 73 | animation.removedOnCompletion=NO; 74 | animation.fillMode=kCAFillModeForwards; 75 | animation.repeatCount= repeatCount; 76 | 77 | return animation; 78 | } 79 | 80 | /** 81 | * scale animation 82 | * 83 | * @param fromScale the original scale value, 1.0 by default 84 | * @param toScale target scale 85 | * @param time duration 86 | * @param repeatTimes repeat counts 87 | * 88 | * @return animaiton obj 89 | */ 90 | + (CABasicAnimation *)cyl_scaleFrom:(CGFloat)fromScale toScale:(CGFloat)toScale durTimes:(float)time rep:(float)repeatTimes { 91 | CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"]; 92 | animation.fromValue = @(fromScale); 93 | animation.toValue = @(toScale); 94 | animation.duration = time; 95 | animation.autoreverses = YES; 96 | animation.repeatCount = repeatTimes; 97 | animation.removedOnCompletion = NO; 98 | animation.fillMode = kCAFillModeForwards; 99 | return animation; 100 | } 101 | 102 | /** 103 | * shake 104 | * 105 | * @param repeatTimes time 106 | * @param time duration 107 | * @param obj always be CALayer 108 | * @return aniamtion obj 109 | */ 110 | + (CAKeyframeAnimation *)cyl_shake_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj { 111 | NSAssert([obj isKindOfClass:[CALayer class]] , @"invalid target"); 112 | CGPoint originPos = CGPointZero; 113 | CGSize originSize = CGSizeZero; 114 | if ([obj isKindOfClass:[CALayer class]]) { 115 | originPos = [(CALayer *)obj position]; 116 | originSize = [(CALayer *)obj bounds].size; 117 | } 118 | CGFloat hOffset = originSize.width / 4; 119 | CAKeyframeAnimation* anim=[CAKeyframeAnimation animation]; 120 | anim.keyPath=@"position"; 121 | anim.values=@[ 122 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)], 123 | [NSValue valueWithCGPoint:CGPointMake(originPos.x-hOffset, originPos.y)], 124 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)], 125 | [NSValue valueWithCGPoint:CGPointMake(originPos.x+hOffset, originPos.y)], 126 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)] 127 | ]; 128 | anim.repeatCount = repeatTimes; 129 | anim.duration = time; 130 | anim.fillMode = kCAFillModeForwards; 131 | return anim; 132 | } 133 | 134 | /** 135 | * bounce 136 | * 137 | * @param repeatTimes time 138 | * @param time duration 139 | * @param obj always be CALayer 140 | * @return aniamtion obj 141 | */ 142 | + (CAKeyframeAnimation *)cyl_bounce_AnimationRepeatTimes:(float)repeatTimes durTimes:(float)time forObj:(id)obj { 143 | NSAssert([obj isKindOfClass:[CALayer class]] , @"invalid target"); 144 | CGPoint originPos = CGPointZero; 145 | CGSize originSize = CGSizeZero; 146 | if ([obj isKindOfClass:[CALayer class]]) { 147 | originPos = [(CALayer *)obj position]; 148 | originSize = [(CALayer *)obj bounds].size; 149 | } 150 | CGFloat hOffset = originSize.height / 4; 151 | CAKeyframeAnimation* anim=[CAKeyframeAnimation animation]; 152 | anim.keyPath=@"position"; 153 | anim.values=@[ 154 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)], 155 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y-hOffset)], 156 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)], 157 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y+hOffset)], 158 | [NSValue valueWithCGPoint:CGPointMake(originPos.x, originPos.y)] 159 | ]; 160 | anim.repeatCount=repeatTimes; 161 | anim.duration=time; 162 | anim.fillMode = kCAFillModeForwards; 163 | return anim; 164 | } 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLBadgeProtocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | //CYLBadgeProtocol is a protocol which any Class supported (such UIView and UIBarButtonItem) should confirm 10 | //At present, there are two classes support CYLBadgeExtention(UIView and UIBarButtonItem). However, there may be more classes to support. Thus, it is necessary to abstract a protocol. 20150812. 11 | 12 | 13 | #ifndef CYLBadgeDemo_CYLBadgeProtocol_h 14 | #define CYLBadgeDemo_CYLBadgeProtocol_h 15 | 16 | #pragma mark -- types definition 17 | 18 | #define CYLBadgeBreatheAnimationKey @"breathe" 19 | #define CYLBadgeRotateAnimationKey @"rotate" 20 | #define CYLBadgeShakeAnimationKey @"shake" 21 | #define CYLBadgeScaleAnimationKey @"scale" 22 | #define CYLBadgeBounceAnimationKey @"bounce" 23 | 24 | typedef NS_ENUM(NSUInteger, CYLBadgeStyle) { 25 | CYLBadgeStyleRedDot = 1, /* red dot style */ 26 | CYLBadgeStyleNumber, /* badge with number */ 27 | CYLBadgeStyleNew, /* badge with a fixed text "new" */ 28 | CYLBadgeStyleOther /* badge with a fixed text */ 29 | }; 30 | 31 | typedef NS_ENUM(NSUInteger, CYLBadgeAnimationType) { 32 | CYLBadgeAnimationTypeNone = 0, /* without animation, badge stays still */ 33 | CYLBadgeAnimationTypeScale, /* scale effect */ 34 | CYLBadgeAnimationTypeShake, /* shaking effect */ 35 | CYLBadgeAnimationTypeBounce, /* bouncing effect */ 36 | CYLBadgeAnimationTypeBreathe /* breathing light effect, which makes badge more attractive */ 37 | }; 38 | 39 | #pragma mark -- protocol definition 40 | 41 | @protocol CYLBadgeProtocol 42 | 43 | @required 44 | 45 | @property (nonatomic, strong, getter=cyl_badge, setter=cyl_setBadge:) UILabel *cyl_badge; /* badge entity, which is adviced not to set manually */ 46 | 47 | @property (nonatomic, strong, getter=cyl_badgeFont, setter=cyl_setBadgeFont:) UIFont *cyl_badgeFont; /* [UIFont boldSystemFontOfSize:9] by default if not set */ 48 | 49 | @property (nonatomic, strong, getter=cyl_badgeBackgroundColor, setter=cyl_setBadgeBackgroundColor:) UIColor *cyl_badgeBackgroundColor; /* red color by default if not set */ 50 | @property (nonatomic, strong, getter=cyl_badgeTextColor, setter=cyl_setBadgeTextColor:) UIColor *cyl_badgeTextColor; /* white color by default if not set */ 51 | @property (nonatomic, assign, getter=cyl_badgeFrame, setter=cyl_setBadgeFrame:) CGRect cyl_badgeFrame; /* we have optimized the badge frame and center. 52 | This property is adviced not to set manually */ 53 | 54 | @property (nonatomic, assign, getter=cyl_badgeCenterOffset, setter=cyl_setBadgeCenterOffset:) CGPoint cyl_badgeCenterOffset; /* offset from right-top corner. {0,0} by default */ 55 | /* For x, negative number means left offset 56 | For y, negative number means bottom offset */ 57 | 58 | @property (nonatomic, assign, getter=cyl_badgeAnimationType, setter=cyl_setBadgeAnimationType:) CYLBadgeAnimationType cyl_badgeAnimationType;/* NOTE that this is not animation type of badge's 59 | // appearing, nor hidding*/ 60 | 61 | @property (nonatomic, assign, getter=cyl_badgeMaximumBadgeNumber, setter=cyl_setBadgeMaximumBadgeNumber:) NSInteger cyl_badgeMaximumBadgeNumber; /*for CYLBadgeStyleNumber style badge, 62 | if badge value is above badgeMaximumBadgeNumber, 63 | "badgeMaximumBadgeNumber+" will be printed. */ 64 | 65 | @property (nonatomic, assign, getter=cyl_badgeRadius, setter=cyl_setBadgeRadius:) CGFloat cyl_badgeRadius; 66 | 67 | @property (nonatomic, assign, getter=cyl_badgeMargin, setter=cyl_setBadgeMargin:) CGFloat cyl_badgeMargin; /**< // normal use for text and number style of badge */ 68 | 69 | @property (nonatomic, assign, getter=cyl_badgeCornerRadius, setter=cyl_setBadgeCornerRadius:) CGFloat cyl_badgeCornerRadius; 70 | 71 | - (BOOL)cyl_isShowBadge; 72 | 73 | /** 74 | * show badge with red dot style and CYLBadgeAnimationTypeNone by default. 75 | */ 76 | - (void)cyl_showBadge; 77 | 78 | /** 79 | * 80 | * @param value String value, default is `nil`. if value equal @"" means red dot style. 81 | * @param animationType animationType 82 | * @attention 83 | - 调用该方法前已经添加了系统的角标,调用该方法后,系统的角标并未被移除,只是被隐藏,调用 `-cyl_removeTabBadgePoint` 后会重新展示。 84 | - 不支持 CYLPlusChildViewController 对应的 TabBarItem 角标设置,调用会被忽略。 85 | */ 86 | - (void)cyl_showBadgeValue:(NSString *)value 87 | animationType:(CYLBadgeAnimationType)animationType; 88 | 89 | /** 90 | * clear badge(hide badge) 91 | */ 92 | - (void)cyl_clearBadge; 93 | 94 | /** 95 | * make bage(if existing) not hiden 96 | */ 97 | - (void)cyl_resumeBadge; 98 | 99 | - (BOOL)cyl_isPauseBadge; 100 | 101 | @end 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLBaseNavigationController.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CYLBaseNavigationController : UINavigationController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLBaseNavigationController.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import "CYLBaseNavigationController.h" 10 | 11 | @interface CYLBaseNavigationController () 12 | 13 | @end 14 | 15 | @implementation CYLBaseNavigationController 16 | 17 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { 18 | // 当前导航栏, 只有第一个viewController push的时候设置隐藏 19 | if (self.viewControllers.count == 1) { 20 | viewController.hidesBottomBarWhenPushed = YES; 21 | } else { 22 | viewController.hidesBottomBarWhenPushed = NO; 23 | } 24 | [super pushViewController:viewController animated:animated]; 25 | } 26 | 27 | //fix https://github.com/ChenYilong/CYLTabBarController/issues/483 28 | - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated { 29 | if (self.viewControllers.count > 1) { 30 | UIViewController *viewController = [self.viewControllers lastObject]; 31 | viewController.hidesBottomBarWhenPushed = YES; 32 | } 33 | [super setViewControllers:viewControllers animated:animated]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLBaseTableViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CYLBaseTableViewController : UITableViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLBaseTableViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | 10 | #import "CYLBaseTableViewController.h" 11 | #import "CYLTabBarController.h" 12 | 13 | @interface CYLBaseTableViewController () 14 | 15 | @end 16 | 17 | @implementation CYLBaseTableViewController 18 | 19 | #pragma mark - 20 | #pragma mark - UIViewController Life 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | } 25 | 26 | - (void)viewWillAppear:(BOOL)animated { 27 | [super viewWillAppear:animated]; 28 | [self cyl_viewWillAppearNavigationSetting:animated]; 29 | } 30 | 31 | - (void)viewDidAppear:(BOOL)animated { 32 | [super viewDidAppear:animated]; 33 | [self cyl_viewDidAppearNavigationSetting:animated]; 34 | } 35 | 36 | - (void)viewWillDisappear:(BOOL)animated { 37 | [super viewWillDisappear:animated]; 38 | [self cyl_viewWillDisappearNavigationSetting:animated]; 39 | } 40 | 41 | - (void)viewDidDisappear:(BOOL)animated { 42 | [super viewDidDisappear:animated]; 43 | [self cyl_viewDidDisappearNavigationSetting:animated]; 44 | } 45 | 46 | - (void)didReceiveMemoryWarning { 47 | [super didReceiveMemoryWarning]; 48 | } 49 | 50 | - (void)dealloc { 51 | [self cyl_deallocNavigationSetting]; 52 | } 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLBaseViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CYLBaseViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLBaseViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import "CYLBaseViewController.h" 10 | #import "CYLTabBarController.h" 11 | 12 | @interface CYLBaseViewController () 13 | 14 | @end 15 | 16 | @implementation CYLBaseViewController 17 | 18 | #pragma mark - 19 | #pragma mark - UIViewController Life 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | } 24 | 25 | - (void)viewWillAppear:(BOOL)animated { 26 | [super viewWillAppear:animated]; 27 | [self cyl_viewWillAppearNavigationSetting:animated]; 28 | } 29 | 30 | - (void)viewDidAppear:(BOOL)animated { 31 | [super viewDidAppear:animated]; 32 | [self cyl_viewDidAppearNavigationSetting:animated]; 33 | } 34 | 35 | - (void)viewWillDisappear:(BOOL)animated { 36 | [super viewWillDisappear:animated]; 37 | [self cyl_viewWillDisappearNavigationSetting:animated]; 38 | } 39 | 40 | - (void)viewDidDisappear:(BOOL)animated { 41 | [super viewDidDisappear:animated]; 42 | [self cyl_viewDidDisappearNavigationSetting:animated]; 43 | } 44 | 45 | - (void)didReceiveMemoryWarning { 46 | [super didReceiveMemoryWarning]; 47 | } 48 | 49 | - (void)dealloc { 50 | [self cyl_deallocNavigationSetting]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #ifndef CYLConstants_h 10 | #define CYLConstants_h 11 | 12 | #define CYL_DEPRECATED(explain) __attribute__((deprecated(explain))) 13 | #define CYL_IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) 14 | 15 | #define CYL_IS_IOS_11 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.f) 16 | #define CYL_IS_IPHONE_X (CYL_IS_IOS_11 && CYL_IS_IPHONE && (MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 375 && MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) >= 812)) 17 | 18 | #define CYL_SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) 19 | #define CYL_SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) 20 | #define CYL_SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 21 | #define CYL_SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) 22 | #define CYL_SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) 23 | 24 | 25 | #endif /* CYLConstants_h */ 26 | 27 | 28 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLPlusButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLPlusButton.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CYLConstants.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class CYLPlusButton; 15 | 16 | @protocol CYLPlusButtonSubclassing 17 | 18 | @required 19 | + (id)plusButton; 20 | @optional 21 | 22 | /*! 23 | * 用来自定义加号按钮的位置,如果不实现默认居中。 24 | * @attention 以下两种情况下,必须实现该协议方法,否则 CYLTabBarController 会抛出 exception 来进行提示: 25 | 1. 添加了 PlusButton 且 TabBarItem 的个数是奇数。 26 | 2. 实现了 `+plusChildViewController`。 27 | * @return 用来自定义加号按钮在 TabBar 中的位置。 28 | * 29 | */ 30 | + (NSUInteger)indexOfPlusButtonInTabBar; 31 | 32 | /*! 33 | * 该方法是为了调整 PlusButton 中心点Y轴方向的位置,建议在按钮超出了 tabbar 的边界时实现该方法。 34 | * @attention 如果不实现该方法,内部会自动进行比对,预设一个较为合适的位置,如果实现了该方法,预设的逻辑将失效。 35 | * @return 返回值是自定义按钮中心点Y轴方向的坐标除以 tabbar 的高度, 36 | 内部实现时,会使用该返回值来设置 PlusButton 的 centerY 坐标,公式如下: 37 | `PlusButtonCenterY = multiplierOfTabBarHeight * tabBarHeight + constantOfPlusButtonCenterYOffset;` 38 | 也就是说:如果 constantOfPlusButtonCenterYOffset 为0,同时 multiplierOfTabBarHeight 的值是0.5,表示 PlusButton 居中,小于0.5表示 PlusButton 偏上,大于0.5则表示偏下。 39 | * 40 | */ 41 | + (CGFloat)multiplierOfTabBarHeight:(CGFloat)tabBarHeight; 42 | 43 | /*! 44 | * 见 `+multiplierOfTabBarHeight:` 注释: 45 | * `PlusButtonCenterY = multiplierOfTabBarHeight * tabBarHeight + constantOfPlusButtonCenterYOffset;` 46 | * 也就是说: constantOfPlusButtonCenterYOffset 大于0会向下偏移,小于0会向上偏移。 47 | * @attention 实现了该方法,但没有实现 `+multiplierOfTabBarHeight:` 方法,在这种情况下,会在预设逻辑的基础上进行偏移。 48 | */ 49 | + (CGFloat)constantOfPlusButtonCenterYOffsetForTabBarHeight:(CGFloat)tabBarHeight; 50 | 51 | /*! 52 | * 实现该方法后,能让 PlusButton 的点击效果与跟点击其他 TabBar 按钮效果一样,跳转到该方法指定的 UIViewController 。 53 | * @attention 必须同时实现 `+indexOfPlusButtonInTabBar` 来指定 PlusButton 的位置。 54 | * @return 指定 PlusButton 点击后跳转的 UIViewController。 55 | * 56 | */ 57 | + (UIViewController *)plusChildViewController; 58 | 59 | /*! 60 | * 61 | Asks the delegate whether the specified view controller should be made active. 62 | Return YES if the view controller’s tab should be selected or NO if the current tab should remain active. 63 | Returns YES true if the view controller’s tab should be selected or 64 | NO false if the current tab should remain active. 65 | */ 66 | + (BOOL)shouldSelectPlusChildViewController; 67 | 68 | #pragma mark - Deprecated API 69 | 70 | + (CGFloat)multiplerInCenterY CYL_DEPRECATED("Deprecated in 1.6.0. Use `+multiplierOfTabBarHeight:` instead."); 71 | 72 | + (NSString *)tabBarContext; 73 | 74 | @end 75 | 76 | @class CYLTabBar; 77 | 78 | FOUNDATION_EXTERN UIButton *CYLExternPlusButton; 79 | FOUNDATION_EXTERN UIViewController *CYLPlusChildViewController; 80 | 81 | @interface CYLPlusButton : UIButton 82 | 83 | + (void)registerPlusButton; 84 | + (void)removePlusButton; 85 | - (void)plusChildViewControllerButtonClicked:(UIButton *)sender; 86 | 87 | @end 88 | 89 | #pragma mark - Deprecated API 90 | 91 | @interface CYLPlusButton (CYLPlusButtonDeprecated) 92 | 93 | + (void)registerSubclass CYL_DEPRECATED("Deprecated in 1.6.0. Use `+[CYLPlusButton registerPlusButton]` instead."); 94 | 95 | @end 96 | 97 | NS_ASSUME_NONNULL_END 98 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLPlusButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLPlusButton.m 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "CYLPlusButton.h" 10 | #import "CYLTabBarController.h" 11 | #import "UIViewController+CYLTabBarControllerExtention.h" 12 | 13 | CGFloat CYLPlusButtonWidth = 0.0f; 14 | UIButton *CYLExternPlusButton = nil; 15 | UIViewController *CYLPlusChildViewController = nil; 16 | 17 | @implementation CYLPlusButton 18 | 19 | #pragma mark - 20 | #pragma mark - public Methods 21 | 22 | + (void)registerPlusButton { 23 | if (![self conformsToProtocol:@protocol(CYLPlusButtonSubclassing)]) { 24 | return; 25 | } 26 | Class class = self; 27 | UIButton *plusButton = [class plusButton]; 28 | CYLExternPlusButton = plusButton; 29 | CYLPlusButtonWidth = plusButton.frame.size.width; 30 | if ([[self class] respondsToSelector:@selector(plusChildViewController)]) { 31 | CYLPlusChildViewController = [class plusChildViewController]; 32 | if ([[self class] respondsToSelector:@selector(tabBarContext)]) { 33 | NSString *tabBarContext = [class tabBarContext]; 34 | if (tabBarContext && tabBarContext.length) { 35 | [CYLPlusChildViewController cyl_setContext:tabBarContext]; 36 | } 37 | } else { 38 | [CYLPlusChildViewController cyl_setContext:NSStringFromClass([CYLTabBarController class])]; 39 | } 40 | [[self class] addSelectViewControllerTarget:plusButton]; 41 | if ([[self class] respondsToSelector:@selector(indexOfPlusButtonInTabBar)]) { 42 | CYLPlusButtonIndex = [[self class] indexOfPlusButtonInTabBar]; 43 | } else { 44 | [NSException raise:NSStringFromClass([CYLTabBarController class]) format:@"If you want to add PlusChildViewController, you must realizse `+indexOfPlusButtonInTabBar` in your custom plusButton class.【Chinese】如果你想使用PlusChildViewController样式,你必须同时在你自定义的plusButton中实现 `+indexOfPlusButtonInTabBar`,来指定plusButton的位置"]; 45 | } 46 | } 47 | } 48 | 49 | + (void)removePlusButton { 50 | CYLExternPlusButton = nil; 51 | [CYLPlusChildViewController cyl_setPlusViewControllerEverAdded:NO]; 52 | CYLPlusChildViewController = nil; 53 | } 54 | 55 | + (void)registerSubclass { 56 | [self registerPlusButton]; 57 | } 58 | 59 | - (void)plusChildViewControllerButtonClicked:(UIButton *)sender { 60 | BOOL notNeedConfigureSelectionStatus = [[self class] respondsToSelector:@selector(shouldSelectPlusChildViewController)] && ![[self class] shouldSelectPlusChildViewController]; 61 | if (notNeedConfigureSelectionStatus) { 62 | return; 63 | } 64 | CYLTabBarController *tabBarController = [sender cyl_tabBarController]; 65 | NSInteger index = [tabBarController.viewControllers indexOfObject:CYLPlusChildViewController]; 66 | if (NSNotFound != index && (index < tabBarController.viewControllers.count)) { 67 | [tabBarController setSelectedIndex:index]; 68 | } 69 | } 70 | 71 | #pragma mark - 72 | #pragma mark - Private Methods 73 | 74 | + (void)addSelectViewControllerTarget:(UIButton *)plusButton { 75 | id target = self; 76 | NSArray *selectorNamesArray = [plusButton actionsForTarget:target forControlEvent:UIControlEventTouchUpInside]; 77 | if (selectorNamesArray.count == 0) { 78 | target = plusButton; 79 | selectorNamesArray = [plusButton actionsForTarget:target forControlEvent:UIControlEventTouchUpInside]; 80 | } 81 | [selectorNamesArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 82 | SEL selector = NSSelectorFromString(obj); 83 | [plusButton removeTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; 84 | }]; 85 | [plusButton addTarget:plusButton action:@selector(plusChildViewControllerButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; 86 | } 87 | 88 | /** 89 | * 按钮选中状态下点击先显示normal状态的颜色,松开时再回到selected状态下颜色。 90 | * 重写此方法即不会出现上述情况,与 UITabBarButton 相似 91 | */ 92 | - (void)setHighlighted:(BOOL)highlighted {} 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLTabBar+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | #import "CYLTabBar.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface CYLTabBar (CYLTabBarControllerExtention) 15 | 16 | - (NSArray *)cyl_visibleControls; 17 | - (NSArray *)cyl_subTabBarButtons; 18 | - (NSArray *)cyl_subTabBarButtonsWithoutPlusButton; 19 | - (UIControl *)cyl_tabBarButtonWithTabIndex:(NSUInteger)tabIndex; 20 | - (void)cyl_animationLottieImageWithSelectedControl:(UIControl *)selectedControl 21 | lottieURL:(NSURL *)lottieURL 22 | size:(CGSize)size 23 | defaultSelected:(BOOL)defaultSelected; 24 | - (void)cyl_stopAnimationOfAllLottieView; 25 | - (NSArray *)cyl_originalTabBarButtons; 26 | - (BOOL)cyl_hasPlusChildViewController; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLTabBar+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import "CYLTabBar+CYLTabBarControllerExtention.h" 10 | #import "UIView+CYLTabBarControllerExtention.h" 11 | #import "UIControl+CYLTabBarControllerExtention.h" 12 | #import "CYLTabBarController.h" 13 | #import 14 | 15 | #import "CYLTabBar.h" 16 | #if __has_include() 17 | #import 18 | #else 19 | #endif 20 | 21 | @implementation CYLTabBar (CYLTabBarControllerExtention) 22 | 23 | - (BOOL)cyl_hasPlusChildViewController { 24 | NSString *context = CYLPlusChildViewController.cyl_context; 25 | BOOL isSameContext = [context isEqualToString:self.context] && (context && (context.length > 0) && self.context && self.context.length > 0); 26 | BOOL isAdded = [[self cyl_tabBarController].viewControllers containsObject:CYLPlusChildViewController]; 27 | BOOL isEverAdded = CYLPlusChildViewController.cyl_plusViewControllerEverAdded; 28 | if (CYLPlusChildViewController && isSameContext && isAdded && isEverAdded) { 29 | return YES; 30 | } 31 | return NO; 32 | } 33 | 34 | - (NSArray *)cyl_originalTabBarButtons { 35 | NSArray *tabBarButtons = [self cyl_tabBarButtonFromTabBarSubviews:[self cyl_sortedSubviews]]; 36 | return tabBarButtons; 37 | } 38 | 39 | - (NSArray *)cyl_sortedSubviews { 40 | if (self.subviews.count == 0) { 41 | return self.subviews; 42 | } 43 | NSMutableArray *tabBarButtonArray = [NSMutableArray arrayWithCapacity:self.subviews.count]; 44 | [self.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 45 | if ([obj cyl_isTabButton]) { 46 | [tabBarButtonArray addObject:obj]; 47 | } 48 | }]; 49 | 50 | NSArray *sortedSubviews = [[tabBarButtonArray copy] sortedArrayUsingComparator:^NSComparisonResult(UIView * formerView, UIView * latterView) { 51 | CGFloat formerViewX = formerView.frame.origin.x; 52 | CGFloat latterViewX = latterView.frame.origin.x; 53 | return (formerViewX > latterViewX) ? NSOrderedDescending : NSOrderedAscending; 54 | }]; 55 | return sortedSubviews; 56 | } 57 | 58 | - (NSArray *)cyl_tabBarButtonFromTabBarSubviews:(NSArray *)tabBarSubviews { 59 | if (tabBarSubviews.count == 0) { 60 | return tabBarSubviews; 61 | } 62 | NSMutableArray *tabBarButtonMutableArray = [NSMutableArray arrayWithCapacity:tabBarSubviews.count]; 63 | [tabBarSubviews enumerateObjectsUsingBlock:^(UIControl * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 64 | if ([obj cyl_isTabButton]) { 65 | [tabBarButtonMutableArray addObject:obj]; 66 | [obj cyl_setTabBarChildViewControllerIndex:idx]; 67 | } 68 | }]; 69 | if ([self cyl_hasPlusChildViewController]) { 70 | @try { 71 | UIControl *control = tabBarButtonMutableArray[CYLPlusButtonIndex]; 72 | control.userInteractionEnabled = NO; 73 | control.hidden = YES; 74 | } @catch (NSException *exception) {} 75 | } 76 | return [tabBarButtonMutableArray copy]; 77 | } 78 | 79 | - (NSArray *)cyl_visibleControls { 80 | NSMutableArray *originalTabBarButtons = [NSMutableArray arrayWithArray:[self.cyl_originalTabBarButtons copy]]; 81 | BOOL notAdded = (NSNotFound == [originalTabBarButtons indexOfObject:CYLExternPlusButton]); 82 | if (CYLExternPlusButton && notAdded) { 83 | [originalTabBarButtons addObject:CYLExternPlusButton]; 84 | } 85 | if (originalTabBarButtons.count == 0) { 86 | return nil; 87 | } 88 | NSMutableArray *tabBarButtonArray = [NSMutableArray arrayWithCapacity:originalTabBarButtons.count]; 89 | [originalTabBarButtons enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 90 | CGFloat width = obj.frame.size.width; 91 | BOOL isInvisiable = obj.cyl_canNotResponseEvent; 92 | BOOL isNotSubView = (width < 10); 93 | BOOL canNotResponseEvent = isInvisiable || isNotSubView ; 94 | if (canNotResponseEvent) { 95 | return; 96 | } 97 | if (([obj cyl_isTabButton] || [obj cyl_isPlusButton] ) ) { 98 | [tabBarButtonArray addObject:obj]; 99 | } 100 | }]; 101 | 102 | NSArray *sortedSubviews = [[tabBarButtonArray copy] sortedArrayUsingComparator:^NSComparisonResult(UIView * formerView, UIView * latterView) { 103 | CGFloat formerViewX = formerView.frame.origin.x; 104 | CGFloat latterViewX = latterView.frame.origin.x; 105 | return (formerViewX > latterViewX) ? NSOrderedDescending : NSOrderedAscending; 106 | }]; 107 | return sortedSubviews; 108 | } 109 | 110 | - (NSArray *)cyl_subTabBarButtons { 111 | NSMutableArray *subControls = [NSMutableArray arrayWithCapacity:self.cyl_visibleControls.count]; 112 | [self.cyl_visibleControls enumerateObjectsUsingBlock:^(UIControl * _Nonnull control, NSUInteger idx, BOOL * _Nonnull stop) { 113 | if ([control cyl_isPlusButton] && !CYLPlusChildViewController.cyl_plusViewControllerEverAdded) { 114 | return; 115 | } 116 | [subControls addObject:control]; 117 | }]; 118 | return subControls; 119 | } 120 | 121 | - (NSArray *)cyl_subTabBarButtonsWithoutPlusButton { 122 | NSMutableArray *subControls = [NSMutableArray arrayWithCapacity:self.cyl_visibleControls.count]; 123 | [self.cyl_visibleControls enumerateObjectsUsingBlock:^(UIControl * _Nonnull control, NSUInteger idx, BOOL * _Nonnull stop) { 124 | if ([control cyl_isPlusButton]) { 125 | return; 126 | } 127 | [subControls addObject:control]; 128 | }]; 129 | return subControls; 130 | } 131 | 132 | - (UIControl *)cyl_tabBarButtonWithTabIndex:(NSUInteger)tabIndex { 133 | UIControl *selectedControl = [self cyl_visibleControlWithIndex:tabIndex]; 134 | 135 | NSInteger plusViewControllerIndex = [self.cyl_tabBarController.viewControllers indexOfObject:CYLPlusChildViewController]; 136 | BOOL isPlusViewControllerAdded = CYLPlusChildViewController.cyl_plusViewControllerEverAdded && (plusViewControllerIndex != NSNotFound); 137 | 138 | if (isPlusViewControllerAdded) { 139 | return selectedControl; 140 | } 141 | 142 | @try { 143 | selectedControl = [self cyl_subTabBarButtonsWithoutPlusButton][tabIndex]; 144 | } @catch (NSException *exception) { 145 | NSLog(@"🔴类名与方法名:%@(在第%@行),描述:%@", @(__PRETTY_FUNCTION__), @(__LINE__), exception.reason); 146 | } 147 | return selectedControl; 148 | } 149 | 150 | - (UIControl *)cyl_visibleControlWithIndex:(NSUInteger)index { 151 | UIControl *selectedControl; 152 | @try { 153 | NSArray *subControls = self.cyl_visibleControls; 154 | selectedControl = subControls[index]; 155 | } @catch (NSException *exception) { 156 | NSLog(@"🔴类名与方法名:%@(在第%@行),描述:%@", @(__PRETTY_FUNCTION__), @(__LINE__), exception.reason); 157 | } 158 | return selectedControl; 159 | } 160 | - (void)cyl_animationLottieImageWithSelectedControl:(UIControl *)selectedControl 161 | lottieURL:(NSURL *)lottieURL 162 | size:(CGSize)size 163 | defaultSelected:(BOOL)defaultSelected { 164 | #if __has_include() 165 | [selectedControl cyl_addLottieImageWithLottieURL:lottieURL size:size]; 166 | [self cyl_stopAnimationOfAllLottieView]; 167 | LOTAnimationView *lottieView = selectedControl.cyl_lottieAnimationView; 168 | if (!lottieView) { 169 | [selectedControl cyl_addLottieImageWithLottieURL:lottieURL size:size]; 170 | } 171 | if (lottieView && [lottieView isKindOfClass:[LOTAnimationView class]]) { 172 | if (defaultSelected) { 173 | lottieView.animationProgress = 1; 174 | [lottieView forceDrawingUpdate]; 175 | return; 176 | } 177 | lottieView.animationProgress = 0; 178 | [lottieView play]; 179 | } 180 | #else 181 | #endif 182 | } 183 | 184 | - (void)cyl_stopAnimationOfAllLottieView { 185 | #if __has_include() 186 | [self.cyl_visibleControls enumerateObjectsUsingBlock:^(UIControl * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 187 | [obj.cyl_lottieAnimationView stop]; 188 | }]; 189 | #else 190 | #endif 191 | } 192 | 193 | @end 194 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLTabBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBar.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CYLTabBar : UITabBar 14 | 15 | /*! 16 | * 让 `TabImageView` 垂直居中时,所需要的默认偏移量。 17 | * @attention 该值将在设置 top 和 bottom 时被同时使用,具体的操作等价于如下行为: 18 | * `viewController.tabBarItem.imageInsets = UIEdgeInsetsMake(tabImageViewDefaultOffset, 0, -tabImageViewDefaultOffset, 0);` 19 | */ 20 | @property (nonatomic, assign, readonly) CGFloat tabImageViewDefaultOffset; 21 | 22 | @property (nonatomic, copy) NSString *context; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/CYLTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "CYLPlusButton.h" 10 | #import "UIViewController+CYLTabBarControllerExtention.h" 11 | #import "UIViewController+CYLNavigationControllerExtention.h" 12 | #import "UIView+CYLTabBarControllerExtention.h" 13 | #import "UITabBarItem+CYLTabBarControllerExtention.h" 14 | #import "UIControl+CYLTabBarControllerExtention.h" 15 | #import "CYLBaseViewController.h" 16 | #import "CYLBaseTableViewController.h" 17 | #import "CYLBaseNavigationController.h" 18 | #import "CYLTabBar+CYLTabBarControllerExtention.h" 19 | #import "UITabBarItem+CYLBadgeExtention.h" 20 | #import "UIBarButtonItem+CYLBadgeExtention.h" 21 | #import "UIView+CYLBadgeExtention.h" 22 | #import "NSObject+CYLTabBarControllerExtention.h" 23 | #import "UIColor+CYLTabBarControllerExtention.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @class CYLTabBarController; 28 | typedef void(^CYLViewDidLayoutSubViewsBlock)(CYLTabBarController *tabBarController); 29 | 30 | FOUNDATION_EXTERN NSString *const CYLTabBarItemTitle; 31 | FOUNDATION_EXTERN NSString *const CYLTabBarItemImage; 32 | FOUNDATION_EXTERN NSString *const CYLTabBarItemSelectedImage; 33 | FOUNDATION_EXTERN NSString *const CYLTabBarLottieURL; 34 | FOUNDATION_EXTERN NSString *const CYLTabBarLottieSize; 35 | FOUNDATION_EXTERN NSString *const CYLTabBarItemImageInsets; 36 | FOUNDATION_EXTERN NSString *const CYLTabBarItemTitlePositionAdjustment; 37 | FOUNDATION_EXTERN NSUInteger CYLTabbarItemsCount; 38 | FOUNDATION_EXTERN NSUInteger CYLPlusButtonIndex; 39 | FOUNDATION_EXTERN CGFloat CYLPlusButtonWidth; 40 | FOUNDATION_EXTERN CGFloat CYLTabBarItemWidth; 41 | FOUNDATION_EXTERN CGFloat CYLTabBarHeight; 42 | 43 | @protocol CYLTabBarControllerDelegate 44 | @optional 45 | /*! 46 | * @param tabBarController The tab bar controller containing viewController. 47 | * @param control Selected UIControl in TabBar. 48 | */ 49 | - (void)tabBarController:(UITabBarController *)tabBarController didSelectControl:(UIControl *)control; 50 | 51 | @end 52 | 53 | @interface CYLTabBarController : UITabBarController 54 | 55 | @property (nonatomic, copy) CYLViewDidLayoutSubViewsBlock viewDidLayoutSubviewsBlock; 56 | 57 | - (void)setViewDidLayoutSubViewsBlock:(CYLViewDidLayoutSubViewsBlock)viewDidLayoutSubviewsBlock; 58 | - (void)setViewDidLayoutSubViewsBlockInvokeOnce:(BOOL)invokeOnce block:(CYLViewDidLayoutSubViewsBlock)viewDidLayoutSubviewsBlock; 59 | /*! 60 | * An array of the root view controllers displayed by the tab bar interface. 61 | */ 62 | @property (nonatomic, readwrite, copy) NSArray *viewControllers; 63 | 64 | /*! 65 | * The Attributes of items which is displayed on the tab bar. 66 | */ 67 | @property (nonatomic, readwrite, copy) NSArray *tabBarItemsAttributes; 68 | 69 | /*! 70 | * Customize UITabBar height 71 | */ 72 | @property (nonatomic, assign) CGFloat tabBarHeight; 73 | 74 | /*! 75 | * To set both UIBarItem image view attributes in the tabBar, 76 | * default is UIEdgeInsetsZero. 77 | */ 78 | @property (nonatomic, readonly, assign) UIEdgeInsets imageInsets; 79 | 80 | @property (nonatomic, strong) CYLTabBar *tabBar; 81 | 82 | /*! 83 | * To set both UIBarItem label text attributes in the tabBar, 84 | * use the following to tweak the relative position of the label within the tab button (for handling visual centering corrections if needed because of custom text attributes) 85 | */ 86 | @property (nonatomic, readonly, assign) UIOffset titlePositionAdjustment; 87 | 88 | @property (nonatomic, readonly, copy) NSString *context; 89 | 90 | - (instancetype)initWithViewControllers:(NSArray *)viewControllers 91 | tabBarItemsAttributes:(NSArray *)tabBarItemsAttributes; 92 | 93 | + (instancetype)tabBarControllerWithViewControllers:(NSArray *)viewControllers 94 | tabBarItemsAttributes:(NSArray *)tabBarItemsAttributes; 95 | 96 | - (instancetype)initWithViewControllers:(NSArray *)viewControllers 97 | tabBarItemsAttributes:(NSArray *)tabBarItemsAttributes 98 | imageInsets:(UIEdgeInsets)imageInsets 99 | titlePositionAdjustment:(UIOffset)titlePositionAdjustment; 100 | 101 | + (instancetype)tabBarControllerWithViewControllers:(NSArray *)viewControllers 102 | tabBarItemsAttributes:(NSArray *)tabBarItemsAttributes 103 | imageInsets:(UIEdgeInsets)imageInsets 104 | titlePositionAdjustment:(UIOffset)titlePositionAdjustment; 105 | 106 | - (instancetype)initWithViewControllers:(NSArray *)viewControllers 107 | tabBarItemsAttributes:(NSArray *)tabBarItemsAttributes 108 | imageInsets:(UIEdgeInsets)imageInsets 109 | titlePositionAdjustment:(UIOffset)titlePositionAdjustment 110 | context:(NSString *)context; 111 | 112 | + (instancetype)tabBarControllerWithViewControllers:(NSArray *)viewControllers 113 | tabBarItemsAttributes:(NSArray *)tabBarItemsAttributes 114 | imageInsets:(UIEdgeInsets)imageInsets 115 | titlePositionAdjustment:(UIOffset)titlePositionAdjustment 116 | context:(NSString *)context; 117 | 118 | - (void)updateSelectionStatusIfNeededForTabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController; 119 | 120 | - (void)updateSelectionStatusIfNeededForTabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController shouldSelect:(BOOL)shouldSelect; 121 | 122 | - (void)hideTabBarShadowImageView; 123 | 124 | - (void)setTintColor:(UIColor *)tintColor; 125 | 126 | /*! 127 | * Judge if there is plus button. 128 | */ 129 | + (BOOL)havePlusButton; 130 | 131 | /*! 132 | * @attention Include plusButton if exists. 133 | */ 134 | + (NSUInteger)allItemsInTabBarCount; 135 | 136 | - (id)appDelegate; 137 | 138 | - (UIWindow *)rootWindow; 139 | 140 | @end 141 | 142 | @interface NSObject (CYLTabBarControllerReferenceExtension) 143 | 144 | /*! 145 | * If `self` is kind of `UIViewController`, this method will return the nearest ancestor in the view controller hierarchy that is a tab bar controller. If `self` is not kind of `UIViewController`, it will return the `rootViewController` of the `rootWindow` as long as you have set the `CYLTabBarController` as the `rootViewController`. Otherwise return nil. (read-only) 146 | */ 147 | @property (nonatomic, setter=cyl_setTabBarController:) CYLTabBarController *cyl_tabBarController; 148 | 149 | @end 150 | 151 | #pragma mark - Deprecated API 152 | 153 | @interface CYLTabBarController (CYLTabBarControllerDeprecated) 154 | 155 | - (void)hideTabBadgeBackgroundSeparator CYL_DEPRECATED("Deprecated in 1.27.0. Use `-[CYLTabBarController hideTabBarShadowImageView]` instead."); 156 | 157 | @end 158 | 159 | FOUNDATION_EXTERN NSString *const CYLTabBarItemWidthDidChangeNotification; 160 | 161 | NS_ASSUME_NONNULL_END 162 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/NSObject+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NSObject (CYLTabBarControllerExtention) 14 | 15 | @property (nonatomic, assign, getter=cyl_isForceLandscape, setter=cyl_setIsForceLandscape:) BOOL cyl_isForceLandscape; 16 | 17 | - (void)cyl_forceUpdateInterfaceOrientation:(UIInterfaceOrientation)orientation; 18 | 19 | - (UIResponder *)cyl_sharedAppDelegate; 20 | + (UIViewController * __nullable)cyl_topmostViewController; 21 | 22 | + (UINavigationController * __nullable)cyl_currentNavigationController; 23 | 24 | + (void)cyl_dismissAll:(void (^ __nullable)(void))completion; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/NSObject+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "NSObject+CYLTabBarControllerExtention.h" 10 | #import 11 | 12 | @implementation NSObject (CYLTabBarControllerExtention) 13 | 14 | - (BOOL)cyl_isForceLandscape { 15 | NSNumber *isForceLandscapeObject = objc_getAssociatedObject(self, @selector(cyl_isForceLandscape)); 16 | return [isForceLandscapeObject boolValue]; 17 | } 18 | 19 | - (void)cyl_setIsForceLandscape:(BOOL)isForceLandscape { 20 | NSNumber *isForceLandscapeObject = @(isForceLandscape); 21 | objc_setAssociatedObject(self, @selector(cyl_isForceLandscape), isForceLandscapeObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 22 | } 23 | 24 | - (UIResponder *)cyl_sharedAppDelegate { 25 | id appDelegate = [UIApplication sharedApplication].delegate; 26 | return (UIResponder *)appDelegate; 27 | } 28 | 29 | - (void)cyl_forceUpdateInterfaceOrientation:(UIInterfaceOrientation)orientation { 30 | UIResponder *appDelegate = [self cyl_sharedAppDelegate]; 31 | BOOL isForceLandscape = (UIInterfaceOrientationLandscapeLeft == orientation) || (UIInterfaceOrientationLandscapeRight == orientation); 32 | appDelegate.cyl_isForceLandscape = isForceLandscape; 33 | if ([appDelegate respondsToSelector:@selector(application:supportedInterfaceOrientationsForWindow:)]) { 34 | [appDelegate application:[UIApplication sharedApplication] supportedInterfaceOrientationsForWindow:UIApplication.sharedApplication.keyWindow]; 35 | } 36 | if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { 37 | NSNumber *num = [[NSNumber alloc]initWithInt:UIInterfaceOrientationPortrait]; 38 | [[UIDevice currentDevice] performSelector:@selector(setOrientation:)withObject:(id)num]; 39 | [UIViewController attemptRotationToDeviceOrientation]; 40 | SEL selector = NSSelectorFromString(@"setOrientation:"); 41 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]]; 42 | [invocation setSelector:selector]; 43 | [invocation setTarget:[UIDevice currentDevice]]; 44 | int val = [@(orientation) intValue]; 45 | [invocation setArgument:&val atIndex:2]; 46 | [invocation invoke]; 47 | } 48 | } 49 | 50 | + (UIViewController * __nullable)cyl_topmostViewController { 51 | UIViewController *topViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController]; 52 | 53 | if (topViewController == nil) { 54 | return nil; 55 | } 56 | 57 | while (true) { 58 | if (topViewController.presentedViewController != nil) { 59 | topViewController = topViewController.presentedViewController; 60 | } else if ([topViewController isKindOfClass:[UINavigationController class]]) { 61 | UINavigationController *navi = (UINavigationController *)topViewController; 62 | topViewController = navi.topViewController; 63 | } else if ([topViewController isKindOfClass:[UITabBarController class]]) { 64 | UITabBarController *tab = (UITabBarController *)topViewController; 65 | topViewController = tab.selectedViewController; 66 | } else { 67 | break; 68 | } 69 | } 70 | 71 | return topViewController; 72 | } 73 | 74 | + (UINavigationController * __nullable)cyl_currentNavigationController { 75 | return [[UIViewController cyl_topmostViewController] navigationController]; 76 | } 77 | 78 | + (void)cyl_dismissAll:(void (^ __nullable)(void))completion { 79 | UIViewController *topViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController]; 80 | 81 | if (topViewController == nil) { 82 | !completion ?: completion(); 83 | return; 84 | } 85 | 86 | NSMutableArray *list = [NSMutableArray new]; 87 | 88 | while (true) { 89 | if (topViewController.presentedViewController != nil) { 90 | topViewController = topViewController.presentedViewController; 91 | [list addObject:topViewController]; 92 | } else if ([topViewController isKindOfClass:[UINavigationController class]]) { 93 | UINavigationController *navi = (UINavigationController *)topViewController; 94 | topViewController = navi.topViewController; 95 | } else if ([topViewController isKindOfClass:[UITabBarController class]]) { 96 | UITabBarController *tab = (UITabBarController *)topViewController; 97 | topViewController = tab.selectedViewController; 98 | } else { 99 | break; 100 | } 101 | } 102 | 103 | if (list.count == 0) { 104 | if (completion) { 105 | completion(); 106 | } 107 | return; 108 | } 109 | 110 | for (NSInteger i = list.count - 1; i >=0 ; i--) { 111 | 112 | UIViewController *vc = list[i]; 113 | if (i == 0) { 114 | if ([vc isKindOfClass:[UINavigationController class]]) { 115 | [(UINavigationController *)vc popToRootViewControllerAnimated:NO]; 116 | } 117 | [vc dismissViewControllerAnimated:NO completion:completion]; 118 | } else { 119 | if ([vc isKindOfClass:[UINavigationController class]]) { 120 | [(UINavigationController *)vc popToRootViewControllerAnimated:NO]; 121 | } 122 | [vc dismissViewControllerAnimated:NO completion:nil]; 123 | } 124 | } 125 | } 126 | 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIBarButtonItem+CYLBadgeExtention.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | #import "UIView+CYLBadgeExtention.h" 11 | #import "CYLBadgeProtocol.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIBarButtonItem (CYLBadgeExtention) 16 | - (BOOL)cyl_isShowBadge; 17 | 18 | /** 19 | * show badge with red dot style and CYLBadgeAnimationTypeNone by default. 20 | */ 21 | - (void)cyl_showBadge; 22 | 23 | /** 24 | * cyl_showBadge 25 | * 26 | * @param value String value, default is `nil`. if value equal @"" means red dot style. 27 | * @param animationType animationType 28 | */ 29 | - (void)cyl_showBadgeValue:(NSString *)value 30 | animationType:(CYLBadgeAnimationType)animationType; 31 | 32 | 33 | /** 34 | * clear badge(hide badge) 35 | */ 36 | - (void)cyl_clearBadge; 37 | 38 | /** 39 | * make bage(if existing) not hiden 40 | */ 41 | - (void)cyl_resumeBadge; 42 | 43 | - (BOOL)cyl_isPauseBadge; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | 49 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIBarButtonItem+CYLBadgeExtention.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import "UIBarButtonItem+CYLBadgeExtention.h" 10 | #import 11 | 12 | #define kActualView [self cyl_getActualBadgeSuperView] 13 | 14 | 15 | @implementation UIBarButtonItem (CYLBadgeExtention) 16 | 17 | #pragma mark -- public methods 18 | 19 | /** 20 | * show badge with red dot style and CYLBadgeAnimationTypeNone by default. 21 | */ 22 | - (void)cyl_showBadge { 23 | [kActualView cyl_showBadge]; 24 | } 25 | 26 | - (void)cyl_showBadgeValue:(NSString *)value 27 | animationType:(CYLBadgeAnimationType)animationType { 28 | [kActualView cyl_showBadgeValue:value animationType:animationType]; 29 | } 30 | 31 | - (void)cyl_clearBadge { 32 | [kActualView cyl_clearBadge]; 33 | } 34 | 35 | - (void)cyl_resumeBadge { 36 | [kActualView cyl_resumeBadge]; 37 | } 38 | 39 | - (BOOL)cyl_isPauseBadge { 40 | return [kActualView cyl_isPauseBadge]; 41 | } 42 | 43 | - (BOOL)cyl_isShowBadge { 44 | return [kActualView cyl_isShowBadge]; 45 | } 46 | 47 | #pragma mark -- private method 48 | 49 | /** 50 | * Because UIBarButtonItem is kind of NSObject, it is not able to directly attach badge. 51 | This method is used to find actual view (non-nil) inside UIBarButtonItem instance. 52 | * 53 | * @return view 54 | */ 55 | - (UIView *)cyl_getActualBadgeSuperView { 56 | return [self valueForKeyPath:@"_view"];//use KVC to hack actual view 57 | } 58 | 59 | #pragma mark -- setter/getter 60 | - (UILabel *)cyl_badge { 61 | return kActualView.cyl_badge; 62 | } 63 | 64 | - (void)cyl_setBadge:(UILabel *)label { 65 | [kActualView cyl_setBadge:label]; 66 | } 67 | 68 | - (UIFont *)cyl_badgeFont { 69 | return kActualView.cyl_badgeFont; 70 | } 71 | 72 | - (void)cyl_setBadgeFont:(UIFont *)badgeFont { 73 | [kActualView cyl_setBadgeFont:badgeFont]; 74 | } 75 | 76 | - (UIColor *)cyl_badgeBackgroundColor { 77 | return [kActualView cyl_badgeBackgroundColor]; 78 | } 79 | 80 | - (void)cyl_setBadgeBackgroundColor:(UIColor *)badgeBackgroundColor { 81 | [kActualView cyl_setBadgeBackgroundColor:badgeBackgroundColor]; 82 | } 83 | 84 | - (UIColor *)cyl_badgeTextColor { 85 | return [kActualView cyl_badgeTextColor]; 86 | } 87 | 88 | - (void)cyl_setBadgeTextColor:(UIColor *)badgeTextColor { 89 | [kActualView cyl_setBadgeTextColor:badgeTextColor]; 90 | } 91 | 92 | - (CYLBadgeAnimationType)cyl_badgeAnimationType { 93 | return [kActualView cyl_badgeAnimationType]; 94 | } 95 | 96 | - (void)cyl_setBadgeAnimationType:(CYLBadgeAnimationType)animationType { 97 | [kActualView cyl_setBadgeAnimationType:animationType]; 98 | } 99 | 100 | - (CGRect)cyl_badgeFrame { 101 | return [kActualView cyl_badgeFrame]; 102 | } 103 | 104 | - (void)cyl_setBadgeFrame:(CGRect)badgeFrame { 105 | [kActualView cyl_setBadgeFrame:badgeFrame]; 106 | } 107 | 108 | - (CGPoint)cyl_badgeCenterOffset { 109 | return [kActualView cyl_badgeCenterOffset]; 110 | } 111 | 112 | - (void)cyl_setBadgeCenterOffset:(CGPoint)badgeCenterOffset { 113 | [kActualView cyl_setBadgeCenterOffset:badgeCenterOffset]; 114 | } 115 | 116 | - (NSInteger)cyl_badgeMaximumBadgeNumber { 117 | return [kActualView cyl_badgeMaximumBadgeNumber]; 118 | } 119 | 120 | - (void)cyl_setBadgeMaximumBadgeNumber:(NSInteger)badgeMaximumBadgeNumber { 121 | [kActualView cyl_setBadgeMaximumBadgeNumber:badgeMaximumBadgeNumber]; 122 | } 123 | 124 | - (CGFloat)cyl_badgeMargin { 125 | return [kActualView cyl_badgeMargin]; 126 | } 127 | 128 | - (void)cyl_setBadgeMargin:(CGFloat)badgeMargin { 129 | [kActualView cyl_setBadgeMargin:badgeMargin]; 130 | } 131 | 132 | - (CGFloat)cyl_badgeRadius { 133 | return [kActualView cyl_badgeRadius]; 134 | } 135 | 136 | - (void)cyl_setBadgeRadius:(CGFloat)badgeRadius { 137 | [kActualView cyl_setBadgeRadius:badgeRadius]; 138 | } 139 | 140 | - (CGFloat)cyl_badgeCornerRadius { 141 | return [kActualView cyl_badgeCornerRadius]; 142 | } 143 | 144 | - (void)cyl_setBadgeCornerRadius:(CGFloat)cyl_badgeCornerRadius { 145 | [kActualView cyl_setBadgeCornerRadius:cyl_badgeCornerRadius]; 146 | } 147 | 148 | @end 149 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIColor+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+CYLTabBarControllerExtention.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 16/2/26. 6 | // Copyright © 2019年 https://github.com/ChenYilong .All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CYLConstants.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface UIColor (CYLTabBarControllerExtention) 15 | 16 | @property (class, nonatomic, readonly) UIColor *cyl_systemRedColor; 17 | @property (class, nonatomic, readonly) UIColor *cyl_systemGreenColor; 18 | @property (class, nonatomic, readonly) UIColor *cyl_systemBlueColor; 19 | @property (class, nonatomic, readonly) UIColor *cyl_systemOrangeColor; 20 | @property (class, nonatomic, readonly) UIColor *cyl_systemYellowColor; 21 | @property (class, nonatomic, readonly) UIColor *cyl_systemPinkColor; 22 | @property (class, nonatomic, readonly) UIColor *cyl_systemPurpleColor; 23 | @property (class, nonatomic, readonly) UIColor *cyl_systemTealColor; 24 | @property (class, nonatomic, readonly) UIColor *cyl_systemIndigoColor; 25 | 26 | 27 | /* Shades of gray. systemGray is the base gray color. 28 | */ 29 | @property (class, nonatomic, readonly) UIColor *cyl_systemGrayColor; 30 | @property (class, nonatomic, readonly) UIColor *cyl_systemGray2Color; 31 | @property (class, nonatomic, readonly) UIColor *cyl_systemGray3Color; 32 | @property (class, nonatomic, readonly) UIColor *cyl_systemGray4Color; 33 | @property (class, nonatomic, readonly) UIColor *cyl_systemGray5Color; 34 | @property (class, nonatomic, readonly) UIColor *cyl_systemGray6Color; 35 | 36 | #pragma mark Foreground colors 37 | 38 | /* Foreground colors for static text and related elements. 39 | */ 40 | @property (class, nonatomic, readonly) UIColor *cyl_labelColor; 41 | @property (class, nonatomic, readonly) UIColor *cyl_secondaryLabelColor; 42 | @property (class, nonatomic, readonly) UIColor *cyl_tertiaryLabelColor ; 43 | @property (class, nonatomic, readonly) UIColor *cyl_quaternaryLabelColor; 44 | 45 | /* Foreground color for standard system links. 46 | */ 47 | @property (class, nonatomic, readonly) UIColor *cyl_linkColor; 48 | 49 | /* Foreground color for placeholder text in controls or text fields or text views. 50 | */ 51 | @property (class, nonatomic, readonly) UIColor *cyl_placeholderTextColor; 52 | 53 | /* Foreground colors for separators (thin border or divider lines). 54 | * `separatorColor` may be partially transparent, so it can go on top of any content. 55 | * `opaqueSeparatorColor` is intended to look similar, but is guaranteed to be opaque, so it will 56 | * completely cover anything behind it. Depending on the situation, you may need one or the other. 57 | */ 58 | @property (class, nonatomic, readonly) UIColor *cyl_separatorColor; 59 | @property (class, nonatomic, readonly) UIColor *cyl_opaqueSeparatorColor; 60 | 61 | #pragma mark Background colors 62 | 63 | /* We provide two design systems (also known as "stacks") for structuring an iOS app's backgrounds. 64 | * 65 | * Each stack has three "levels" of background colors. The first color is intended to be the 66 | * main background, farthest back. Secondary and tertiary colors are layered on top 67 | * of the main background, when appropriate. 68 | * 69 | * Inside of a discrete piece of UI, choose a stack, then use colors from that stack. 70 | * We do not recommend mixing and matching background colors between stacks. 71 | * The foreground colors above are designed to work in both stacks. 72 | * 73 | * 1. systemBackground 74 | * Use this stack for views with standard table views, and designs which have a white 75 | * primary background in light mode. 76 | */ 77 | @property (class, nonatomic, readonly) UIColor *cyl_systemBackgroundColor; 78 | @property (class, nonatomic, readonly) UIColor *cyl_secondarySystemBackgroundColor; 79 | @property (class, nonatomic, readonly) UIColor *cyl_tertiarySystemBackgroundColor; 80 | 81 | /* 2. systemGroupedBackground 82 | * Use this stack for views with grouped content, such as grouped tables and 83 | * platter-based designs. These are like grouped table views, but you may use these 84 | * colors in places where a table view wouldn't make sense. 85 | */ 86 | @property (class, nonatomic, readonly) UIColor *cyl_systemGroupedBackgroundColor; 87 | @property (class, nonatomic, readonly) UIColor *cyl_secondarySystemGroupedBackgroundColor; 88 | @property (class, nonatomic, readonly) UIColor *cyl_tertiarySystemGroupedBackgroundColor; 89 | 90 | #pragma mark Fill colors 91 | 92 | /* Fill colors for UI elements. 93 | * These are meant to be used over the background colors, since their alpha component is less than 1. 94 | * 95 | * systemFillColor is appropriate for filling thin and small shapes. 96 | * Example: The track of a slider. 97 | */ 98 | @property (class, nonatomic, readonly) UIColor *cyl_systemFillColor; 99 | 100 | /* secondarySystemFillColor is appropriate for filling medium-size shapes. 101 | * Example: The background of a switch. 102 | */ 103 | @property (class, nonatomic, readonly) UIColor *cyl_secondarySystemFillColor; 104 | 105 | /* tertiarySystemFillColor is appropriate for filling large shapes. 106 | * Examples: Input fields, search bars, buttons. 107 | */ 108 | @property (class, nonatomic, readonly) UIColor *cyl_tertiarySystemFillColor; 109 | 110 | /* quaternarySystemFillColor is appropriate for filling large areas containing complex content. 111 | * Example: Expanded table cells. 112 | */ 113 | @property (class, nonatomic, readonly) UIColor *cyl_quaternarySystemFillColor; 114 | 115 | #pragma mark Other colors 116 | 117 | /* lightTextColor is always light, and darkTextColor is always dark, regardless of the current UIUserInterfaceStyle. 118 | * When possible, we recommend using `labelColor` and its variants, instead. 119 | */ 120 | @property(class, nonatomic, readonly) UIColor *cyl_lightTextColor; // for a dark background 121 | 122 | @property(class, nonatomic, readonly) UIColor *cyl_darkTextColor; // for a light background 123 | 124 | @end 125 | 126 | #pragma mark - Deprecated API 127 | 128 | @interface UIColor (CYLTabBarControllerDeprecated) 129 | 130 | @property (class, nonatomic, readonly) UIColor *cyl_systemBrownColor CYL_DEPRECATED("Deprecated in 1.27.5."); 131 | 132 | @end 133 | NS_ASSUME_NONNULL_END 134 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIControl+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | @class LOTAnimationView; 13 | @interface UIControl (CYLTabBarControllerExtention) 14 | 15 | - (LOTAnimationView *)cyl_lottieAnimationView; 16 | - (BOOL)cyl_isChildViewControllerPlusButton; 17 | 18 | /*! 19 | * 调用该方法前已经添加了系统的角标,调用该方法后,系统的角标并未被移除,只是被隐藏,调用 `-cyl_removeTabBadgePoint` 后会重新展示。 20 | */ 21 | - (void)cyl_showTabBadgePoint; 22 | - (void)cyl_removeTabBadgePoint; 23 | - (BOOL)cyl_isShowTabBadgePoint; 24 | - (BOOL)cyl_isSelected; 25 | @property (nonatomic, strong, setter=cyl_setTabBadgePointView:, getter=cyl_tabBadgePointView) UIView *cyl_tabBadgePointView; 26 | @property (nonatomic, assign, setter=cyl_setTabBadgePointViewOffset:, getter=cyl_tabBadgePointViewOffset) UIOffset cyl_tabBadgePointViewOffset; 27 | /*! 28 | * PlusButton without plusViewController equals NSNotFound 29 | */ 30 | @property (nonatomic, assign, getter=cyl_tabBarChildViewControllerIndex, setter=cyl_setTabBarChildViewControllerIndex:) NSInteger cyl_tabBarChildViewControllerIndex; 31 | 32 | /*! 33 | * PlusButton has its own visible index, 34 | * in this case PlusButton is same as TabBarItem 35 | */ 36 | @property (nonatomic, assign, getter=cyl_tabBarItemVisibleIndex, setter=cyl_setTabBarItemVisibleIndex:) NSInteger cyl_tabBarItemVisibleIndex; 37 | 38 | @property (nonatomic, assign, getter=cyl_shouldNotSelect, setter=cyl_setShouldNotSelect:) BOOL cyl_shouldNotSelect; 39 | 40 | - (void)cyl_addLottieImageWithLottieURL:(NSURL *)lottieURL 41 | size:(CGSize)size; 42 | 43 | - (void)cyl_replaceTabImageViewWithNewView:(UIView *)newView 44 | show:(BOOL)show; 45 | 46 | - (void)cyl_replaceTabImageViewWithNewView:(UIView *)newView 47 | offset:(UIOffset)offset 48 | show:(BOOL)show 49 | completion:(void(^)(BOOL isReplaced, UIControl *tabBarButton, UIView *newView))completion; 50 | 51 | - (void)cyl_replaceTabButtonWithNewView:(UIView *)newView 52 | show:(BOOL)show; 53 | 54 | - (void)cyl_replaceTabButtonWithNewView:(UIView *)newView 55 | offset:(UIOffset)offset 56 | show:(BOOL)theShow 57 | completion:(void(^)(BOOL isReplaced, UIControl *tabBarButton, UIView *newView))completion; 58 | 59 | @end 60 | 61 | NS_ASSUME_NONNULL_END 62 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIControl+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "UIControl+CYLTabBarControllerExtention.h" 10 | #import 11 | #import "UIView+CYLTabBarControllerExtention.h" 12 | #import "CYLConstants.h" 13 | #import "CYLTabBarController.h" 14 | #if __has_include() 15 | #import 16 | #else 17 | #endif 18 | 19 | @implementation UIControl (CYLTabBarControllerExtention) 20 | 21 | - (BOOL)cyl_isChildViewControllerPlusButton { 22 | BOOL isChildViewControllerPlusButton = ([self cyl_isPlusButton] && CYLPlusChildViewController.cyl_plusViewControllerEverAdded); 23 | return isChildViewControllerPlusButton; 24 | } 25 | 26 | - (BOOL)cyl_shouldNotSelect { 27 | NSNumber *shouldNotSelectObject = objc_getAssociatedObject(self, @selector(cyl_shouldNotSelect)); 28 | return [shouldNotSelectObject boolValue]; 29 | } 30 | 31 | - (void)cyl_setShouldNotSelect:(BOOL)shouldNotSelect { 32 | NSNumber *shouldNotSelectObject = @(shouldNotSelect); 33 | objc_setAssociatedObject(self, @selector(cyl_shouldNotSelect), shouldNotSelectObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 34 | } 35 | 36 | - (NSInteger)cyl_tabBarItemVisibleIndex { 37 | if (!self.cyl_isTabButton && !self.cyl_isPlusButton ) { 38 | return NSNotFound; 39 | } 40 | NSNumber *tabBarItemVisibleIndexObject = objc_getAssociatedObject(self, @selector(cyl_tabBarItemVisibleIndex)); 41 | return [tabBarItemVisibleIndexObject integerValue]; 42 | } 43 | 44 | - (void)cyl_setTabBarItemVisibleIndex:(NSInteger)tabBarItemVisibleIndex { 45 | NSNumber *tabBarItemVisibleIndexObject = [NSNumber numberWithInteger:tabBarItemVisibleIndex]; 46 | objc_setAssociatedObject(self, @selector(cyl_tabBarItemVisibleIndex), tabBarItemVisibleIndexObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 47 | } 48 | 49 | - (NSInteger)cyl_tabBarChildViewControllerIndex { 50 | if (!self.cyl_isTabButton && !self.cyl_isPlusButton ) { 51 | return NSNotFound; 52 | } 53 | NSNumber *tabBarChildViewControllerIndexObject = objc_getAssociatedObject(self, @selector(cyl_tabBarChildViewControllerIndex)); 54 | return [tabBarChildViewControllerIndexObject integerValue]; 55 | } 56 | 57 | - (void)cyl_setTabBarChildViewControllerIndex:(NSInteger)tabBarChildViewControllerIndex { 58 | NSNumber *tabBarChildViewControllerIndexObject = [NSNumber numberWithInteger:tabBarChildViewControllerIndex]; 59 | objc_setAssociatedObject(self, @selector(cyl_tabBarChildViewControllerIndex), tabBarChildViewControllerIndexObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 60 | } 61 | 62 | - (void)cyl_showTabBadgePoint { 63 | [self cyl_setShowTabBadgePointIfNeeded:YES]; 64 | } 65 | 66 | - (void)cyl_removeTabBadgePoint { 67 | [self cyl_setShowTabBadgePointIfNeeded:NO]; 68 | } 69 | 70 | - (BOOL)cyl_isShowTabBadgePoint { 71 | return !self.cyl_tabBadgePointView.hidden; 72 | } 73 | 74 | - (BOOL)cyl_isSelected { 75 | NSUInteger tabBarSelectedIndex = self.cyl_tabBarController.selectedIndex; 76 | NSUInteger tabBarChildViewControllerIndex = self.cyl_tabBarChildViewControllerIndex; 77 | BOOL isSelected = (tabBarSelectedIndex == tabBarChildViewControllerIndex) && self.selected; 78 | if (self.cyl_tabBarController.tabBar.cyl_hasPlusChildViewController) { 79 | isSelected = isSelected && CYLPlusChildViewController.cyl_plusViewControllerEverAdded; 80 | } 81 | return isSelected; 82 | } 83 | 84 | - (void)cyl_setShowTabBadgePointIfNeeded:(BOOL)showTabBadgePoint { 85 | @try { 86 | [self cyl_setShowTabBadgePoint:showTabBadgePoint]; 87 | } @catch (NSException *exception) { 88 | NSLog(@"CYLPlusChildViewController do not support set TabBarItem red point"); 89 | } 90 | } 91 | 92 | - (void)cyl_setShowTabBadgePoint:(BOOL)showTabBadgePoint { 93 | if (showTabBadgePoint && self.cyl_tabBadgePointView.superview == nil) { 94 | [self addSubview:self.cyl_tabBadgePointView]; 95 | [self bringSubviewToFront:self.cyl_tabBadgePointView]; 96 | self.cyl_tabBadgePointView.layer.zPosition = MAXFLOAT; 97 | // X constraint 98 | [self addConstraint: 99 | [NSLayoutConstraint constraintWithItem:self.cyl_tabBadgePointView 100 | attribute:NSLayoutAttributeCenterX 101 | relatedBy:0 102 | toItem:self.cyl_tabImageView 103 | attribute:NSLayoutAttributeRight 104 | multiplier:1 105 | constant:self.cyl_tabBadgePointViewOffset.horizontal]]; 106 | //Y constraint 107 | [self addConstraint: 108 | [NSLayoutConstraint constraintWithItem:self.cyl_tabBadgePointView 109 | attribute:NSLayoutAttributeCenterY 110 | relatedBy:0 111 | toItem:self.cyl_tabImageView 112 | attribute:NSLayoutAttributeTop 113 | multiplier:1 114 | constant:self.cyl_tabBadgePointViewOffset.vertical]]; 115 | } 116 | self.cyl_tabBadgePointView.hidden = showTabBadgePoint == NO; 117 | self.cyl_tabBadgeView.hidden = showTabBadgePoint == YES; 118 | } 119 | 120 | - (void)cyl_setTabBadgePointView:(UIView *)tabBadgePointView { 121 | UIView *tempView = objc_getAssociatedObject(self, @selector(cyl_tabBadgePointView)); 122 | if (tempView) { 123 | [tempView removeFromSuperview]; 124 | } 125 | if (tabBadgePointView.superview) { 126 | [tabBadgePointView removeFromSuperview]; 127 | } 128 | 129 | tabBadgePointView.hidden = YES; 130 | objc_setAssociatedObject(self, @selector(cyl_tabBadgePointView), tabBadgePointView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 131 | } 132 | 133 | - (UIView *)cyl_tabBadgePointView { 134 | UIView *tabBadgePointView = objc_getAssociatedObject(self, @selector(cyl_tabBadgePointView)); 135 | 136 | if (tabBadgePointView == nil) { 137 | tabBadgePointView = self.cyl_defaultTabBadgePointView; 138 | objc_setAssociatedObject(self, @selector(cyl_tabBadgePointView), tabBadgePointView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 139 | } 140 | return tabBadgePointView; 141 | } 142 | 143 | - (void)cyl_setTabBadgePointViewOffset:(UIOffset)tabBadgePointViewOffset { 144 | objc_setAssociatedObject(self, @selector(cyl_tabBadgePointViewOffset), [NSValue valueWithUIOffset:tabBadgePointViewOffset], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 145 | } 146 | 147 | //offset如果都是正数,则往右下偏移 148 | - (UIOffset)cyl_tabBadgePointViewOffset { 149 | id tabBadgePointViewOffsetObject = objc_getAssociatedObject(self, @selector(cyl_tabBadgePointViewOffset)); 150 | UIOffset tabBadgePointViewOffset = [tabBadgePointViewOffsetObject UIOffsetValue]; 151 | return tabBadgePointViewOffset; 152 | } 153 | 154 | - (LOTAnimationView *)cyl_lottieAnimationView { 155 | for (UILabel *subview in self.subviews) { 156 | if ([subview cyl_isLottieAnimationView]) { 157 | return (LOTAnimationView *)subview; 158 | } 159 | } 160 | return nil; 161 | } 162 | 163 | - (void)cyl_replaceTabImageViewWithNewView:(UIView *)newView 164 | show:(BOOL)show { 165 | [self cyl_replaceTabImageViewWithNewView:newView offset:UIOffsetZero show:show completion:^(BOOL isReplaced, UIControl *tabBarButton, UIView *newView) { 166 | }]; 167 | } 168 | 169 | - (void)cyl_replaceTabImageViewWithNewView:(UIView *)newView 170 | offset:(UIOffset)offset 171 | show:(BOOL)theShow 172 | completion:(void(^)(BOOL isReplaced, UIControl *tabBarButton, UIView *newView))completion { 173 | [self cyl_replaceTabImageViewOrTabButton:NO newView:newView offset:offset show:theShow completion:completion]; 174 | } 175 | 176 | - (void)cyl_replaceTabButtonWithNewView:(UIView *)newView 177 | offset:(UIOffset)offset 178 | show:(BOOL)theShow 179 | completion:(void(^)(BOOL isReplaced, UIControl *tabBarButton, UIView *newView))completion { 180 | [self cyl_replaceTabImageViewOrTabButton:YES newView:newView offset:offset show:theShow completion:completion]; 181 | } 182 | 183 | - (void)cyl_replaceTabButtonWithNewView:(UIView *)newView 184 | show:(BOOL)show { 185 | [self cyl_replaceTabButtonWithNewView:newView offset:UIOffsetZero show:show completion:^(BOOL isReplaced, UIControl *tabBarButton, UIView *newView) { 186 | }]; 187 | } 188 | 189 | - (void)cyl_replaceTabImageViewOrTabButton:(BOOL)isTabButton 190 | newView:(UIView *)newView 191 | offset:(UIOffset)offset 192 | show:(BOOL)theShow 193 | completion:(void(^)(BOOL isReplaced, UIControl *tabBarButton, UIView *newView))completion { 194 | UIControl *tabBarButton = self; 195 | UIImageView *swappableImageView = tabBarButton.cyl_tabImageView; 196 | UIView *replacedView = swappableImageView; 197 | if (isTabButton) { 198 | replacedView = tabBarButton; 199 | } 200 | if (!replacedView) { 201 | return; 202 | } 203 | if (newView.frame.size.width == 0 || newView.frame.size.height == 0 || newView.frame.size.width > tabBarButton.frame.size.width || newView.frame.size.height > tabBarButton.frame.size.height) { 204 | UIImage *image = swappableImageView.image; 205 | newView.frame = ({ 206 | CGRect frame = newView.frame; 207 | frame.size = CGSizeMake(image.size.width, image.size.height); 208 | frame; 209 | }); 210 | } 211 | BOOL newViewCreated = (newView.superview); 212 | BOOL newViewAddedToTabButton = [self.subviews containsObject:newView]; 213 | BOOL isNewViewAddedToTabButton = newViewCreated && newViewAddedToTabButton; 214 | if (newView.superview && !newViewAddedToTabButton) { 215 | [newView removeFromSuperview]; 216 | } 217 | if (isNewViewAddedToTabButton && theShow) { 218 | !completion?:completion(YES, self, newView); 219 | return; 220 | } 221 | BOOL show = (newView && theShow); 222 | swappableImageView.hidden = (show); 223 | if (isTabButton) { 224 | tabBarButton.cyl_tabLabel.hidden = show; 225 | } 226 | BOOL shouldShowNewView = show && !newView.superview; 227 | BOOL shouldRemoveNewView = newView.superview; 228 | if (shouldShowNewView) { 229 | [tabBarButton addSubview:newView]; 230 | [tabBarButton bringSubviewToFront:newView]; 231 | CGSize newViewSize = newView.frame.size; 232 | if (@available(iOS 9.0, *)) { 233 | [NSLayoutConstraint activateConstraints:@[ 234 | [newView.centerXAnchor constraintEqualToAnchor:swappableImageView.centerXAnchor constant:offset.horizontal], 235 | [newView.centerYAnchor constraintEqualToAnchor:replacedView.centerYAnchor constant:offset.vertical], 236 | [newView.widthAnchor constraintEqualToConstant:newViewSize.width], 237 | [newView.heightAnchor constraintEqualToConstant:newViewSize.height], 238 | ] 239 | ]; 240 | } else { 241 | [self addConstraints:@[ 242 | [NSLayoutConstraint constraintWithItem:newView 243 | attribute:NSLayoutAttributeCenterX 244 | relatedBy:NSLayoutRelationEqual 245 | toItem:swappableImageView 246 | attribute:NSLayoutAttributeCenterX 247 | multiplier:1.0 248 | constant:offset.horizontal], 249 | [NSLayoutConstraint constraintWithItem:newView 250 | attribute:NSLayoutAttributeCenterY 251 | relatedBy:NSLayoutRelationEqual 252 | toItem:replacedView 253 | attribute:NSLayoutAttributeCenterY 254 | multiplier:1.0 255 | constant:offset.vertical], 256 | [NSLayoutConstraint constraintWithItem:newView 257 | attribute:NSLayoutAttributeCenterY 258 | relatedBy:NSLayoutRelationEqual 259 | toItem:replacedView 260 | attribute:NSLayoutAttributeCenterY 261 | multiplier:1.0 262 | constant:offset.vertical], 263 | [NSLayoutConstraint constraintWithItem:newView 264 | attribute:NSLayoutAttributeWidth 265 | relatedBy:NSLayoutRelationEqual 266 | toItem:nil 267 | attribute:NSLayoutAttributeNotAnAttribute 268 | multiplier:1.0 269 | constant:newViewSize.width], 270 | [NSLayoutConstraint constraintWithItem:newView 271 | attribute:NSLayoutAttributeHeight 272 | relatedBy:NSLayoutRelationEqual 273 | toItem:nil 274 | attribute:NSLayoutAttributeNotAnAttribute 275 | multiplier:1.0 276 | constant:newViewSize.height] 277 | ]]; 278 | } 279 | !completion?:completion(YES, self, newView); 280 | return; 281 | } 282 | if (shouldRemoveNewView) { 283 | [newView removeFromSuperview]; 284 | newView = nil; 285 | !completion?:completion(NO, self, nil); 286 | return; 287 | } 288 | } 289 | 290 | - (void)cyl_addLottieImageWithLottieURL:(NSURL *)lottieURL 291 | size:(CGSize)size { 292 | #if __has_include() 293 | if (self.cyl_lottieAnimationView) { 294 | return; 295 | } 296 | UIControl *tabButton = self; 297 | LOTAnimationView *lottieView = [[LOTAnimationView alloc] initWithContentsOfURL:lottieURL]; 298 | lottieView.frame = CGRectMake(0, 0, size.width, size.height); 299 | lottieView.userInteractionEnabled = NO; 300 | lottieView.contentMode = UIViewContentModeScaleAspectFill; 301 | lottieView.translatesAutoresizingMaskIntoConstraints = NO; 302 | [lottieView setClipsToBounds:NO]; 303 | [tabButton cyl_replaceTabImageViewWithNewView:lottieView show:YES]; 304 | #else 305 | #endif 306 | 307 | } 308 | 309 | #pragma mark - private method 310 | 311 | - (UIView *)cyl_defaultTabBadgePointView { 312 | UIView *defaultRedTabBadgePointView = [UIView cyl_tabBadgePointViewWithClolor:[UIColor redColor] radius:4.5]; 313 | return defaultRedTabBadgePointView; 314 | } 315 | 316 | @end 317 | 318 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIImage+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+CYLTabBarControllerExtention.h 3 | // CYLTabBarController 4 | // 5 | // Created by chenyilong on 18/4/2019. 6 | // Copyright © 2019 微博@iOS程序犭袁. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIImage (CYLTabBarControllerExtention) 14 | 15 | + (UIImage *)cyl_imageWithColor:(UIColor *)color size:(CGSize)size; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIImage+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+CYLTabBarControllerExtention.m 3 | // CYLTabBarController 4 | // 5 | // Created by chenyilong on 18/4/2019. 6 | // Copyright © 2019 微博@iOS程序犭袁. All rights reserved. 7 | // 8 | 9 | #import "UIImage+CYLTabBarControllerExtention.h" 10 | 11 | @implementation UIImage (CYLTabBarControllerExtention) 12 | 13 | + (UIImage *)cyl_imageWithColor:(UIColor *)color size:(CGSize)size { 14 | if (!color || size.width <= 0 || size.height <= 0) return nil; 15 | CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height); 16 | UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0); 17 | CGContextRef context = UIGraphicsGetCurrentContext(); 18 | CGContextSetFillColorWithColor(context, color.CGColor); 19 | CGContextFillRect(context, rect); 20 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 21 | UIGraphicsEndImageContext(); 22 | return [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 23 | } 24 | 25 | + (UIImage *)cyl_assetImageName:(NSString *)assetImageName 26 | userInterfaceStyle:(NSInteger)userInterfaceStyle { 27 | UIImage *image = [UIImage imageNamed:@"image"]; 28 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 29 | if (@available(iOS 13.0, *)) { 30 | #if __has_include() 31 | UITraitCollection *trait; 32 | // UIUserInterfaceStyle currentUserInterfaceStyle = [UITraitCollection currentTraitCollection].userInterfaceStyle; 33 | // if (currentUserInterfaceStyle == UIUserInterfaceStyleUnspecified) { 34 | // currentUserInterfaceStyle == userInterfaceStyle; 35 | // } 36 | trait = [UITraitCollection traitCollectionWithUserInterfaceStyle:userInterfaceStyle]; 37 | image = [image.imageAsset imageWithTraitCollection:trait]; 38 | //TODO: 39 | return image; 40 | #else 41 | #endif 42 | } 43 | #endif 44 | return image; 45 | } 46 | 47 | + (UIImage *)cyl_lightOrDarkModeImageWithLightImage:(UIImage *)lightImage 48 | darkImage:(UIImage *)darkImage { 49 | return [self cyl_lightOrDarkModeImageWithOwner:nil lightImage:lightImage darkImage:darkImage]; 50 | } 51 | 52 | + (UIImage *)cyl_lightOrDarkModeImageWithOwner:(id)owner 53 | lightImageName:(NSString *)lightImageName 54 | darkImageName:(NSString *)darkImageName { 55 | UIImage *lightImage = [UIImage imageNamed:lightImageName]; 56 | UIImage *darkImage= [UIImage imageNamed:darkImageName]; 57 | UIImage *lightOrDarkImage = [UIImage cyl_lightOrDarkModeImageWithOwner:owner lightImage:lightImage darkImage:darkImage]; 58 | return lightOrDarkImage; 59 | } 60 | 61 | + (UIImage *)cyl_lightOrDarkModeImageWithOwner:(id)owner 62 | lightImage:(UIImage *)lightImage 63 | darkImage:(UIImage *)darkImage { 64 | BOOL isDarkImage = NO; 65 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 66 | if (@available(iOS 13.0, *)) { 67 | #if __has_include() 68 | //TODO: 69 | UITraitCollection *traitCollection = owner.traitCollection ?: [UITraitCollection currentTraitCollection]; 70 | UIUserInterfaceStyle userInterfaceStyle = traitCollection.userInterfaceStyle; 71 | isDarkImage = (userInterfaceStyle == UIUserInterfaceStyleDark); 72 | #else 73 | #endif 74 | } 75 | #endif 76 | UIImage *image = (isDarkImage ? darkImage : lightImage); 77 | return image; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UITabBarItem+CYLBadgeExtention.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | #import "UIView+CYLBadgeExtention.h" 11 | #import "CYLBadgeProtocol.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UITabBarItem (CYLBadgeExtention) 16 | 17 | - (BOOL)cyl_isShowBadge; 18 | /** 19 | * show badge with red dot style and CYLBadgeAnimationTypeNone by default. 20 | */ 21 | - (void)cyl_showBadge; 22 | 23 | /** 24 | * 25 | * @param value String value, default is `nil`. if value equal @"" means red dot style. 26 | * @param animationType animationType 27 | * @attention 28 | - 调用该方法前已经添加了系统的角标,调用该方法后,系统的角标并未被移除,只是被隐藏,调用 `-cyl_removeTabBadgePoint` 后会重新展示。 29 | - 不支持 CYLPlusChildViewController 对应的 TabBarItem 角标设置,调用会被忽略。 30 | */ 31 | - (void)cyl_showBadgeValue:(NSString *)value 32 | animationType:(CYLBadgeAnimationType)animationType; 33 | 34 | /** 35 | * clear badge(hide badge) 36 | */ 37 | - (void)cyl_clearBadge; 38 | 39 | /** 40 | * make bage(if existing) not hiden 41 | */ 42 | - (void)cyl_resumeBadge; 43 | 44 | - (BOOL)cyl_isPauseBadge; 45 | 46 | @end 47 | 48 | NS_ASSUME_NONNULL_END 49 | 50 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UITabBarItem+CYLBadgeExtention.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import "UITabBarItem+CYLBadgeExtention.h" 10 | #import "CYLTabBarController.h" 11 | #import 12 | 13 | #define kActualView [self cyl_getActualBadgeSuperView] 14 | 15 | @implementation UITabBarItem (CYLBadgeExtention) 16 | + (void)load { 17 | [self cyl_swizzleSetBadgeValue]; 18 | } 19 | 20 | + (void)cyl_swizzleSetBadgeValue { 21 | static dispatch_once_t onceToken; 22 | dispatch_once(&onceToken, ^{ 23 | cyl_ClassMethodSwizzle([self class], @selector(setBadgeValue:), @selector(cyl_setBadgeValue:)); 24 | }); 25 | } 26 | 27 | - (void)cyl_setBadgeValue:(NSString *)badgeValue { 28 | [self.cyl_tabButton cyl_removeTabBadgePoint]; 29 | [self cyl_clearBadge]; 30 | [self cyl_setBadgeValue:badgeValue]; 31 | } 32 | 33 | #pragma mark -- public methods 34 | 35 | /** 36 | * show badge with red dot style and CYLBadgeAnimationTypeNone by default. 37 | */ 38 | - (void)cyl_showBadge { 39 | [kActualView cyl_showBadgeValue:@"" animationType:CYLBadgeAnimationTypeNone]; 40 | } 41 | 42 | - (void)cyl_showBadgeValue:(NSString *)value animationType:(CYLBadgeAnimationType)animationType { 43 | [kActualView cyl_showBadgeValue:value animationType:animationType]; 44 | self.cyl_tabButton.cyl_tabBadgeView.hidden = YES; 45 | } 46 | 47 | - (BOOL)cyl_isShowBadge { 48 | return [kActualView cyl_isShowBadge]; 49 | } 50 | 51 | - (BOOL)cyl_isPauseBadge { 52 | return [kActualView cyl_isPauseBadge]; 53 | } 54 | 55 | /** 56 | * clear badge 57 | */ 58 | - (void)cyl_clearBadge { 59 | [kActualView cyl_clearBadge]; 60 | self.cyl_tabButton.cyl_tabBadgeView.hidden = NO; 61 | } 62 | 63 | - (void)cyl_resumeBadge { 64 | [kActualView cyl_resumeBadge]; 65 | self.cyl_tabButton.cyl_tabBadgeView.hidden = YES; 66 | } 67 | 68 | #pragma mark -- private method 69 | 70 | /** 71 | * Because UIBarButtonItem is kind of NSObject, it is not able to directly attach badge. 72 | This method is used to find actual view (non-nil) inside UIBarButtonItem instance. 73 | * 74 | * @return view 75 | */ 76 | - (UIView *)cyl_getActualBadgeSuperView { 77 | UIControl *tabButton = [self cyl_tabButton]; 78 | // badge label will be added onto imageView 79 | UIImageView *tabImageView = [tabButton cyl_tabImageView]; 80 | UIView *lottieAnimationView = (UIView *)tabButton.cyl_lottieAnimationView ; 81 | UIView *actualBadgeSuperView = tabImageView; 82 | 83 | do { 84 | if (tabImageView && !tabImageView.cyl_isInvisiable) { 85 | actualBadgeSuperView = tabImageView; 86 | break; 87 | } 88 | if (lottieAnimationView && !lottieAnimationView.cyl_isInvisiable) { 89 | actualBadgeSuperView = lottieAnimationView; 90 | break; 91 | } 92 | } while (NO); 93 | [lottieAnimationView setClipsToBounds:NO]; 94 | return actualBadgeSuperView; 95 | } 96 | 97 | #pragma mark -- setter/getter 98 | - (UILabel *)cyl_badge { 99 | return kActualView.cyl_badge; 100 | } 101 | 102 | - (void)cyl_setBadge:(UILabel *)label { 103 | [kActualView cyl_setBadge:label]; 104 | } 105 | 106 | - (UIFont *)cyl_badgeFont { 107 | return kActualView.cyl_badgeFont; 108 | } 109 | 110 | - (void)cyl_setBadgeFont:(UIFont *)badgeFont { 111 | [kActualView cyl_setBadgeFont:badgeFont]; 112 | } 113 | 114 | - (UIColor *)cyl_badgeBackgroundColor { 115 | return [kActualView cyl_badgeBackgroundColor]; 116 | } 117 | 118 | - (void)cyl_setBadgeBackgroundColor:(UIColor *)badgeBackgroundColor { 119 | [kActualView cyl_setBadgeBackgroundColor:badgeBackgroundColor]; 120 | } 121 | 122 | - (UIColor *)cyl_badgeTextColor { 123 | return [kActualView cyl_badgeTextColor]; 124 | } 125 | 126 | - (void)cyl_setBadgeTextColor:(UIColor *)badgeTextColor { 127 | [kActualView cyl_setBadgeTextColor:badgeTextColor]; 128 | } 129 | 130 | - (CYLBadgeAnimationType)cyl_badgeAnimationType { 131 | return [kActualView cyl_badgeAnimationType]; 132 | } 133 | 134 | - (void)cyl_setBadgeAnimationType:(CYLBadgeAnimationType)animationType { 135 | [kActualView cyl_setBadgeAnimationType:animationType]; 136 | } 137 | 138 | - (CGRect)cyl_badgeFrame { 139 | return [kActualView cyl_badgeFrame]; 140 | } 141 | 142 | - (void)cyl_setBadgeFrame:(CGRect)badgeFrame { 143 | [kActualView cyl_setBadgeFrame:badgeFrame]; 144 | } 145 | 146 | - (CGPoint)cyl_badgeCenterOffset { 147 | return [kActualView cyl_badgeCenterOffset]; 148 | } 149 | 150 | - (void)cyl_setBadgeCenterOffset:(CGPoint)badgeCenterOffset { 151 | [kActualView cyl_setBadgeCenterOffset:badgeCenterOffset]; 152 | } 153 | 154 | - (NSInteger)cyl_badgeMaximumBadgeNumber { 155 | return [kActualView cyl_badgeMaximumBadgeNumber]; 156 | } 157 | 158 | - (void)cyl_setBadgeMaximumBadgeNumber:(NSInteger)badgeMaximumBadgeNumber { 159 | [kActualView cyl_setBadgeMaximumBadgeNumber:badgeMaximumBadgeNumber]; 160 | } 161 | 162 | - (CGFloat)cyl_badgeMargin { 163 | return [kActualView cyl_badgeMargin]; 164 | } 165 | 166 | - (void)cyl_setBadgeMargin:(CGFloat)badgeMargin { 167 | [kActualView cyl_setBadgeMargin:badgeMargin]; 168 | } 169 | 170 | - (CGFloat)cyl_badgeRadius { 171 | return [kActualView cyl_badgeRadius]; 172 | } 173 | 174 | - (void)cyl_setBadgeRadius:(CGFloat)badgeRadius { 175 | [kActualView cyl_setBadgeRadius:badgeRadius]; 176 | } 177 | 178 | - (CGFloat)cyl_badgeCornerRadius { 179 | return [kActualView cyl_badgeCornerRadius]; 180 | } 181 | 182 | - (void)cyl_setBadgeCornerRadius:(CGFloat)cyl_badgeCornerRadius { 183 | [kActualView cyl_setBadgeCornerRadius:cyl_badgeCornerRadius]; 184 | } 185 | 186 | #pragma mark - private method 187 | 188 | BOOL cyl_ClassMethodSwizzle(Class aClass, SEL originalSelector, SEL swizzleSelector) { 189 | Method originalMethod = class_getInstanceMethod(aClass, originalSelector); 190 | Method swizzleMethod = class_getInstanceMethod(aClass, swizzleSelector); 191 | BOOL didAddMethod = 192 | class_addMethod(aClass, 193 | originalSelector, 194 | method_getImplementation(swizzleMethod), 195 | method_getTypeEncoding(swizzleMethod)); 196 | if (didAddMethod) { 197 | class_replaceMethod(aClass, 198 | swizzleSelector, 199 | method_getImplementation(originalMethod), 200 | method_getTypeEncoding(originalMethod)); 201 | } else { 202 | method_exchangeImplementations(originalMethod, swizzleMethod); 203 | } 204 | return YES; 205 | } 206 | 207 | @end 208 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UITabBarItem (CYLTabBarControllerExtention) 14 | 15 | @property (nonatomic, readonly) UIControl *cyl_tabButton; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UITabBarItem+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import "UITabBarItem+CYLTabBarControllerExtention.h" 10 | #import "UIControl+CYLTabBarControllerExtention.h" 11 | 12 | @implementation UITabBarItem (CYLTabBarControllerExtention) 13 | 14 | - (UIControl *)cyl_tabButton { 15 | UIControl *control = [self valueForKeyPath:@"_view"]; 16 | return control; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIView+CYLBadgeExtention.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | #import "CYLBadgeProtocol.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | #pragma mark -- badge apis 15 | 16 | @interface UIView (CYLBadgeExtention) 17 | 18 | - (BOOL)cyl_isShowBadge; 19 | 20 | /** 21 | * show badge with red dot style and CYLBadgeAnimationTypeNone by default. 22 | */ 23 | - (void)cyl_showBadge; 24 | 25 | /** 26 | * cyl_showBadge 27 | * 28 | * @param value String value, default is `nil`. if value equal @"" means red dot style. 29 | * @param animationType animationType 30 | */ 31 | - (void)cyl_showBadgeValue:(NSString *)value 32 | animationType:(CYLBadgeAnimationType)animationType; 33 | ; 34 | 35 | // wBadgeStyle default is CYLBadgeStyleNumber ; 36 | // CYLBadgeAnimationType defualt is CYLBadgeAnimationTypeNone 37 | - (void)cyl_showBadgeValue:(NSString *)value; 38 | 39 | /** 40 | * clear badge(hide badge) 41 | */ 42 | - (void)cyl_clearBadge; 43 | 44 | /** 45 | * make bage(if existing) not hiden 46 | */ 47 | - (void)cyl_resumeBadge; 48 | 49 | - (BOOL)cyl_isPauseBadge; 50 | 51 | - (BOOL)cyl_isInvisiable; 52 | - (BOOL)cyl_canNotResponseEvent; 53 | 54 | @end 55 | 56 | NS_ASSUME_NONNULL_END 57 | 58 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIView+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "CYLConstants.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | 16 | 17 | @interface UIView (CYLTabBarControllerExtention) 18 | 19 | - (BOOL)cyl_isPlusButton; 20 | - (BOOL)cyl_isTabButton; 21 | - (BOOL)cyl_isTabImageView; 22 | - (BOOL)cyl_isTabLabel; 23 | - (BOOL)cyl_isTabBadgeView; 24 | - (BOOL)cyl_isTabBackgroundView; 25 | - (UIView *)cyl_tabBadgeView; 26 | - (UIImageView *)cyl_tabImageView; 27 | - (UILabel *)cyl_tabLabel; 28 | - (UIImageView *)cyl_tabShadowImageView; 29 | - (UIVisualEffectView *)cyl_tabEffectView; 30 | - (BOOL)cyl_isLottieAnimationView; 31 | - (UIView *)cyl_tabBackgroundView; 32 | + (UIView *)cyl_tabBadgePointViewWithClolor:(UIColor *)color radius:(CGFloat)radius; 33 | - (NSArray *)cyl_allSubviews; 34 | 35 | @end 36 | 37 | @interface UIView (CYLTabBarControllerExtentionDeprecated) 38 | - (UIView *)cyl_tabBadgeBackgroundView CYL_DEPRECATED("Deprecated in 1.6.0. Use `+[CYLPlusButton cyl_tabBackgroundView]` instead."); 39 | - (UIView *)cyl_tabBadgeBackgroundSeparator CYL_DEPRECATED("Deprecated in 1.6.0. Use `+[CYLPlusButton cyl_tabShadowImageView]` instead."); 40 | 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIView+CYLTabBarControllerExtention.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYLTabBarController.m 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 10/20/15. 6 | // Copyright © 2018 https://github.com/ChenYilong . All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIView+CYLTabBarControllerExtention.h" 11 | #import "CYLPlusButton.h" 12 | #if __has_include() 13 | #import 14 | #else 15 | #endif 16 | 17 | @implementation UIView (CYLTabBarControllerExtention) 18 | 19 | - (BOOL)cyl_isPlusButton { 20 | return [self isKindOfClass:[CYLExternPlusButton class]]; 21 | } 22 | 23 | - (BOOL)cyl_isTabButton { 24 | BOOL isKindOfButton = [self cyl_isKindOfClass:[UIControl class]]; 25 | return isKindOfButton; 26 | } 27 | 28 | - (BOOL)cyl_isTabImageView { 29 | BOOL isKindOfImageView = [self cyl_isKindOfClass:[UIImageView class]]; 30 | if (!isKindOfImageView) { 31 | return NO; 32 | } 33 | NSString *subString = [NSString stringWithFormat:@"%@cat%@ew", @"Indi" , @"orVi"]; 34 | BOOL isBackgroundImage = [self cyl_classStringHasSuffix:subString]; 35 | BOOL isTabImageView = !isBackgroundImage; 36 | return isTabImageView; 37 | } 38 | 39 | - (BOOL)cyl_isTabLabel { 40 | BOOL isKindOfLabel = [self cyl_isKindOfClass:[UILabel class]]; 41 | return isKindOfLabel; 42 | } 43 | 44 | - (BOOL)cyl_isTabBadgeView { 45 | BOOL isKindOfClass = [self isKindOfClass:[UIView class]]; 46 | BOOL isClass = [self isMemberOfClass:[UIView class]]; 47 | BOOL isKind = isKindOfClass && !isClass; 48 | if (!isKind) { 49 | return NO; 50 | } 51 | NSString *tabBarClassString = [NSString stringWithFormat:@"%@IB%@", @"_U" , @"adg"]; 52 | BOOL isTabBadgeView = [self cyl_classStringHasPrefix:tabBarClassString];; 53 | return isTabBadgeView; 54 | } 55 | 56 | - (BOOL)cyl_isTabBackgroundView { 57 | BOOL isKindOfClass = [self isKindOfClass:[UIView class]]; 58 | BOOL isClass = [self isMemberOfClass:[UIView class]]; 59 | BOOL isKind = isKindOfClass && !isClass; 60 | if (!isKind) { 61 | return NO; 62 | } 63 | NSString *tabBackgroundViewString = [NSString stringWithFormat:@"%@IB%@", @"_U" , @"arBac"]; 64 | BOOL isTabBackgroundView = [self cyl_classStringHasPrefix:tabBackgroundViewString] && [self cyl_classStringHasSuffix:@"nd"]; 65 | return isTabBackgroundView; 66 | } 67 | 68 | - (UIImageView *)cyl_tabImageView { 69 | for (UIImageView *subview in self.cyl_allSubviews) { 70 | if ([subview cyl_isTabImageView]) { 71 | return (UIImageView *)subview; 72 | } 73 | } 74 | return nil; 75 | } 76 | 77 | - (NSArray *)cyl_allSubviews { 78 | __block NSArray* allSubviews = [NSArray arrayWithObject:self]; 79 | [self.subviews enumerateObjectsUsingBlock:^(UIView* view, NSUInteger idx, BOOL*stop) { 80 | allSubviews = [allSubviews arrayByAddingObjectsFromArray:[view cyl_allSubviews]]; 81 | }]; 82 | return allSubviews; 83 | } 84 | 85 | - (UIView *)cyl_tabBadgeView { 86 | for (UIView *subview in self.cyl_allSubviews) { 87 | if ([subview cyl_isTabBadgeView]) { 88 | return (UIView *)subview; 89 | } 90 | } 91 | return nil; 92 | } 93 | 94 | - (UILabel *)cyl_tabLabel { 95 | for (UILabel *subview in self.cyl_allSubviews) { 96 | if ([subview cyl_isTabLabel]) { 97 | return (UILabel *)subview; 98 | } 99 | } 100 | return nil; 101 | } 102 | 103 | //UIVisualEffectView 104 | - (BOOL)cyl_isTabEffectView { 105 | BOOL isClass = [self isMemberOfClass:[UIVisualEffectView class]]; 106 | return isClass; 107 | } 108 | 109 | //_UIVisualEffectContentView 110 | - (BOOL)cyl_isTabEffectContentView { 111 | BOOL isKindOfClass = [self isKindOfClass:[UIView class]]; 112 | BOOL isClass = [self isMemberOfClass:[UIView class]]; 113 | BOOL isKind = isKindOfClass && !isClass; 114 | if (!isKind) { 115 | return NO; 116 | } 117 | NSString *tabBackgroundViewString = [NSString stringWithFormat:@"%@IVisualE%@", @"_U" , @"ffectC"]; 118 | BOOL isTabBackgroundView = [self cyl_classStringHasPrefix:tabBackgroundViewString] && [self cyl_classStringHasSuffix:@"entView"]; 119 | return isTabBackgroundView; 120 | } 121 | 122 | //UIVisualEffectView 123 | - (UIVisualEffectView *)cyl_tabEffectView { 124 | for (UIView *subview in self.subviews) { 125 | if ([subview cyl_isTabEffectView]) { 126 | return (UIVisualEffectView *)subview; 127 | } 128 | } 129 | return nil; 130 | } 131 | 132 | - (UIView *)cyl_tabBadgeBackgroundView { 133 | return [self cyl_tabBackgroundView]; 134 | } 135 | 136 | - (UIImageView *)cyl_tabShadowImageView { 137 | if (@available(iOS 10.0, *)) { 138 | //iOS10及以上这样获取ShadowImageView: 139 | UIView *subview = [self cyl_tabBackgroundView]; 140 | if (!subview) { 141 | return nil; 142 | } 143 | NSArray<__kindof UIView *> *backgroundSubviews = subview.subviews; 144 | //iOS13系统backgroundSubviews.count > 1可行,12及以下就不可行了 145 | if (backgroundSubviews.count >= 1) { 146 | for (UIView *subview in backgroundSubviews) { 147 | if (CGRectGetHeight(subview.bounds) <= 1.0 ) { 148 | return (UIImageView *)subview; 149 | } 150 | } 151 | } 152 | } else { 153 | //iOS9这样获取ShadowImageView: 154 | for (UIView *subview in self.subviews) { 155 | if (CGRectGetHeight(subview.bounds) <= 1.0 ) { 156 | return (UIImageView *)subview; 157 | } 158 | } 159 | } 160 | return nil; 161 | } 162 | 163 | - (UIView *)cyl_tabBackgroundView { 164 | for (UIImageView *subview in self.subviews) { 165 | if ([subview cyl_isTabBackgroundView]) { 166 | return (UIImageView *)subview; 167 | } 168 | } 169 | return nil; 170 | } 171 | 172 | - (BOOL)cyl_isLottieAnimationView { 173 | BOOL isKindOfClass = [self isKindOfClass:[UIView class]]; 174 | BOOL isClass = [self isMemberOfClass:[UIView class]]; 175 | BOOL isKind = isKindOfClass && !isClass; 176 | if (!isKind) { 177 | return NO; 178 | } 179 | Class classType = NSClassFromString(@"LOTAnimationView"); 180 | BOOL isLottieAnimationView = ([self isKindOfClass:classType] || [self isMemberOfClass:classType]); 181 | return isLottieAnimationView; 182 | } 183 | 184 | - (UIView *)cyl_tabBadgeBackgroundSeparator { 185 | return [self cyl_tabShadowImageView]; 186 | } 187 | 188 | - (BOOL)cyl_isKindOfClass:(Class)class { 189 | BOOL isKindOfClass = [self isKindOfClass:class]; 190 | BOOL isClass = [self isMemberOfClass:class]; 191 | BOOL isKind = isKindOfClass && !isClass; 192 | if (!isKind) { 193 | return NO; 194 | } 195 | BOOL isTabBarClass = [self cyl_isTabBarClass]; 196 | return isTabBarClass; 197 | } 198 | 199 | - (BOOL)cyl_isTabBarClass { 200 | NSString *tabBarClassString = [NSString stringWithFormat:@"U%@a%@ar", @"IT" , @"bB"]; 201 | BOOL isTabBarClass = [self cyl_classStringHasPrefix:tabBarClassString]; 202 | return isTabBarClass; 203 | } 204 | 205 | - (BOOL)cyl_classStringHasPrefix:(NSString *)prefix { 206 | NSString *classString = NSStringFromClass([self class]); 207 | return [classString hasPrefix:prefix]; 208 | } 209 | 210 | - (BOOL)cyl_classStringHasSuffix:(NSString *)suffix { 211 | NSString *classString = NSStringFromClass([self class]); 212 | return [classString hasSuffix:suffix]; 213 | } 214 | 215 | + (UIView *)cyl_tabBadgePointViewWithClolor:(UIColor *)color radius:(CGFloat)radius { 216 | UIView *defaultTabBadgePointView = [[UIView alloc] init]; 217 | [defaultTabBadgePointView setTranslatesAutoresizingMaskIntoConstraints:NO]; 218 | defaultTabBadgePointView.backgroundColor = color; 219 | defaultTabBadgePointView.layer.cornerRadius = radius; 220 | defaultTabBadgePointView.layer.masksToBounds = YES; 221 | defaultTabBadgePointView.hidden = YES; 222 | // Width constraint 223 | [defaultTabBadgePointView addConstraint:[NSLayoutConstraint constraintWithItem:defaultTabBadgePointView 224 | attribute:NSLayoutAttributeWidth 225 | relatedBy:NSLayoutRelationEqual 226 | toItem:nil 227 | attribute: NSLayoutAttributeNotAnAttribute 228 | multiplier:1 229 | constant:radius * 2]]; 230 | // Height constraint 231 | [defaultTabBadgePointView addConstraint:[NSLayoutConstraint constraintWithItem:defaultTabBadgePointView 232 | attribute:NSLayoutAttributeHeight 233 | relatedBy:NSLayoutRelationEqual 234 | toItem:nil 235 | attribute: NSLayoutAttributeNotAnAttribute 236 | multiplier:1 237 | constant:radius * 2]]; 238 | return defaultTabBadgePointView; 239 | } 240 | 241 | @end 242 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIViewController+CYLNavigationControllerExtention.h: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIViewController (CYLNavigationControllerExtention) 14 | 15 | @property (nonatomic, assign, getter=cyl_disablePopGestureRecognizer, setter=cyl_setDisablePopGestureRecognizer:) BOOL cyl_disablePopGestureRecognizer; 16 | @property (nonatomic, assign, getter=cyl_hideNavigationBarSeparator, setter=cyl_setHideNavigationBarSeparator:) BOOL cyl_hideNavigationBarSeparator; 17 | @property (nonatomic, assign, getter=cyl_navigationBarHidden, setter=cyl_setNavigationBarHidden:) BOOL cyl_navigationBarHidden; 18 | 19 | /*! 20 | * 使用方法:用在viewWillDisappear/dealloc 21 | * 作用:在左滑动的过渡的时间段内禁用interactivePopGestureRecognizer 22 | */ 23 | - (void)cyl_disableInteractivePopGestureRecognizer; 24 | /*! 25 | * use in viewDidDisappear 26 | * 作用:在左滑动的结束后启用interactivePopGestureRecognizer 27 | */ 28 | - (void)cyl_enableInteractivePopGestureRecognizer; 29 | /*! 30 | * use in viewDidAppear 31 | * 当新的视图控制器加载完成后再启用 32 | */ 33 | - (void)cyl_resetInteractivePopGestureRecognizer; 34 | /*! 35 | * use in viewWillAppear 36 | */ 37 | - (void)cyl_hideNavigationBarSeparatorIfNeeded; 38 | 39 | - (BOOL)cyl_shouldNavigationBarVisible; 40 | //use in viewWillDisappear 41 | - (void)cyl_setNavigationBarVisibleIfNeeded:(BOOL)animated; 42 | //use in viewWillAppear 43 | - (void)cyl_setNavigationBarHiddenIfNeeded:(BOOL)animated; 44 | 45 | - (void)cyl_viewWillAppearNavigationSetting:(BOOL)animated; 46 | - (void)cyl_viewWillDisappearNavigationSetting:(BOOL)animated; 47 | - (void)cyl_viewDidDisappearNavigationSetting:(BOOL)animated; 48 | - (void)cyl_viewDidAppearNavigationSetting:(BOOL)animated; 49 | - (void)cyl_deallocNavigationSetting; 50 | 51 | @end 52 | 53 | NS_ASSUME_NONNULL_END 54 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIViewController+CYLNavigationControllerExtention.m: -------------------------------------------------------------------------------- 1 | /* 2 | //  CYLTabBarController 3 | //  CYLTabBarController 4 | // 5 | //  Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 03/06/19. 6 | //  Copyright © 2019 https://github.com/ChenYilong . All rights reserved. 7 | */ 8 | 9 | #import "UIViewController+CYLNavigationControllerExtention.h" 10 | #import 11 | 12 | @implementation UIViewController (CYLNavigationControllerExtention) 13 | 14 | - (BOOL)cyl_disablePopGestureRecognizer { 15 | NSNumber *disablePopGestureRecognizerObject = objc_getAssociatedObject(self, @selector(cyl_disablePopGestureRecognizer)); 16 | return [disablePopGestureRecognizerObject boolValue]; 17 | } 18 | 19 | - (void)cyl_setDisablePopGestureRecognizer:(BOOL)disablePopGestureRecognizer { 20 | NSNumber *disablePopGestureRecognizerObject = [NSNumber numberWithBool:disablePopGestureRecognizer]; 21 | objc_setAssociatedObject(self, @selector(cyl_disablePopGestureRecognizer), disablePopGestureRecognizerObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 22 | } 23 | 24 | - (BOOL)cyl_hideNavigationBarSeparator { 25 | NSNumber *hideNavigationBarSeparatorObject = objc_getAssociatedObject(self, @selector(cyl_hideNavigationBarSeparator)); 26 | return [hideNavigationBarSeparatorObject boolValue]; 27 | } 28 | 29 | - (void)cyl_setHideNavigationBarSeparator:(BOOL)hideNavigationBarSeparator { 30 | NSNumber *hideNavigationBarSeparatorObject = [NSNumber numberWithBool:hideNavigationBarSeparator]; 31 | objc_setAssociatedObject(self, @selector(cyl_hideNavigationBarSeparator), hideNavigationBarSeparatorObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 32 | } 33 | 34 | - (BOOL)cyl_navigationBarHidden { 35 | NSNumber *navigationBarHiddenObject = objc_getAssociatedObject(self, @selector(cyl_navigationBarHidden)); 36 | return [navigationBarHiddenObject boolValue]; 37 | } 38 | 39 | - (void)cyl_setNavigationBarHidden:(BOOL)navigationBarHidden { 40 | NSNumber *navigationBarHiddenObject = [NSNumber numberWithBool:navigationBarHidden]; 41 | objc_setAssociatedObject(self, @selector(cyl_navigationBarHidden), navigationBarHiddenObject, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 42 | } 43 | 44 | //viewWillDisappear 45 | //dealloc 46 | // 在左滑动的过渡的时间段内禁用interactivePopGestureRecognizer 47 | - (void)cyl_disableInteractivePopGestureRecognizer { 48 | if (![self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { 49 | return; 50 | } 51 | self.navigationController.interactivePopGestureRecognizer.delegate = nil; 52 | } 53 | 54 | //viewDidDisappear 55 | // 在左滑动的结束后启用interactivePopGestureRecognizer 56 | - (void)cyl_enableInteractivePopGestureRecognizer { 57 | if (![self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { 58 | return; 59 | } 60 | self.navigationController.interactivePopGestureRecognizer.delegate = (id )self; 61 | self.navigationController.interactivePopGestureRecognizer.enabled = YES; 62 | } 63 | 64 | //viewDidAppear 65 | // 当新的视图控制器加载完成后再启用 66 | - (void)cyl_resetInteractivePopGestureRecognizer { 67 | if (![self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { 68 | return; 69 | } 70 | BOOL isSingleViewControllerInNavigationController = ([self.navigationController.viewControllers count] == 1); 71 | BOOL needDisableInteractivePopGestureRecognizer = (self.cyl_disablePopGestureRecognizer) || isSingleViewControllerInNavigationController; 72 | if (needDisableInteractivePopGestureRecognizer) { 73 | self.navigationController.interactivePopGestureRecognizer.enabled = NO; 74 | } else { 75 | self.navigationController.interactivePopGestureRecognizer.enabled = YES; 76 | } 77 | } 78 | 79 | //viewWillAppear 80 | - (void)cyl_hideNavigationBarSeparatorIfNeeded { 81 | if (self.cyl_hideNavigationBarSeparator) { 82 | self.navigationController.navigationBar.shadowImage = [UIImage new]; 83 | self.navigationController.navigationBar.translucent = NO; 84 | } 85 | } 86 | 87 | //在viewwilldisappear使用 88 | - (BOOL)cyl_shouldNavigationBarVisible { 89 | BOOL shouldSetNo = YES; 90 | 91 | BOOL isPop = YES; 92 | if (!self.navigationController) { 93 | return shouldSetNo; 94 | } 95 | //push的时候会先将vc添加到viewControllers,再调用viewWillDisappear 96 | //pop的时候会先将vc从viewControllers移除,再调用viewWillDisappear 97 | NSInteger selfIndex = -1; 98 | if (self.navigationController.viewControllers.count > 0) { 99 | NSArray *vcList = self.navigationController.viewControllers; 100 | for (NSInteger i = 0; i < vcList.count; i++) { 101 | UIViewController *vc = vcList[i]; 102 | if (vc == self) { 103 | selfIndex = i; 104 | if (selfIndex == vcList.count - 1) { 105 | //这种情况是navigationController push第一个vc或者present,不需要特殊处理,直接return 106 | return YES; 107 | } 108 | isPop = NO; 109 | break; 110 | } 111 | } 112 | if (isPop) { 113 | UIViewController *preVc = (UIViewController *)self.navigationController.viewControllers.lastObject; 114 | if (self.cyl_navigationBarHidden == preVc.cyl_navigationBarHidden) { 115 | shouldSetNo = NO; 116 | } 117 | } else { 118 | if (selfIndex + 1 < self.navigationController.viewControllers.count) { 119 | UIViewController *nextVc = (UIViewController *)self.navigationController.viewControllers[selfIndex + 1]; 120 | if (self.cyl_navigationBarHidden == nextVc.cyl_navigationBarHidden) { 121 | shouldSetNo = NO; 122 | } 123 | } 124 | } 125 | } 126 | return shouldSetNo; 127 | } 128 | 129 | //viewWillDisappear 130 | - (void)cyl_setNavigationBarVisibleIfNeeded:(BOOL)animated { 131 | if (self.cyl_navigationBarHidden && [self cyl_shouldNavigationBarVisible]) { 132 | [self.navigationController setNavigationBarHidden:!self.cyl_navigationBarHidden animated:animated]; 133 | } 134 | } 135 | 136 | //viewWillAppear 137 | - (void)cyl_setNavigationBarHiddenIfNeeded:(BOOL)animated { 138 | if (self.cyl_navigationBarHidden) { 139 | [self.navigationController setNavigationBarHidden:self.cyl_navigationBarHidden animated:animated]; 140 | } 141 | } 142 | 143 | - (void)cyl_viewWillAppearNavigationSetting:(BOOL)animated { 144 | [self cyl_hideNavigationBarSeparatorIfNeeded]; 145 | [self cyl_setNavigationBarHiddenIfNeeded:animated]; 146 | } 147 | 148 | - (void)cyl_viewWillDisappearNavigationSetting:(BOOL)animated { 149 | [self cyl_disableInteractivePopGestureRecognizer]; 150 | [self cyl_setNavigationBarVisibleIfNeeded:animated]; 151 | } 152 | 153 | - (void)cyl_viewDidDisappearNavigationSetting:(BOOL)animated { 154 | [self cyl_enableInteractivePopGestureRecognizer]; 155 | } 156 | 157 | - (void)cyl_viewDidAppearNavigationSetting:(BOOL)animated { 158 | [self cyl_resetInteractivePopGestureRecognizer]; 159 | } 160 | 161 | - (void)cyl_deallocNavigationSetting { 162 | [self cyl_disableInteractivePopGestureRecognizer]; 163 | } 164 | 165 | @end 166 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/CYLTabBarController/UIViewController+CYLTabBarControllerExtention.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+CYLTabBarControllerExtention.h 3 | // CYLTabBarController 4 | // 5 | // v1.21.x Created by 微博@iOS程序犭袁 ( http://weibo.com/luohanchenyilong/ ) on 16/2/26. 6 | // Copyright © 2018年 https://github.com/ChenYilong .All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CYLBadgeProtocol.h" 11 | #import "CYLConstants.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | typedef void (^CYLPopSelectTabBarChildViewControllerCompletion)(__kindof UIViewController *selectedTabBarChildViewController); 16 | 17 | typedef void (^CYLPushOrPopCompletionHandler)(BOOL shouldPop, 18 | __kindof UIViewController *viewControllerPopTo, 19 | BOOL shouldPopSelectTabBarChildViewController, 20 | NSUInteger index 21 | ); 22 | 23 | typedef void (^CYLPushOrPopCallback)(NSArray<__kindof UIViewController *> *viewControllers, CYLPushOrPopCompletionHandler completionHandler); 24 | 25 | @interface UIViewController (CYLTabBarControllerExtention) 26 | 27 | @property (nonatomic, readonly, getter=cyl_isEmbedInTabBarController) BOOL cyl_embedInTabBarController; 28 | 29 | @property (nonatomic, readonly, getter=cyl_tabIndex) NSInteger cyl_tabIndex; 30 | 31 | @property (nonatomic, readonly) UIControl *cyl_tabButton; 32 | 33 | @property (nonatomic, copy, setter=cyl_setContext:, getter=cyl_context) NSString *cyl_context; 34 | 35 | @property (nonatomic, assign, setter=cyl_setPlusViewControllerEverAdded:, getter=cyl_plusViewControllerEverAdded) BOOL cyl_plusViewControllerEverAdded; 36 | 37 | - (BOOL)cyl_isShowBadge; 38 | /** 39 | * show badge with red dot style and CYLBadgeAnimationTypeNone by default. 40 | */ 41 | - (void)cyl_showBadge; 42 | 43 | /** 44 | * 45 | * @param value String value, default is `nil`. if value equal @"" means red dot style. 46 | * @param animationType animationType 47 | * @attention 48 | - 调用该方法前已经添加了系统的角标,调用该方法后,系统的角标并未被移除,只是被隐藏,调用 `-cyl_removeTabBadgePoint` 后会重新展示。 49 | - 不支持 CYLPlusChildViewController 对应的 TabBarItem 角标设置,调用会被忽略。 50 | */ 51 | - (void)cyl_showBadgeValue:(NSString *)value 52 | animationType:(CYLBadgeAnimationType)animationType; 53 | 54 | /** 55 | * clear badge(hide badge) 56 | */ 57 | - (void)cyl_clearBadge; 58 | 59 | /** 60 | * make bage(if existing) not hiden 61 | */ 62 | - (void)cyl_resumeBadge; 63 | 64 | - (BOOL)cyl_isPauseBadge; 65 | 66 | 67 | /*! 68 | * Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器作为返回值返回。 69 | @param index 需要选择的控制器在 `TabBar` 中的 index。 70 | @return 最终被选择的控制器。 71 | @attention 注意:方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类,该方法无 pop 动画。 72 | */ 73 | - (UIViewController *)cyl_popSelectTabBarChildViewControllerAtIndex:(NSUInteger)index; 74 | 75 | /*! 76 | * Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器作为返回值返回。 77 | @param index 需要选择的控制器在 `TabBar` 中的 index。 78 | @param animated 动画 79 | @return 最终被选择的控制器。 80 | @attention 注意:方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类。 81 | */ 82 | - (UIViewController *)cyl_popSelectTabBarChildViewControllerAtIndex:(NSUInteger)index animated:(BOOL)animated; 83 | 84 | /*! 85 | * Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器在 `Block` 回调中返回。 86 | @param index 需要选择的控制器在 `TabBar` 中的 index。 87 | @attention 注意:方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类。 88 | */ 89 | - (void)cyl_popSelectTabBarChildViewControllerAtIndex:(NSUInteger)index 90 | completion:(CYLPopSelectTabBarChildViewControllerCompletion)completion; 91 | 92 | /*! 93 | * Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器作为返回值返回。 94 | @param classType 需要选择的控制器所属的类。 95 | @return 最终被选择的控制器。 96 | @attention 注意: 97 | - 方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类。 98 | - 如果 TabBarViewController 的 viewControllers 中包含多个相同的 `classType` 类型,会返回最左端的一个。 99 | 100 | */ 101 | - (UIViewController *)cyl_popSelectTabBarChildViewControllerForClassType:(Class)classType; 102 | 103 | /*! 104 | * Pop 到当前 `NavigationController` 的栈底,并改变 `TabBarController` 的 `selectedViewController` 属性,并将被选择的控制器在 `Block` 回调中返回。 105 | @param classType 需要选择的控制器所属的类。 106 | @attention 注意: 107 | - 方法中的参数和返回值都是 `UIViewController` 的子类,但并非 `UINavigationController` 的子类。 108 | - 如果 TabBarViewController 的 viewControllers 中包含多个相同的 `classType` 类型,会返回最左端的一个。 109 | */ 110 | - (void)cyl_popSelectTabBarChildViewControllerForClassType:(Class)classType 111 | completion:(CYLPopSelectTabBarChildViewControllerCompletion)completion; 112 | 113 | /*! 114 | *@brief 如果当前的 `NavigationViewController` 栈中包含有准备 Push 到的目标控制器,可以选择 Pop 而非 Push。 115 | *@param viewController Pop 或 Push 到的“目标控制器”,由 completionHandler 的参数控制 Pop 和 Push 的细节。 116 | *@param animated Pop 或 Push 时是否带动画 117 | *@param callback 回调,如果传 nil,将进行 Push。callback 包含以下几个参数: 118 | * param : viewControllers 表示与“目标控制器”相同类型的控制器; 119 | * param : completionHandler 包含以下几个参数: 120 | * param : shouldPop 是否 Pop 121 | * param : viewControllerPopTo Pop 回的控制器 122 | * param : shouldPopSelectTabBarChildViewController 在进行 Push 行为之前,是否 Pop 到当前 `NavigationController` 的栈底。 123 | 可能的值如下: 124 | NO 如果上一个参数为 NO,下一个参数 index 将被忽略。 125 | YES 会根据 index 参数改变 `TabBarController` 的 `selectedViewController` 属性。 126 | 注意:该属性在 Pop 行为时不起作用。 127 | * param : index Pop 改变 `TabBarController` 的 `selectedViewController` 属性。 128 | 注意:该属性在 Pop 行为时不起作用。 129 | */ 130 | - (void)cyl_pushOrPopToViewController:(UIViewController *)viewController 131 | animated:(BOOL)animated 132 | callback:(CYLPushOrPopCallback)callback; 133 | 134 | /*! 135 | * 如果正要 Push 的页面与当前栈顶的页面类型相同则取消 Push 136 | * 这样做防止主界面卡顿时,导致一个 ViewController 被 Push 多次 137 | */ 138 | - (void)cyl_pushViewController:(UIViewController *)viewController animated:(BOOL)animated; 139 | - (UIViewController *)cyl_getViewControllerInsteadOfNavigationController; 140 | - (void)cyl_handleNavigationBackAction; 141 | - (void)cyl_handleNavigationBackActionWithAnimated:(BOOL)animated; 142 | 143 | @end 144 | 145 | @interface UIViewController (CYLTabBarControllerExtentionDeprecated) 146 | 147 | - (void)cyl_showTabBadgePoint CYL_DEPRECATED("Deprecated in 1.19.0. Use `-[UIViewController cyl_showBadgeValue:animationType:]` instead."); 148 | 149 | - (void)cyl_removeTabBadgePoint CYL_DEPRECATED("Deprecated in 1.19.0. Use `-[UIViewController cyl_clearBadge]` instead."); 150 | 151 | - (BOOL)cyl_isShowTabBadgePoint CYL_DEPRECATED("Deprecated in 1.19.0. Use `-[UIViewController cyl_isShowBadge]` instead."); 152 | 153 | @property (nonatomic, strong, setter=cyl_setTabBadgePointView:, getter=cyl_tabBadgePointView) UIView *cyl_tabBadgePointView CYL_DEPRECATED("Deprecated in 1.19.0. Use method in instead."); 154 | 155 | @property (nonatomic, assign, setter=cyl_setTabBadgePointViewOffset:, getter=cyl_tabBadgePointViewOffset) UIOffset cyl_tabBadgePointViewOffset CYL_DEPRECATED("Deprecated in 1.19.0. Use method in instead."); 156 | 157 | @end 158 | 159 | NS_ASSUME_NONNULL_END 160 | -------------------------------------------------------------------------------- /Pods/CYLTabBarController/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. All rights reserved. 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 20 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CYLTabBarController (1.29.2): 3 | - CYLTabBarController/Core (= 1.29.2) 4 | - CYLTabBarController/Core (1.29.2) 5 | 6 | DEPENDENCIES: 7 | - CYLTabBarController (~> 1.29.0) 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - CYLTabBarController 12 | 13 | SPEC CHECKSUMS: 14 | CYLTabBarController: db44b5901a28693a8a4279e4721b3aafdd36c178 15 | 16 | PODFILE CHECKSUM: 435b9bc7cbc4668fd6d376281341c3746a5e149b 17 | 18 | COCOAPODS: 1.11.2 19 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.29.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_CYLTabBarController : NSObject 3 | @end 4 | @implementation PodsDummy_CYLTabBarController 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController-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 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "CAAnimation+CYLBadgeExtention.h" 14 | #import "CYLBadgeProtocol.h" 15 | #import "CYLBaseNavigationController.h" 16 | #import "CYLBaseTableViewController.h" 17 | #import "CYLBaseViewController.h" 18 | #import "CYLConstants.h" 19 | #import "CYLPlusButton.h" 20 | #import "CYLTabBar+CYLTabBarControllerExtention.h" 21 | #import "CYLTabBar.h" 22 | #import "CYLTabBarController.h" 23 | #import "NSObject+CYLTabBarControllerExtention.h" 24 | #import "UIBarButtonItem+CYLBadgeExtention.h" 25 | #import "UIColor+CYLTabBarControllerExtention.h" 26 | #import "UIControl+CYLTabBarControllerExtention.h" 27 | #import "UIImage+CYLTabBarControllerExtention.h" 28 | #import "UITabBarItem+CYLBadgeExtention.h" 29 | #import "UITabBarItem+CYLTabBarControllerExtention.h" 30 | #import "UIView+CYLBadgeExtention.h" 31 | #import "UIView+CYLTabBarControllerExtention.h" 32 | #import "UIViewController+CYLNavigationControllerExtention.h" 33 | #import "UIViewController+CYLTabBarControllerExtention.h" 34 | 35 | FOUNDATION_EXPORT double CYLTabBarControllerVersionNumber; 36 | FOUNDATION_EXPORT const unsigned char CYLTabBarControllerVersionString[]; 37 | 38 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/CYLTabBarController 8 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController.modulemap: -------------------------------------------------------------------------------- 1 | framework module CYLTabBarController { 2 | umbrella header "CYLTabBarController-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/CYLTabBarController 8 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/CYLTabBarController.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/CYLTabBarController 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CYLTabBarController/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.17.6 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CYLTabBarController 5 | 6 | Copyright (c) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. All rights reserved. 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 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift-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) 2015 CYLTabBarController(https://github.com/ChenYilong/CYLTabBarController), L.L.C. All rights reserved. 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 | 37 | License 38 | MIT 39 | Title 40 | CYLTabBarController 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_CYLTabBarController_Swift : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_CYLTabBarController_Swift 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | BCSYMBOLMAP_DIR="BCSymbolMaps" 23 | 24 | 25 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 26 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 27 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 28 | 29 | # Copies and strips a vendored framework 30 | install_framework() 31 | { 32 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 33 | local source="${BUILT_PRODUCTS_DIR}/$1" 34 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 35 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 36 | elif [ -r "$1" ]; then 37 | local source="$1" 38 | fi 39 | 40 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 41 | 42 | if [ -L "${source}" ]; then 43 | echo "Symlinked..." 44 | source="$(readlink "${source}")" 45 | fi 46 | 47 | if [ -d "${source}/${BCSYMBOLMAP_DIR}" ]; then 48 | # Locate and install any .bcsymbolmaps if present, and remove them from the .framework before the framework is copied 49 | find "${source}/${BCSYMBOLMAP_DIR}" -name "*.bcsymbolmap"|while read f; do 50 | echo "Installing $f" 51 | install_bcsymbolmap "$f" "$destination" 52 | rm "$f" 53 | done 54 | rmdir "${source}/${BCSYMBOLMAP_DIR}" 55 | fi 56 | 57 | # Use filter instead of exclude so missing patterns don't throw errors. 58 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 59 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 60 | 61 | local basename 62 | basename="$(basename -s .framework "$1")" 63 | binary="${destination}/${basename}.framework/${basename}" 64 | 65 | if ! [ -r "$binary" ]; then 66 | binary="${destination}/${basename}" 67 | elif [ -L "${binary}" ]; then 68 | echo "Destination binary is symlinked..." 69 | dirname="$(dirname "${binary}")" 70 | binary="${dirname}/$(readlink "${binary}")" 71 | fi 72 | 73 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 74 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 75 | strip_invalid_archs "$binary" 76 | fi 77 | 78 | # Resign the code if required by the build settings to avoid unstable apps 79 | code_sign_if_enabled "${destination}/$(basename "$1")" 80 | 81 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 82 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 83 | local swift_runtime_libs 84 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 85 | for lib in $swift_runtime_libs; do 86 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 87 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 88 | code_sign_if_enabled "${destination}/${lib}" 89 | done 90 | fi 91 | } 92 | # Copies and strips a vendored dSYM 93 | install_dsym() { 94 | local source="$1" 95 | warn_missing_arch=${2:-true} 96 | if [ -r "$source" ]; then 97 | # Copy the dSYM into the targets temp dir. 98 | 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}\"" 99 | 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}" 100 | 101 | local basename 102 | basename="$(basename -s .dSYM "$source")" 103 | binary_name="$(ls "$source/Contents/Resources/DWARF")" 104 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" 105 | 106 | # Strip invalid architectures from the dSYM. 107 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 108 | strip_invalid_archs "$binary" "$warn_missing_arch" 109 | fi 110 | if [[ $STRIP_BINARY_RETVAL == 0 ]]; then 111 | # Move the stripped file into its final destination. 112 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 113 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 114 | else 115 | # 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. 116 | mkdir -p "${DWARF_DSYM_FOLDER_PATH}" 117 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" 118 | fi 119 | fi 120 | } 121 | 122 | # Used as a return value for each invocation of `strip_invalid_archs` function. 123 | STRIP_BINARY_RETVAL=0 124 | 125 | # Strip invalid architectures 126 | strip_invalid_archs() { 127 | binary="$1" 128 | warn_missing_arch=${2:-true} 129 | # Get architectures for current target binary 130 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 131 | # Intersect them with the architectures we are building for 132 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 133 | # If there are no archs supported by this binary then warn the user 134 | if [[ -z "$intersected_archs" ]]; then 135 | if [[ "$warn_missing_arch" == "true" ]]; then 136 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 137 | fi 138 | STRIP_BINARY_RETVAL=1 139 | return 140 | fi 141 | stripped="" 142 | for arch in $binary_archs; do 143 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 144 | # Strip non-valid architectures in-place 145 | lipo -remove "$arch" -output "$binary" "$binary" 146 | stripped="$stripped $arch" 147 | fi 148 | done 149 | if [[ "$stripped" ]]; then 150 | echo "Stripped $binary of architectures:$stripped" 151 | fi 152 | STRIP_BINARY_RETVAL=0 153 | } 154 | 155 | # Copies the bcsymbolmap files of a vendored framework 156 | install_bcsymbolmap() { 157 | local bcsymbolmap_path="$1" 158 | local destination="${BUILT_PRODUCTS_DIR}" 159 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 160 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 161 | } 162 | 163 | # Signs a framework with the provided identity 164 | code_sign_if_enabled() { 165 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 166 | # Use the current code_sign_identity 167 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 168 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 169 | 170 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 171 | code_sign_cmd="$code_sign_cmd &" 172 | fi 173 | echo "$code_sign_cmd" 174 | eval "$code_sign_cmd" 175 | fi 176 | } 177 | 178 | if [[ "$CONFIGURATION" == "Debug" ]]; then 179 | install_framework "${BUILT_PRODUCTS_DIR}/CYLTabBarController/CYLTabBarController.framework" 180 | fi 181 | if [[ "$CONFIGURATION" == "Release" ]]; then 182 | install_framework "${BUILT_PRODUCTS_DIR}/CYLTabBarController/CYLTabBarController.framework" 183 | fi 184 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 185 | wait 186 | fi 187 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | 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 52 | 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} 53 | ;; 54 | *.xib) 55 | 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 56 | 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} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | 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}" 106 | fi 107 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift-umbrella.h: -------------------------------------------------------------------------------- 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 | 14 | FOUNDATION_EXPORT double Pods_CYLTabBarController_SwiftVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_CYLTabBarController_SwiftVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController/CYLTabBarController.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "CYLTabBarController" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_CYLTabBarController_Swift { 2 | umbrella header "Pods-CYLTabBarController-Swift-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CYLTabBarController-Swift/Pods-CYLTabBarController-Swift.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CYLTabBarController/CYLTabBarController.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "CYLTabBarController" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CYLTabBarController-Swift 2 | 流行框架CYLTabBarController,Swift版本 3 | --------------------------------------------------------------------------------