├── .gitignore ├── Demo_QLTabbarController ├── Demo_QLTabbarController.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Demo_QLTabbarController │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-29@2x.png │ │ │ ├── Icon-29@3x.png │ │ │ ├── Icon-40@2x.png │ │ │ ├── Icon-40@3x.png │ │ │ ├── Icon-60@2x.png │ │ │ └── Icon-60@3x.png │ │ ├── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-568h@2x.png │ │ │ └── Default@2x.png │ │ └── TabBar │ │ │ ├── tabbar_compose_button.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_compose_button@2x.png │ │ │ ├── tabbar_compose_button_highlighted.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_compose_button_highlighted@2x.png │ │ │ ├── tabbar_compose_icon_add.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_compose_icon_add@2x.png │ │ │ ├── tabbar_compose_icon_add_highlighted.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_compose_icon_add_highlighted@2x.png │ │ │ ├── tabbar_discover.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_discover@2x.png │ │ │ ├── tabbar_discover_selected.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_discover_selected@2x.png │ │ │ ├── tabbar_home.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_home@2x.png │ │ │ ├── tabbar_home_selected.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_home_selected@2x.png │ │ │ ├── tabbar_message_center.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_message_center@2x.png │ │ │ ├── tabbar_message_center_selected.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_message_center_selected@2x.png │ │ │ ├── tabbar_profile.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_profile@2x.png │ │ │ └── tabbar_profile_selected.imageset │ │ │ ├── Contents.json │ │ │ └── tabbar_profile_selected@2x.png │ ├── Info.plist │ ├── QLAppDelegate.h │ ├── QLAppDelegate.m │ ├── QLMainViewController.h │ ├── QLMainViewController.m │ ├── QLTabBarController │ │ ├── QLTabBar.h │ │ ├── QLTabBar.m │ │ ├── QLTabBarController.h │ │ └── QLTabBarController.m │ ├── QLTestTableViewController.h │ ├── QLTestTableViewController.m │ ├── QLTestViewController.h │ ├── QLTestViewController.m │ ├── QLViewController.h │ ├── QLViewController.m │ └── main.m └── Demo_QLTabbarControllerTests │ ├── Demo_QLTabbarControllerTests.m │ └── Info.plist └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C152FF551AE8DCF100A9550F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C152FF541AE8DCF100A9550F /* main.m */; }; 11 | C152FF581AE8DCF100A9550F /* QLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C152FF571AE8DCF100A9550F /* QLAppDelegate.m */; }; 12 | C152FF5B1AE8DCF100A9550F /* QLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C152FF5A1AE8DCF100A9550F /* QLViewController.m */; }; 13 | C152FF601AE8DCF100A9550F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C152FF5F1AE8DCF100A9550F /* Images.xcassets */; }; 14 | C152FF6F1AE8DCF100A9550F /* Demo_QLTabbarControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C152FF6E1AE8DCF100A9550F /* Demo_QLTabbarControllerTests.m */; }; 15 | C152FF7F1AE8E27500A9550F /* QLTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = C152FF7E1AE8E27500A9550F /* QLTabBarController.m */; }; 16 | C1659CCD1AEA248E00BCDCCE /* QLTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = C1659CCC1AEA248E00BCDCCE /* QLTabBar.m */; }; 17 | C19990861AEE017500009650 /* QLMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C19990851AEE017500009650 /* QLMainViewController.m */; }; 18 | C1A4852E1AEDD7000041131D /* QLTestTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C1A4852D1AEDD7000041131D /* QLTestTableViewController.m */; }; 19 | C1A485311AEDE0B40041131D /* QLTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C1A485301AEDE0B40041131D /* QLTestViewController.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | C152FF691AE8DCF100A9550F /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = C152FF471AE8DCF100A9550F /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = C152FF4E1AE8DCF100A9550F; 28 | remoteInfo = Demo_QLTabbarController; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | C152FF4F1AE8DCF100A9550F /* Demo_QLTabbarController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo_QLTabbarController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | C152FF531AE8DCF100A9550F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | C152FF541AE8DCF100A9550F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 36 | C152FF561AE8DCF100A9550F /* QLAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QLAppDelegate.h; sourceTree = ""; }; 37 | C152FF571AE8DCF100A9550F /* QLAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QLAppDelegate.m; sourceTree = ""; }; 38 | C152FF591AE8DCF100A9550F /* QLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QLViewController.h; sourceTree = ""; }; 39 | C152FF5A1AE8DCF100A9550F /* QLViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = QLViewController.m; sourceTree = ""; }; 40 | C152FF5F1AE8DCF100A9550F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | C152FF681AE8DCF100A9550F /* Demo_QLTabbarControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Demo_QLTabbarControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | C152FF6D1AE8DCF100A9550F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | C152FF6E1AE8DCF100A9550F /* Demo_QLTabbarControllerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Demo_QLTabbarControllerTests.m; sourceTree = ""; }; 44 | C152FF7D1AE8E27500A9550F /* QLTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLTabBarController.h; sourceTree = ""; }; 45 | C152FF7E1AE8E27500A9550F /* QLTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QLTabBarController.m; sourceTree = ""; }; 46 | C1659CCB1AEA248E00BCDCCE /* QLTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLTabBar.h; sourceTree = ""; }; 47 | C1659CCC1AEA248E00BCDCCE /* QLTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QLTabBar.m; sourceTree = ""; }; 48 | C19990841AEE017500009650 /* QLMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLMainViewController.h; sourceTree = ""; }; 49 | C19990851AEE017500009650 /* QLMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QLMainViewController.m; sourceTree = ""; }; 50 | C1A4852C1AEDD7000041131D /* QLTestTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLTestTableViewController.h; sourceTree = ""; }; 51 | C1A4852D1AEDD7000041131D /* QLTestTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QLTestTableViewController.m; sourceTree = ""; }; 52 | C1A4852F1AEDE0B40041131D /* QLTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLTestViewController.h; sourceTree = ""; }; 53 | C1A485301AEDE0B40041131D /* QLTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QLTestViewController.m; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | C152FF4C1AE8DCF100A9550F /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | C152FF651AE8DCF100A9550F /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | /* End PBXFrameworksBuildPhase section */ 72 | 73 | /* Begin PBXGroup section */ 74 | C152FF461AE8DCF100A9550F = { 75 | isa = PBXGroup; 76 | children = ( 77 | C152FF511AE8DCF100A9550F /* Demo_QLTabbarController */, 78 | C152FF6B1AE8DCF100A9550F /* Demo_QLTabbarControllerTests */, 79 | C152FF501AE8DCF100A9550F /* Products */, 80 | ); 81 | sourceTree = ""; 82 | }; 83 | C152FF501AE8DCF100A9550F /* Products */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | C152FF4F1AE8DCF100A9550F /* Demo_QLTabbarController.app */, 87 | C152FF681AE8DCF100A9550F /* Demo_QLTabbarControllerTests.xctest */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | C152FF511AE8DCF100A9550F /* Demo_QLTabbarController */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | C152FF561AE8DCF100A9550F /* QLAppDelegate.h */, 96 | C152FF571AE8DCF100A9550F /* QLAppDelegate.m */, 97 | C152FF591AE8DCF100A9550F /* QLViewController.h */, 98 | C152FF5A1AE8DCF100A9550F /* QLViewController.m */, 99 | C19990841AEE017500009650 /* QLMainViewController.h */, 100 | C19990851AEE017500009650 /* QLMainViewController.m */, 101 | C1A4852F1AEDE0B40041131D /* QLTestViewController.h */, 102 | C1A485301AEDE0B40041131D /* QLTestViewController.m */, 103 | C1A4852C1AEDD7000041131D /* QLTestTableViewController.h */, 104 | C1A4852D1AEDD7000041131D /* QLTestTableViewController.m */, 105 | C152FF7C1AE8E25600A9550F /* QLTabBarController */, 106 | C152FF521AE8DCF100A9550F /* Supporting Files */, 107 | ); 108 | path = Demo_QLTabbarController; 109 | sourceTree = ""; 110 | }; 111 | C152FF521AE8DCF100A9550F /* Supporting Files */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | C152FF5F1AE8DCF100A9550F /* Images.xcassets */, 115 | C152FF531AE8DCF100A9550F /* Info.plist */, 116 | C152FF541AE8DCF100A9550F /* main.m */, 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | C152FF6B1AE8DCF100A9550F /* Demo_QLTabbarControllerTests */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | C152FF6E1AE8DCF100A9550F /* Demo_QLTabbarControllerTests.m */, 125 | C152FF6C1AE8DCF100A9550F /* Supporting Files */, 126 | ); 127 | path = Demo_QLTabbarControllerTests; 128 | sourceTree = ""; 129 | }; 130 | C152FF6C1AE8DCF100A9550F /* Supporting Files */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | C152FF6D1AE8DCF100A9550F /* Info.plist */, 134 | ); 135 | name = "Supporting Files"; 136 | sourceTree = ""; 137 | }; 138 | C152FF7C1AE8E25600A9550F /* QLTabBarController */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | C152FF7D1AE8E27500A9550F /* QLTabBarController.h */, 142 | C152FF7E1AE8E27500A9550F /* QLTabBarController.m */, 143 | C1659CCB1AEA248E00BCDCCE /* QLTabBar.h */, 144 | C1659CCC1AEA248E00BCDCCE /* QLTabBar.m */, 145 | ); 146 | path = QLTabBarController; 147 | sourceTree = ""; 148 | }; 149 | /* End PBXGroup section */ 150 | 151 | /* Begin PBXNativeTarget section */ 152 | C152FF4E1AE8DCF100A9550F /* Demo_QLTabbarController */ = { 153 | isa = PBXNativeTarget; 154 | buildConfigurationList = C152FF721AE8DCF100A9550F /* Build configuration list for PBXNativeTarget "Demo_QLTabbarController" */; 155 | buildPhases = ( 156 | C152FF4B1AE8DCF100A9550F /* Sources */, 157 | C152FF4C1AE8DCF100A9550F /* Frameworks */, 158 | C152FF4D1AE8DCF100A9550F /* Resources */, 159 | ); 160 | buildRules = ( 161 | ); 162 | dependencies = ( 163 | ); 164 | name = Demo_QLTabbarController; 165 | productName = Demo_QLTabbarController; 166 | productReference = C152FF4F1AE8DCF100A9550F /* Demo_QLTabbarController.app */; 167 | productType = "com.apple.product-type.application"; 168 | }; 169 | C152FF671AE8DCF100A9550F /* Demo_QLTabbarControllerTests */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = C152FF751AE8DCF100A9550F /* Build configuration list for PBXNativeTarget "Demo_QLTabbarControllerTests" */; 172 | buildPhases = ( 173 | C152FF641AE8DCF100A9550F /* Sources */, 174 | C152FF651AE8DCF100A9550F /* Frameworks */, 175 | C152FF661AE8DCF100A9550F /* Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | C152FF6A1AE8DCF100A9550F /* PBXTargetDependency */, 181 | ); 182 | name = Demo_QLTabbarControllerTests; 183 | productName = Demo_QLTabbarControllerTests; 184 | productReference = C152FF681AE8DCF100A9550F /* Demo_QLTabbarControllerTests.xctest */; 185 | productType = "com.apple.product-type.bundle.unit-test"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | C152FF471AE8DCF100A9550F /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | CLASSPREFIX = QL; 194 | LastUpgradeCheck = 0620; 195 | ORGANIZATIONNAME = Shrek; 196 | TargetAttributes = { 197 | C152FF4E1AE8DCF100A9550F = { 198 | CreatedOnToolsVersion = 6.2; 199 | }; 200 | C152FF671AE8DCF100A9550F = { 201 | CreatedOnToolsVersion = 6.2; 202 | TestTargetID = C152FF4E1AE8DCF100A9550F; 203 | }; 204 | }; 205 | }; 206 | buildConfigurationList = C152FF4A1AE8DCF100A9550F /* Build configuration list for PBXProject "Demo_QLTabbarController" */; 207 | compatibilityVersion = "Xcode 3.2"; 208 | developmentRegion = English; 209 | hasScannedForEncodings = 0; 210 | knownRegions = ( 211 | en, 212 | Base, 213 | ); 214 | mainGroup = C152FF461AE8DCF100A9550F; 215 | productRefGroup = C152FF501AE8DCF100A9550F /* Products */; 216 | projectDirPath = ""; 217 | projectRoot = ""; 218 | targets = ( 219 | C152FF4E1AE8DCF100A9550F /* Demo_QLTabbarController */, 220 | C152FF671AE8DCF100A9550F /* Demo_QLTabbarControllerTests */, 221 | ); 222 | }; 223 | /* End PBXProject section */ 224 | 225 | /* Begin PBXResourcesBuildPhase section */ 226 | C152FF4D1AE8DCF100A9550F /* Resources */ = { 227 | isa = PBXResourcesBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | C152FF601AE8DCF100A9550F /* Images.xcassets in Resources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | C152FF661AE8DCF100A9550F /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | /* End PBXResourcesBuildPhase section */ 242 | 243 | /* Begin PBXSourcesBuildPhase section */ 244 | C152FF4B1AE8DCF100A9550F /* Sources */ = { 245 | isa = PBXSourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | C1A4852E1AEDD7000041131D /* QLTestTableViewController.m in Sources */, 249 | C152FF7F1AE8E27500A9550F /* QLTabBarController.m in Sources */, 250 | C19990861AEE017500009650 /* QLMainViewController.m in Sources */, 251 | C152FF5B1AE8DCF100A9550F /* QLViewController.m in Sources */, 252 | C1A485311AEDE0B40041131D /* QLTestViewController.m in Sources */, 253 | C152FF581AE8DCF100A9550F /* QLAppDelegate.m in Sources */, 254 | C152FF551AE8DCF100A9550F /* main.m in Sources */, 255 | C1659CCD1AEA248E00BCDCCE /* QLTabBar.m in Sources */, 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | }; 259 | C152FF641AE8DCF100A9550F /* Sources */ = { 260 | isa = PBXSourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | C152FF6F1AE8DCF100A9550F /* Demo_QLTabbarControllerTests.m in Sources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXSourcesBuildPhase section */ 268 | 269 | /* Begin PBXTargetDependency section */ 270 | C152FF6A1AE8DCF100A9550F /* PBXTargetDependency */ = { 271 | isa = PBXTargetDependency; 272 | target = C152FF4E1AE8DCF100A9550F /* Demo_QLTabbarController */; 273 | targetProxy = C152FF691AE8DCF100A9550F /* PBXContainerItemProxy */; 274 | }; 275 | /* End PBXTargetDependency section */ 276 | 277 | /* Begin XCBuildConfiguration section */ 278 | C152FF701AE8DCF100A9550F /* Debug */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | ALWAYS_SEARCH_USER_PATHS = NO; 282 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 283 | CLANG_CXX_LIBRARY = "libc++"; 284 | CLANG_ENABLE_MODULES = YES; 285 | CLANG_ENABLE_OBJC_ARC = YES; 286 | CLANG_WARN_BOOL_CONVERSION = YES; 287 | CLANG_WARN_CONSTANT_CONVERSION = YES; 288 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 289 | CLANG_WARN_EMPTY_BODY = YES; 290 | CLANG_WARN_ENUM_CONVERSION = YES; 291 | CLANG_WARN_INT_CONVERSION = YES; 292 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 293 | CLANG_WARN_UNREACHABLE_CODE = YES; 294 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 295 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 296 | COPY_PHASE_STRIP = NO; 297 | ENABLE_STRICT_OBJC_MSGSEND = YES; 298 | GCC_C_LANGUAGE_STANDARD = gnu99; 299 | GCC_DYNAMIC_NO_PIC = NO; 300 | GCC_OPTIMIZATION_LEVEL = 0; 301 | GCC_PREPROCESSOR_DEFINITIONS = ( 302 | "DEBUG=1", 303 | "$(inherited)", 304 | ); 305 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 308 | GCC_WARN_UNDECLARED_SELECTOR = YES; 309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 310 | GCC_WARN_UNUSED_FUNCTION = YES; 311 | GCC_WARN_UNUSED_VARIABLE = YES; 312 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 313 | MTL_ENABLE_DEBUG_INFO = YES; 314 | ONLY_ACTIVE_ARCH = YES; 315 | SDKROOT = iphoneos; 316 | }; 317 | name = Debug; 318 | }; 319 | C152FF711AE8DCF100A9550F /* Release */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | ALWAYS_SEARCH_USER_PATHS = NO; 323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 324 | CLANG_CXX_LIBRARY = "libc++"; 325 | CLANG_ENABLE_MODULES = YES; 326 | CLANG_ENABLE_OBJC_ARC = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_CONSTANT_CONVERSION = YES; 329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 330 | CLANG_WARN_EMPTY_BODY = YES; 331 | CLANG_WARN_ENUM_CONVERSION = YES; 332 | CLANG_WARN_INT_CONVERSION = YES; 333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 334 | CLANG_WARN_UNREACHABLE_CODE = YES; 335 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 336 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 337 | COPY_PHASE_STRIP = NO; 338 | ENABLE_NS_ASSERTIONS = NO; 339 | ENABLE_STRICT_OBJC_MSGSEND = YES; 340 | GCC_C_LANGUAGE_STANDARD = gnu99; 341 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 342 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 343 | GCC_WARN_UNDECLARED_SELECTOR = YES; 344 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 345 | GCC_WARN_UNUSED_FUNCTION = YES; 346 | GCC_WARN_UNUSED_VARIABLE = YES; 347 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 348 | MTL_ENABLE_DEBUG_INFO = NO; 349 | SDKROOT = iphoneos; 350 | VALIDATE_PRODUCT = YES; 351 | }; 352 | name = Release; 353 | }; 354 | C152FF731AE8DCF100A9550F /* Debug */ = { 355 | isa = XCBuildConfiguration; 356 | buildSettings = { 357 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 358 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 359 | INFOPLIST_FILE = Demo_QLTabbarController/Info.plist; 360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 361 | PRODUCT_NAME = "$(TARGET_NAME)"; 362 | }; 363 | name = Debug; 364 | }; 365 | C152FF741AE8DCF100A9550F /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 369 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 370 | INFOPLIST_FILE = Demo_QLTabbarController/Info.plist; 371 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 372 | PRODUCT_NAME = "$(TARGET_NAME)"; 373 | }; 374 | name = Release; 375 | }; 376 | C152FF761AE8DCF100A9550F /* Debug */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | BUNDLE_LOADER = "$(TEST_HOST)"; 380 | FRAMEWORK_SEARCH_PATHS = ( 381 | "$(SDKROOT)/Developer/Library/Frameworks", 382 | "$(inherited)", 383 | ); 384 | GCC_PREPROCESSOR_DEFINITIONS = ( 385 | "DEBUG=1", 386 | "$(inherited)", 387 | ); 388 | INFOPLIST_FILE = Demo_QLTabbarControllerTests/Info.plist; 389 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 390 | PRODUCT_NAME = "$(TARGET_NAME)"; 391 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo_QLTabbarController.app/Demo_QLTabbarController"; 392 | }; 393 | name = Debug; 394 | }; 395 | C152FF771AE8DCF100A9550F /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | BUNDLE_LOADER = "$(TEST_HOST)"; 399 | FRAMEWORK_SEARCH_PATHS = ( 400 | "$(SDKROOT)/Developer/Library/Frameworks", 401 | "$(inherited)", 402 | ); 403 | INFOPLIST_FILE = Demo_QLTabbarControllerTests/Info.plist; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Demo_QLTabbarController.app/Demo_QLTabbarController"; 407 | }; 408 | name = Release; 409 | }; 410 | /* End XCBuildConfiguration section */ 411 | 412 | /* Begin XCConfigurationList section */ 413 | C152FF4A1AE8DCF100A9550F /* Build configuration list for PBXProject "Demo_QLTabbarController" */ = { 414 | isa = XCConfigurationList; 415 | buildConfigurations = ( 416 | C152FF701AE8DCF100A9550F /* Debug */, 417 | C152FF711AE8DCF100A9550F /* Release */, 418 | ); 419 | defaultConfigurationIsVisible = 0; 420 | defaultConfigurationName = Release; 421 | }; 422 | C152FF721AE8DCF100A9550F /* Build configuration list for PBXNativeTarget "Demo_QLTabbarController" */ = { 423 | isa = XCConfigurationList; 424 | buildConfigurations = ( 425 | C152FF731AE8DCF100A9550F /* Debug */, 426 | C152FF741AE8DCF100A9550F /* Release */, 427 | ); 428 | defaultConfigurationIsVisible = 0; 429 | defaultConfigurationName = Release; 430 | }; 431 | C152FF751AE8DCF100A9550F /* Build configuration list for PBXNativeTarget "Demo_QLTabbarControllerTests" */ = { 432 | isa = XCConfigurationList; 433 | buildConfigurations = ( 434 | C152FF761AE8DCF100A9550F /* Debug */, 435 | C152FF771AE8DCF100A9550F /* Release */, 436 | ); 437 | defaultConfigurationIsVisible = 0; 438 | defaultConfigurationName = Release; 439 | }; 440 | /* End XCConfigurationList section */ 441 | }; 442 | rootObject = C152FF471AE8DCF100A9550F /* Project object */; 443 | } 444 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-29@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-29@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "idiom" : "ipad", 41 | "size" : "40x40", 42 | "scale" : "1x" 43 | }, 44 | { 45 | "idiom" : "ipad", 46 | "size" : "40x40", 47 | "scale" : "2x" 48 | } 49 | ], 50 | "info" : { 51 | "version" : 1, 52 | "author" : "xcode" 53 | } 54 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "filename" : "Default-568h@2x.png", 7 | "minimum-system-version" : "7.0", 8 | "subtype" : "retina4", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "orientation" : "portrait", 13 | "idiom" : "iphone", 14 | "filename" : "Default@2x.png", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_compose_button@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_button.imageset/tabbar_compose_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_button.imageset/tabbar_compose_button@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_compose_button_highlighted@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/tabbar_compose_button_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_button_highlighted.imageset/tabbar_compose_button_highlighted@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_icon_add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_compose_icon_add@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_icon_add.imageset/tabbar_compose_icon_add@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_icon_add.imageset/tabbar_compose_icon_add@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_compose_icon_add_highlighted@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/tabbar_compose_icon_add_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_compose_icon_add_highlighted.imageset/tabbar_compose_icon_add_highlighted@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_discover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_discover@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_discover.imageset/tabbar_discover@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_discover_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_discover_selected@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_discover_selected.imageset/tabbar_discover_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_discover_selected.imageset/tabbar_discover_selected@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_home@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_home.imageset/tabbar_home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_home.imageset/tabbar_home@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_home_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_home_selected@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_home_selected.imageset/tabbar_home_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_home_selected.imageset/tabbar_home_selected@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_message_center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_message_center@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_message_center.imageset/tabbar_message_center@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_message_center_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_message_center_selected@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_message_center_selected.imageset/tabbar_message_center_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_message_center_selected.imageset/tabbar_message_center_selected@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_profile.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_profile@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_profile.imageset/tabbar_profile@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_profile_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "tabbar_profile_selected@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_profile_selected.imageset/tabbar_profile_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShrekerNil/QLTabbarController/47fb3e00f5b082410e521ad68134c08c578b8575/Demo_QLTabbarController/Demo_QLTabbarController/Images.xcassets/TabBar/tabbar_profile_selected.imageset/tabbar_profile_selected@2x.png -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | personal.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UIViewControllerBasedStatusBarAppearance 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLAppDelegate.h 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QLAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLAppDelegate.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import "QLAppDelegate.h" 10 | #import "QLViewController.h" 11 | #import "QLMainViewController.h" 12 | 13 | @interface QLAppDelegate () 14 | 15 | @end 16 | 17 | @implementation QLAppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 22 | [_window setBackgroundColor:[UIColor whiteColor]]; 23 | 24 | [_window setRootViewController:[[UINavigationController alloc] initWithRootViewController:[[QLViewController alloc] init]]]; 25 | // [_window setRootViewController:[[UINavigationController alloc] initWithRootViewController:[[QLMainViewController alloc] init]]]; 26 | 27 | [_window makeKeyAndVisible]; 28 | return YES; 29 | } 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application { 32 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 34 | } 35 | 36 | - (void)applicationDidEnterBackground:(UIApplication *)application { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application { 42 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 43 | } 44 | 45 | - (void)applicationDidBecomeActive:(UIApplication *)application { 46 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLMainViewController.h 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/27. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | // UITabBarController 的用法 9 | 10 | #import 11 | 12 | @interface QLMainViewController : UITabBarController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLMainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLMainViewController.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/27. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import "QLMainViewController.h" 10 | #import "QLTestViewController.h" 11 | #import "QLTestTableViewController.h" 12 | 13 | #define kColorWithRGB(redValue, greenValue, blueValue) ([UIColor colorWithRed:((redValue)/255.0) green:((greenValue)/255.0) blue:((blueValue)/255.0) alpha:1]) 14 | #define kColorRandom kColorWithRGB(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256)) 15 | 16 | @interface QLMainViewController () 17 | 18 | @end 19 | 20 | @implementation QLMainViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | [self loadViewControllers]; 25 | } 26 | 27 | - (void)loadViewControllers { 28 | QLTestViewController *vc1 = [[QLTestViewController alloc] init]; 29 | vc1.view.backgroundColor = kColorRandom; 30 | vc1.title = @"首页"; 31 | vc1.tabBarItem.image = [UIImage imageNamed:@"tabbar_home"]; 32 | vc1.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_home_selected"]; 33 | 34 | QLTestTableViewController *vc2 = [[QLTestTableViewController alloc] init]; 35 | vc2.view.backgroundColor = kColorRandom; 36 | vc2.title = @"发现"; 37 | vc2.tabBarItem.image = [UIImage imageNamed:@"tabbar_discover"]; 38 | vc2.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_discover_selected"]; 39 | 40 | UIViewController *vc3 = [[UIViewController alloc] init]; 41 | vc3.view.backgroundColor = kColorRandom; 42 | vc3.title = @"消息"; 43 | vc3.tabBarItem.image = [UIImage imageNamed:@"tabbar_message_center"]; 44 | vc3.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_message_center_selected"]; 45 | 46 | UIViewController *vc4 = [[UIViewController alloc] init]; 47 | vc4.view.backgroundColor = kColorRandom; 48 | vc4.title = @"我"; 49 | vc4.tabBarItem.image = [UIImage imageNamed:@"tabbar_profile"]; 50 | vc4.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_profile_selected"]; 51 | 52 | [self setViewControllers:@[vc1, vc2, vc3, vc4] animated:NO]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTabBarController/QLTabBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLTabBar.h 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/24. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #define QLColorWithRGB(redValue, greenValue, blueValue) ([UIColor colorWithRed:((redValue)/255.0) green:((greenValue)/255.0) blue:((blueValue)/255.0) alpha:1]) 10 | #define QLColorRandom QLColorWithRGB(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256)) 11 | 12 | /** QLDEBUG Print | M:method, L:line, C:content*/ 13 | #ifdef DEBUG 14 | #define QLLog(FORMAT, ...) fprintf(stderr,"M:%s|L:%d|C->%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); 15 | #else 16 | #define QLLog(FORMAT, ...) 17 | #endif 18 | 19 | #import 20 | 21 | @protocol QLTabBarDelegate; 22 | 23 | @interface QLTabBar : UITabBar 24 | 25 | @property (nonatomic, copy) void (^blkDidSelectAtIndex)(NSUInteger index); 26 | @property (nonatomic, weak) id actionDelegate; 27 | 28 | - (void)insertSpecifiedMiddleView:(UIButton *)btnSpecified; 29 | 30 | @end 31 | 32 | @protocol QLTabBarDelegate 33 | 34 | @optional 35 | - (void)tabBar:(UITabBar *)tabBar didSelectAtIndex:(NSUInteger)index; 36 | - (void)tabBar:(UITabBar *)tabBar didSelectSpecifiedButton:(UIButton *)button; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTabBarController/QLTabBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLTabBar.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/24. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import "QLTabBar.h" 10 | 11 | @interface QLTabBar () 12 | { 13 | BOOL _hasSpecifiedMiddleView; 14 | __weak UIButton *_btnSpecified; 15 | } 16 | 17 | @end 18 | 19 | @implementation QLTabBar 20 | 21 | - (instancetype)initWithFrame:(CGRect)frame { 22 | if (self = [super initWithFrame:frame]) { 23 | [self loadUI]; 24 | } 25 | return self; 26 | } 27 | 28 | #pragma mark - 加载子视图 29 | - (void)loadUI { 30 | self.delegate = self; 31 | } 32 | 33 | #pragma mark - UITabBarDelegate 34 | - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item { 35 | NSInteger indexSelected = -1; 36 | if ([_actionDelegate respondsToSelector:@selector(tabBar:didSelectAtIndex:)]) { 37 | indexSelected = [self selectedIndexWithItem:item]; 38 | [_actionDelegate tabBar:self didSelectAtIndex:indexSelected]; 39 | } 40 | 41 | if (indexSelected != -1) { 42 | if (_blkDidSelectAtIndex) { 43 | _blkDidSelectAtIndex(indexSelected); 44 | } 45 | } 46 | 47 | } 48 | 49 | - (NSUInteger)selectedIndexWithItem:(UITabBarItem *)item { 50 | NSArray *arrItems = self.items; 51 | NSUInteger count = arrItems.count; 52 | for (NSUInteger index = 0; index < count; index ++) { 53 | if (item == arrItems[index]) { 54 | return index; 55 | } 56 | } 57 | return 0; 58 | } 59 | 60 | 61 | - (void)insertSpecifiedMiddleView:(UIButton *)btnSpecified { 62 | if (btnSpecified) { 63 | _hasSpecifiedMiddleView = YES; 64 | [btnSpecified addTarget:self action:@selector(specifiedButtonClickAction:) forControlEvents:UIControlEventTouchUpInside]; 65 | [self addSubview:btnSpecified]; 66 | _btnSpecified = btnSpecified; 67 | [self layoutIfNeeded]; 68 | } else { 69 | _hasSpecifiedMiddleView = NO; 70 | [_btnSpecified removeFromSuperview]; 71 | } 72 | } 73 | 74 | - (void)specifiedButtonClickAction:(UIButton *)button { 75 | if ([_actionDelegate respondsToSelector:@selector(tabBar:didSelectSpecifiedButton:)]) { 76 | [_actionDelegate tabBar:self didSelectSpecifiedButton:button]; 77 | } 78 | } 79 | 80 | - (void)layoutSubviews { 81 | [super layoutSubviews]; 82 | if (_hasSpecifiedMiddleView) { 83 | NSString *strUITabBarButton = @"UITabBarButton"; 84 | NSArray *arrSubViews = self.subviews; 85 | NSUInteger countSubviews = arrSubViews.count; 86 | NSUInteger countTabBarItem = 0; 87 | for (NSUInteger index = 0; index < countSubviews; index ++) { 88 | UIView *child = arrSubViews[index]; 89 | if ([child isKindOfClass:NSClassFromString(strUITabBarButton)]) { 90 | countTabBarItem ++; 91 | } 92 | } 93 | NSUInteger indexCurrent = 0; 94 | CGFloat fXBtnSpecified = 0; 95 | CGRect rectChild; 96 | for (NSUInteger index = 0; index < countSubviews; index ++) { 97 | UIView *child = arrSubViews[index]; 98 | if ([child isKindOfClass:NSClassFromString(strUITabBarButton)]) { 99 | rectChild = child.frame; 100 | rectChild.size.width = self.frame.size.width / (countTabBarItem + 1); 101 | if (index >= (countTabBarItem / 2) + 1) { 102 | rectChild.origin.x = (indexCurrent + 1) *rectChild.size.width; 103 | } else { 104 | rectChild.origin.x = indexCurrent *rectChild.size.width; 105 | } 106 | child.frame = rectChild; 107 | if ((countTabBarItem / 2) == index) { 108 | fXBtnSpecified = CGRectGetMaxX(child.frame); 109 | } 110 | indexCurrent ++; 111 | } 112 | } 113 | //  布局中间的View 114 | CGRect rectBtnSpecified = CGRectMake(fXBtnSpecified, 0, rectChild.size.width, self.frame.size.height); 115 | _btnSpecified.frame = rectBtnSpecified; 116 | } 117 | } 118 | 119 | - (void)setSelectedItem:(UITabBarItem *)selectedItem { 120 | [super setSelectedItem:selectedItem]; 121 | if ([_actionDelegate respondsToSelector:@selector(tabBar:didSelectAtIndex:)]) { 122 | [_actionDelegate tabBar:self didSelectAtIndex:selectedItem.tag]; 123 | } 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTabBarController/QLTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLTabBarController.h 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QLTabBar.h" 11 | 12 | @protocol QLTabBarControllerDelegate; 13 | 14 | @interface QLTabBarController : UIViewController 15 | 16 | @property (nonatomic, readonly) QLTabBar *tabBar; 17 | @property (nonatomic, assign) CGFloat tabBarHeight; 18 | @property (nonatomic, strong) NSArray *viewControllers; // child Controllers 19 | @property (nonatomic, weak) UIViewController *selectedViewController; 20 | @property (nonatomic) NSUInteger selectedIndex; 21 | 22 | @property (nonatomic, weak) id actionDelegate; 23 | 24 | - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated; 25 | 26 | @end 27 | 28 | @protocol QLTabBarControllerDelegate 29 | 30 | @optional 31 | - (void)tabBarController:(QLTabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController; 32 | - (void)tabBarController:(QLTabBarController *)tabBarController didSelectViewControllerAtIndex:(NSUInteger)index; 33 | //- (BOOL)tabBarController:(QLTabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController; 34 | 35 | //- (void)tabBarController:(QLTabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray *)viewControllers NS_AVAILABLE_IOS(3_0); 36 | //- (void)tabBarController:(QLTabBarController *)tabBarController willEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed NS_AVAILABLE_IOS(3_0); 37 | //- (void)tabBarController:(QLTabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed; 38 | //- (NSUInteger)tabBarControllerSupportedInterfaceOrientations:(QLTabBarController *)tabBarController NS_AVAILABLE_IOS(7_0); 39 | //- (UIInterfaceOrientation)tabBarControllerPreferredInterfaceOrientationForPresentation:(QLTabBarController *)tabBarController NS_AVAILABLE_IOS(7_0); 40 | //- (id )tabBarController:(QLTabBarController *)tabBarController interactionControllerForAnimationController: (id )animationController NS_AVAILABLE_IOS(7_0); 41 | //- (id )tabBarController:(QLTabBarController *)tabBarController animationControllerForTransitionFromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC NS_AVAILABLE_IOS(7_0); 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTabBarController/QLTabBarController.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLTabBarController.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import "QLTabBarController.h" 10 | 11 | #define kHeightNavigationBar 64 12 | #define kHeightTabBar 49 13 | 14 | @interface QLTabBarController () 15 | { 16 | UIViewController *_vcCurrent; 17 | } 18 | 19 | @end 20 | 21 | @implementation QLTabBarController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | [self loadDefaultSetting]; 26 | } 27 | 28 | #pragma mark - 加载初始化配置 29 | - (void)loadDefaultSetting { 30 | CGFloat fHeightDefault = kHeightTabBar; 31 | _tabBar = [[QLTabBar alloc] initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height-fHeightDefault, self.view.frame.size.width, fHeightDefault)]; 32 | _tabBar.actionDelegate = self; 33 | [self.view addSubview:_tabBar]; 34 | } 35 | 36 | #pragma mark - 设置字控制器 37 | - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated { 38 | _viewControllers = viewControllers; 39 | 40 | NSUInteger countViewControllers = _viewControllers.count; 41 | NSMutableArray *arrMTabBarItems = [NSMutableArray arrayWithCapacity:countViewControllers]; 42 | for (NSUInteger index = 0; index < countViewControllers; index ++) { 43 | UITabBarItem *tabBarItem = [viewControllers[index] tabBarItem]; 44 | tabBarItem.tag = index; 45 | [arrMTabBarItems addObject:tabBarItem]; 46 | 47 | UIViewController *viewController = viewControllers[index]; 48 | UIView *view = viewController.view; 49 | if ([view isKindOfClass:[UIView class]] && ![view isKindOfClass:[UIScrollView class]]) { 50 | CGSize sizeScreen = [UIScreen mainScreen].bounds.size; 51 | view.bounds = CGRectMake(0, -kHeightNavigationBar, sizeScreen.width, CGRectGetHeight(view.frame)-kHeightNavigationBar); 52 | view.frame = CGRectMake(0, 0, sizeScreen.width, sizeScreen.height); 53 | } else if ([view isKindOfClass:[UIScrollView class]]) { 54 | UIScrollView *scrollView = (UIScrollView *)view; 55 | [scrollView setContentInset:UIEdgeInsetsMake(kHeightNavigationBar, 0, kHeightTabBar, 0)]; 56 | [scrollView setScrollIndicatorInsets:scrollView.contentInset]; 57 | } 58 | [self addChildViewController:viewController]; 59 | } 60 | [_tabBar setItems:[arrMTabBarItems copy] animated:animated]; 61 | [_tabBar setSelectedItem:[[arrMTabBarItems copy] firstObject]]; 62 | } 63 | 64 | #pragma mark - 属性重写 65 | - (void)setViewControllers:(NSArray *)viewControllers { 66 | _viewControllers = viewControllers; 67 | [self setViewControllers:viewControllers animated:NO]; 68 | } 69 | 70 | #pragma mark - QLTabBarDelegate 71 | - (void)tabBar:(UITabBar *)tabBar didSelectAtIndex:(NSUInteger)index { 72 | UIViewController *viewController = self.viewControllers[index]; // 多态的应用 73 | if (viewController == _vcCurrent) return ; 74 | if (_vcCurrent) { 75 | [_vcCurrent.view removeFromSuperview]; 76 | } 77 | viewController.view.frame = [UIScreen mainScreen].bounds; 78 | [viewController.view setAutoresizingMask:UIViewAutoresizingFlexibleHeight]; 79 | [self.view addSubview:viewController.view]; 80 | _vcCurrent = viewController; 81 | 82 | self.navigationItem.leftBarButtonItem = _vcCurrent.navigationItem.leftBarButtonItem; 83 | self.navigationItem.leftBarButtonItems = _vcCurrent.navigationItem.leftBarButtonItems; 84 | self.navigationItem.rightBarButtonItem = _vcCurrent.navigationItem.rightBarButtonItem; 85 | self.navigationItem.rightBarButtonItems = _vcCurrent.navigationItem.rightBarButtonItems; 86 | self.navigationItem.titleView = _vcCurrent.navigationItem.titleView; 87 | self.navigationItem.title = _vcCurrent.navigationItem.title; 88 | 89 | // 通知代理点击事件 90 | if ([_actionDelegate respondsToSelector:@selector(tabBarController:didSelectViewControllerAtIndex:)]) { 91 | [_actionDelegate tabBarController:self didSelectViewControllerAtIndex:index]; 92 | } 93 | if ([_actionDelegate respondsToSelector:@selector(tabBarController:didSelectViewController:)]) { 94 | [_actionDelegate tabBarController:self didSelectViewController:_vcCurrent]; 95 | } 96 | 97 | [self.view bringSubviewToFront:_tabBar]; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTestTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLTestTableViewController.h 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/27. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QLTestTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTestTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLTestTableViewController.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/27. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import "QLTestTableViewController.h" 10 | 11 | @interface QLTestTableViewController () 12 | 13 | @end 14 | 15 | @implementation QLTestTableViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | } 20 | 21 | #pragma mark - UITableViewDataSource, UITableViewDelegate 22 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 23 | return 18; 24 | } 25 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 26 | static NSString *strId = @"cellStyle1"; 27 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:strId]; 28 | if (!cell) { 29 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:strId]; 30 | } 31 | cell.textLabel.text = @"test"; 32 | 33 | return cell; 34 | } 35 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 36 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 37 | NSLog(@"%s~%@", __FUNCTION__, indexPath); 38 | 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLTestViewController.h 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/27. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QLTestViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLTestViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLTestViewController.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/27. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import "QLTestViewController.h" 10 | 11 | @interface QLTestViewController () 12 | 13 | @end 14 | 15 | @implementation QLTestViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | [self.view addSubview:[UIButton buttonWithType:UIButtonTypeContactAdd]]; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QLViewController.h 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | // QLTabBarController 的用法 9 | 10 | #import 11 | #import "QLTabBarController.h" 12 | 13 | @interface QLViewController : QLTabBarController 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/QLViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // QLViewController.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import "QLViewController.h" 10 | #import "QLTestViewController.h" 11 | #import "QLTestTableViewController.h" 12 | 13 | @interface QLViewController () 14 | 15 | @end 16 | 17 | @implementation QLViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.actionDelegate = self; 22 | [self loadViewControllers]; 23 | UIButton *btnMiddle = [UIButton buttonWithType:UIButtonTypeCustom]; 24 | [btnMiddle setBackgroundImage:[UIImage imageNamed:@"tabbar_compose_button"] forState:UIControlStateNormal]; 25 | [btnMiddle setBackgroundImage:[UIImage imageNamed:@"tabbar_compose_button_highlighted"] forState:UIControlStateHighlighted]; 26 | [btnMiddle setImage:[UIImage imageNamed:@"tabbar_compose_icon_add"] forState:UIControlStateNormal]; 27 | [btnMiddle setImage:[UIImage imageNamed:@"tabbar_compose_icon_add_highlighted"] forState:UIControlStateHighlighted]; 28 | [self.tabBar setActionDelegate:self]; 29 | [self.tabBar insertSpecifiedMiddleView:btnMiddle]; 30 | } 31 | 32 | - (void)loadViewControllers { 33 | QLTestViewController *vc1 = [[QLTestViewController alloc] init]; 34 | vc1.view.backgroundColor = QLColorRandom; 35 | vc1.title = @"首页"; 36 | vc1.tabBarItem.image = [UIImage imageNamed:@"tabbar_home"]; 37 | vc1.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_home_selected"]; 38 | 39 | QLTestTableViewController *vc2 = [[QLTestTableViewController alloc] init]; 40 | vc2.view.backgroundColor = QLColorRandom; 41 | vc2.title = @"发现"; 42 | vc2.tabBarItem.image = [UIImage imageNamed:@"tabbar_discover"]; 43 | vc2.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_discover_selected"]; 44 | 45 | UIViewController *vc3 = [[UIViewController alloc] init]; 46 | vc3.view.backgroundColor = QLColorRandom; 47 | vc3.title = @"消息"; 48 | vc3.tabBarItem.image = [UIImage imageNamed:@"tabbar_message_center"]; 49 | vc3.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_message_center_selected"]; 50 | 51 | UIViewController *vc4 = [[UIViewController alloc] init]; 52 | vc4.view.backgroundColor = QLColorRandom; 53 | vc4.title = @"我"; 54 | vc4.tabBarItem.image = [UIImage imageNamed:@"tabbar_profile"]; 55 | vc4.tabBarItem.selectedImage = [UIImage imageNamed:@"tabbar_profile_selected"]; 56 | 57 | [self setViewControllers:@[vc1, vc2, vc3, vc4] animated:NO]; 58 | } 59 | 60 | #pragma mark - QLTabBarControllerDelegate 61 | - (void)tabBarController:(QLTabBarController *)tabBarController didSelectViewControllerAtIndex:(NSUInteger)index { 62 | QLLog(@"%@", @(index)); 63 | } 64 | - (void)tabBarController:(QLTabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { 65 | QLLog(@"%@", viewController); 66 | } 67 | #pragma mark - QLTabBarDelegate 68 | - (void)tabBar:(UITabBar *)tabBar didSelectSpecifiedButton:(UIButton *)button { 69 | QLLog(@"%@", button); 70 | UIViewController *vcTest = [[UIViewController alloc] init]; 71 | vcTest.view.backgroundColor = QLColorRandom; 72 | UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeContactAdd]; 73 | [btnBack addTarget:self action:@selector(cancelAction:) forControlEvents:UIControlEventTouchUpInside]; 74 | [vcTest.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:btnBack]]; 75 | vcTest.title = @"测试"; 76 | [self presentViewController:[[UINavigationController alloc] initWithRootViewController:vcTest] animated:YES completion:nil]; 77 | } 78 | 79 | - (void)cancelAction:(UIButton *)btn { 80 | [self dismissViewControllerAnimated:YES completion:nil]; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarController/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Demo_QLTabbarController 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QLAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([QLAppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarControllerTests/Demo_QLTabbarControllerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Demo_QLTabbarControllerTests.m 3 | // Demo_QLTabbarControllerTests 4 | // 5 | // Created by Temeier on 15/4/23. 6 | // Copyright (c) 2015年 Shrek. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface Demo_QLTabbarControllerTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation Demo_QLTabbarControllerTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Demo_QLTabbarController/Demo_QLTabbarControllerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | personal.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QLTabbarController 2 | 这是一个自定义的TabBar控制器,能在TabBar中间位置插入一个UIButton,其效果模仿新浪微博, 只需要添加一行代码([self.tabBar insertSpecifiedMiddleView:btnMiddle];)即可在TabBar中间添加一个按钮 3 | --------------------------------------------------------------------------------