├── NFXPullTab.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Tomoya_Hirano.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Tomoya_Hirano.xcuserdatad │ └── xcschemes │ ├── NFXPullTab.xcscheme │ └── xcschememanagement.plist ├── NFXPullTab ├── AppDelegate.h ├── AppDelegate.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── NFXPullTabViewController.h ├── NFXPullTabViewController.m ├── ViewController.h ├── ViewController.m └── main.m ├── NFXPullTabTests ├── Info.plist └── NFXPullTabTests.m ├── README.md └── sample.gif /NFXPullTab.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D76964DA1A76DAD500F95873 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D76964D91A76DAD500F95873 /* main.m */; }; 11 | D76964DD1A76DAD500F95873 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D76964DC1A76DAD500F95873 /* AppDelegate.m */; }; 12 | D76964E01A76DAD500F95873 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D76964DF1A76DAD500F95873 /* ViewController.m */; }; 13 | D76964E51A76DAD500F95873 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D76964E41A76DAD500F95873 /* Images.xcassets */; }; 14 | D76964F41A76DAD500F95873 /* NFXPullTabTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D76964F31A76DAD500F95873 /* NFXPullTabTests.m */; }; 15 | D76965001A76DCDE00F95873 /* NFXPullTabViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D76964FF1A76DCDE00F95873 /* NFXPullTabViewController.m */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | D76964EE1A76DAD500F95873 /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = D76964CC1A76DAD500F95873 /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = D76964D31A76DAD500F95873; 24 | remoteInfo = NFXPullTab; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | D76964D41A76DAD500F95873 /* NFXPullTab.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NFXPullTab.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | D76964D81A76DAD500F95873 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | D76964D91A76DAD500F95873 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | D76964DB1A76DAD500F95873 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 33 | D76964DC1A76DAD500F95873 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 34 | D76964DE1A76DAD500F95873 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 35 | D76964DF1A76DAD500F95873 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 36 | D76964E41A76DAD500F95873 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 37 | D76964ED1A76DAD500F95873 /* NFXPullTabTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NFXPullTabTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | D76964F21A76DAD500F95873 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | D76964F31A76DAD500F95873 /* NFXPullTabTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NFXPullTabTests.m; sourceTree = ""; }; 40 | D76964FE1A76DCDE00F95873 /* NFXPullTabViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NFXPullTabViewController.h; sourceTree = ""; }; 41 | D76964FF1A76DCDE00F95873 /* NFXPullTabViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NFXPullTabViewController.m; sourceTree = ""; }; 42 | /* End PBXFileReference section */ 43 | 44 | /* Begin PBXFrameworksBuildPhase section */ 45 | D76964D11A76DAD500F95873 /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | D76964EA1A76DAD500F95873 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | /* End PBXFrameworksBuildPhase section */ 60 | 61 | /* Begin PBXGroup section */ 62 | D76964CB1A76DAD500F95873 = { 63 | isa = PBXGroup; 64 | children = ( 65 | D76964D61A76DAD500F95873 /* NFXPullTab */, 66 | D76964F01A76DAD500F95873 /* NFXPullTabTests */, 67 | D76964D51A76DAD500F95873 /* Products */, 68 | ); 69 | sourceTree = ""; 70 | }; 71 | D76964D51A76DAD500F95873 /* Products */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | D76964D41A76DAD500F95873 /* NFXPullTab.app */, 75 | D76964ED1A76DAD500F95873 /* NFXPullTabTests.xctest */, 76 | ); 77 | name = Products; 78 | sourceTree = ""; 79 | }; 80 | D76964D61A76DAD500F95873 /* NFXPullTab */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | D76964FD1A76DAE100F95873 /* lib */, 84 | D76964DB1A76DAD500F95873 /* AppDelegate.h */, 85 | D76964DC1A76DAD500F95873 /* AppDelegate.m */, 86 | D76964DE1A76DAD500F95873 /* ViewController.h */, 87 | D76964DF1A76DAD500F95873 /* ViewController.m */, 88 | D76964E41A76DAD500F95873 /* Images.xcassets */, 89 | D76964D71A76DAD500F95873 /* Supporting Files */, 90 | ); 91 | path = NFXPullTab; 92 | sourceTree = ""; 93 | }; 94 | D76964D71A76DAD500F95873 /* Supporting Files */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | D76964D81A76DAD500F95873 /* Info.plist */, 98 | D76964D91A76DAD500F95873 /* main.m */, 99 | ); 100 | name = "Supporting Files"; 101 | sourceTree = ""; 102 | }; 103 | D76964F01A76DAD500F95873 /* NFXPullTabTests */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | D76964F31A76DAD500F95873 /* NFXPullTabTests.m */, 107 | D76964F11A76DAD500F95873 /* Supporting Files */, 108 | ); 109 | path = NFXPullTabTests; 110 | sourceTree = ""; 111 | }; 112 | D76964F11A76DAD500F95873 /* Supporting Files */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | D76964F21A76DAD500F95873 /* Info.plist */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | D76964FD1A76DAE100F95873 /* lib */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | D76964FE1A76DCDE00F95873 /* NFXPullTabViewController.h */, 124 | D76964FF1A76DCDE00F95873 /* NFXPullTabViewController.m */, 125 | ); 126 | name = lib; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | D76964D31A76DAD500F95873 /* NFXPullTab */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = D76964F71A76DAD500F95873 /* Build configuration list for PBXNativeTarget "NFXPullTab" */; 135 | buildPhases = ( 136 | D76964D01A76DAD500F95873 /* Sources */, 137 | D76964D11A76DAD500F95873 /* Frameworks */, 138 | D76964D21A76DAD500F95873 /* Resources */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = NFXPullTab; 145 | productName = NFXPullTab; 146 | productReference = D76964D41A76DAD500F95873 /* NFXPullTab.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | D76964EC1A76DAD500F95873 /* NFXPullTabTests */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = D76964FA1A76DAD500F95873 /* Build configuration list for PBXNativeTarget "NFXPullTabTests" */; 152 | buildPhases = ( 153 | D76964E91A76DAD500F95873 /* Sources */, 154 | D76964EA1A76DAD500F95873 /* Frameworks */, 155 | D76964EB1A76DAD500F95873 /* Resources */, 156 | ); 157 | buildRules = ( 158 | ); 159 | dependencies = ( 160 | D76964EF1A76DAD500F95873 /* PBXTargetDependency */, 161 | ); 162 | name = NFXPullTabTests; 163 | productName = NFXPullTabTests; 164 | productReference = D76964ED1A76DAD500F95873 /* NFXPullTabTests.xctest */; 165 | productType = "com.apple.product-type.bundle.unit-test"; 166 | }; 167 | /* End PBXNativeTarget section */ 168 | 169 | /* Begin PBXProject section */ 170 | D76964CC1A76DAD500F95873 /* Project object */ = { 171 | isa = PBXProject; 172 | attributes = { 173 | LastUpgradeCheck = 0610; 174 | ORGANIZATIONNAME = Tomoya_Hirano; 175 | TargetAttributes = { 176 | D76964D31A76DAD500F95873 = { 177 | CreatedOnToolsVersion = 6.1.1; 178 | }; 179 | D76964EC1A76DAD500F95873 = { 180 | CreatedOnToolsVersion = 6.1.1; 181 | TestTargetID = D76964D31A76DAD500F95873; 182 | }; 183 | }; 184 | }; 185 | buildConfigurationList = D76964CF1A76DAD500F95873 /* Build configuration list for PBXProject "NFXPullTab" */; 186 | compatibilityVersion = "Xcode 3.2"; 187 | developmentRegion = English; 188 | hasScannedForEncodings = 0; 189 | knownRegions = ( 190 | en, 191 | Base, 192 | ); 193 | mainGroup = D76964CB1A76DAD500F95873; 194 | productRefGroup = D76964D51A76DAD500F95873 /* Products */; 195 | projectDirPath = ""; 196 | projectRoot = ""; 197 | targets = ( 198 | D76964D31A76DAD500F95873 /* NFXPullTab */, 199 | D76964EC1A76DAD500F95873 /* NFXPullTabTests */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | D76964D21A76DAD500F95873 /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | D76964E51A76DAD500F95873 /* Images.xcassets in Resources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | D76964EB1A76DAD500F95873 /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | D76964D01A76DAD500F95873 /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | D76965001A76DCDE00F95873 /* NFXPullTabViewController.m in Sources */, 228 | D76964E01A76DAD500F95873 /* ViewController.m in Sources */, 229 | D76964DD1A76DAD500F95873 /* AppDelegate.m in Sources */, 230 | D76964DA1A76DAD500F95873 /* main.m in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | D76964E91A76DAD500F95873 /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | D76964F41A76DAD500F95873 /* NFXPullTabTests.m in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXSourcesBuildPhase section */ 243 | 244 | /* Begin PBXTargetDependency section */ 245 | D76964EF1A76DAD500F95873 /* PBXTargetDependency */ = { 246 | isa = PBXTargetDependency; 247 | target = D76964D31A76DAD500F95873 /* NFXPullTab */; 248 | targetProxy = D76964EE1A76DAD500F95873 /* PBXContainerItemProxy */; 249 | }; 250 | /* End PBXTargetDependency section */ 251 | 252 | /* Begin XCBuildConfiguration section */ 253 | D76964F51A76DAD500F95873 /* Debug */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ALWAYS_SEARCH_USER_PATHS = NO; 257 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 258 | CLANG_CXX_LIBRARY = "libc++"; 259 | CLANG_ENABLE_MODULES = YES; 260 | CLANG_ENABLE_OBJC_ARC = YES; 261 | CLANG_WARN_BOOL_CONVERSION = YES; 262 | CLANG_WARN_CONSTANT_CONVERSION = YES; 263 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 264 | CLANG_WARN_EMPTY_BODY = YES; 265 | CLANG_WARN_ENUM_CONVERSION = YES; 266 | CLANG_WARN_INT_CONVERSION = YES; 267 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 268 | CLANG_WARN_UNREACHABLE_CODE = YES; 269 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 270 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 271 | COPY_PHASE_STRIP = NO; 272 | ENABLE_STRICT_OBJC_MSGSEND = YES; 273 | GCC_C_LANGUAGE_STANDARD = gnu99; 274 | GCC_DYNAMIC_NO_PIC = NO; 275 | GCC_OPTIMIZATION_LEVEL = 0; 276 | GCC_PREPROCESSOR_DEFINITIONS = ( 277 | "DEBUG=1", 278 | "$(inherited)", 279 | ); 280 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 283 | GCC_WARN_UNDECLARED_SELECTOR = YES; 284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 285 | GCC_WARN_UNUSED_FUNCTION = YES; 286 | GCC_WARN_UNUSED_VARIABLE = YES; 287 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 288 | MTL_ENABLE_DEBUG_INFO = YES; 289 | ONLY_ACTIVE_ARCH = YES; 290 | SDKROOT = iphoneos; 291 | }; 292 | name = Debug; 293 | }; 294 | D76964F61A76DAD500F95873 /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ALWAYS_SEARCH_USER_PATHS = NO; 298 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 299 | CLANG_CXX_LIBRARY = "libc++"; 300 | CLANG_ENABLE_MODULES = YES; 301 | CLANG_ENABLE_OBJC_ARC = YES; 302 | CLANG_WARN_BOOL_CONVERSION = YES; 303 | CLANG_WARN_CONSTANT_CONVERSION = YES; 304 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 305 | CLANG_WARN_EMPTY_BODY = YES; 306 | CLANG_WARN_ENUM_CONVERSION = YES; 307 | CLANG_WARN_INT_CONVERSION = YES; 308 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 309 | CLANG_WARN_UNREACHABLE_CODE = YES; 310 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 311 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 312 | COPY_PHASE_STRIP = YES; 313 | ENABLE_NS_ASSERTIONS = NO; 314 | ENABLE_STRICT_OBJC_MSGSEND = YES; 315 | GCC_C_LANGUAGE_STANDARD = gnu99; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 323 | MTL_ENABLE_DEBUG_INFO = NO; 324 | SDKROOT = iphoneos; 325 | VALIDATE_PRODUCT = YES; 326 | }; 327 | name = Release; 328 | }; 329 | D76964F81A76DAD500F95873 /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 333 | INFOPLIST_FILE = NFXPullTab/Info.plist; 334 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 335 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 336 | PRODUCT_NAME = "$(TARGET_NAME)"; 337 | }; 338 | name = Debug; 339 | }; 340 | D76964F91A76DAD500F95873 /* Release */ = { 341 | isa = XCBuildConfiguration; 342 | buildSettings = { 343 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 344 | INFOPLIST_FILE = NFXPullTab/Info.plist; 345 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 346 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 347 | PRODUCT_NAME = "$(TARGET_NAME)"; 348 | }; 349 | name = Release; 350 | }; 351 | D76964FB1A76DAD500F95873 /* Debug */ = { 352 | isa = XCBuildConfiguration; 353 | buildSettings = { 354 | BUNDLE_LOADER = "$(TEST_HOST)"; 355 | FRAMEWORK_SEARCH_PATHS = ( 356 | "$(SDKROOT)/Developer/Library/Frameworks", 357 | "$(inherited)", 358 | ); 359 | GCC_PREPROCESSOR_DEFINITIONS = ( 360 | "DEBUG=1", 361 | "$(inherited)", 362 | ); 363 | INFOPLIST_FILE = NFXPullTabTests/Info.plist; 364 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 365 | PRODUCT_NAME = "$(TARGET_NAME)"; 366 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NFXPullTab.app/NFXPullTab"; 367 | }; 368 | name = Debug; 369 | }; 370 | D76964FC1A76DAD500F95873 /* Release */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | BUNDLE_LOADER = "$(TEST_HOST)"; 374 | FRAMEWORK_SEARCH_PATHS = ( 375 | "$(SDKROOT)/Developer/Library/Frameworks", 376 | "$(inherited)", 377 | ); 378 | INFOPLIST_FILE = NFXPullTabTests/Info.plist; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 380 | PRODUCT_NAME = "$(TARGET_NAME)"; 381 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NFXPullTab.app/NFXPullTab"; 382 | }; 383 | name = Release; 384 | }; 385 | /* End XCBuildConfiguration section */ 386 | 387 | /* Begin XCConfigurationList section */ 388 | D76964CF1A76DAD500F95873 /* Build configuration list for PBXProject "NFXPullTab" */ = { 389 | isa = XCConfigurationList; 390 | buildConfigurations = ( 391 | D76964F51A76DAD500F95873 /* Debug */, 392 | D76964F61A76DAD500F95873 /* Release */, 393 | ); 394 | defaultConfigurationIsVisible = 0; 395 | defaultConfigurationName = Release; 396 | }; 397 | D76964F71A76DAD500F95873 /* Build configuration list for PBXNativeTarget "NFXPullTab" */ = { 398 | isa = XCConfigurationList; 399 | buildConfigurations = ( 400 | D76964F81A76DAD500F95873 /* Debug */, 401 | D76964F91A76DAD500F95873 /* Release */, 402 | ); 403 | defaultConfigurationIsVisible = 0; 404 | }; 405 | D76964FA1A76DAD500F95873 /* Build configuration list for PBXNativeTarget "NFXPullTabTests" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | D76964FB1A76DAD500F95873 /* Debug */, 409 | D76964FC1A76DAD500F95873 /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | }; 413 | /* End XCConfigurationList section */ 414 | }; 415 | rootObject = D76964CC1A76DAD500F95873 /* Project object */; 416 | } 417 | -------------------------------------------------------------------------------- /NFXPullTab.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NFXPullTab.xcodeproj/project.xcworkspace/xcuserdata/Tomoya_Hirano.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noppefoxwolf/NFXPullTab/9539ca6aad88f11502d27ab0aa6181be2c414003/NFXPullTab.xcodeproj/project.xcworkspace/xcuserdata/Tomoya_Hirano.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /NFXPullTab.xcodeproj/xcuserdata/Tomoya_Hirano.xcuserdatad/xcschemes/NFXPullTab.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /NFXPullTab.xcodeproj/xcuserdata/Tomoya_Hirano.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NFXPullTab.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | D76964D31A76DAD500F95873 16 | 17 | primary 18 | 19 | 20 | D76964EC1A76DAD500F95873 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /NFXPullTab/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // NFXPullTab 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /NFXPullTab/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // NFXPullTab 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "NFXPullTabViewController.h" 11 | #import "ViewController.h" 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; 22 | NFXPullTabViewController*vc = [[NFXPullTabViewController alloc] init]; 23 | NSMutableArray*vcs = [NSMutableArray new]; 24 | for (int i=0; i<5; i++) { 25 | ViewController*sub = [ViewController new]; 26 | sub.title = [NSString stringWithFormat:@"name:%d",i]; 27 | sub.index = i; 28 | [vcs addObject:sub]; 29 | } 30 | [vc setViewControllers:vcs]; 31 | [vc setSelectedIndex:0]; 32 | self.window.rootViewController = vc; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | - (void)applicationWillResignActive:(UIApplication *)application { 38 | // 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. 39 | // 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. 40 | } 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application { 43 | // 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. 44 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 45 | } 46 | 47 | - (void)applicationWillEnterForeground:(UIApplication *)application { 48 | // 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. 49 | } 50 | 51 | - (void)applicationDidBecomeActive:(UIApplication *)application { 52 | // 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. 53 | } 54 | 55 | - (void)applicationWillTerminate:(UIApplication *)application { 56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /NFXPullTab/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /NFXPullTab/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.fivemeo.$(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 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /NFXPullTab/NFXPullTabViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NFXPullTabViewController.h 3 | // NFXPullTab 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NFXPullTabViewController : UIViewController 12 | -(void)setViewControllers:(NSArray*)controllers; 13 | -(void)setSelectedIndex:(int)index; 14 | @end 15 | -------------------------------------------------------------------------------- /NFXPullTab/NFXPullTabViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NFXPullTabViewController.m 3 | // NFXPullTab 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import "NFXPullTabViewController.h" 10 | 11 | typedef enum : NSInteger { 12 | NFXPullStateNone, 13 | NFXPullStatePull, 14 | NFXPullStateReverse 15 | }NFXPullState; 16 | 17 | @interface NFXPullTabViewController (){ 18 | UITableView*_tableView; 19 | UIScrollView*_scrollView; 20 | NSArray*_viewcontrollers; 21 | int _currentIndex; 22 | NFXPullState state; 23 | } 24 | 25 | @end 26 | 27 | @implementation NFXPullTabViewController 28 | 29 | - (void)viewDidLoad { 30 | [super viewDidLoad]; 31 | _currentIndex = -1; 32 | state = NFXPullStateNone; 33 | 34 | _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; 35 | _tableView.backgroundColor = [UIColor colorWithRed:0.078 green:0.078 blue:0.078 alpha:1]; 36 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 37 | _tableView.delegate = self; 38 | _tableView.dataSource = self; 39 | _tableView.userInteractionEnabled = false; 40 | [self.view addSubview:_tableView]; 41 | 42 | _scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds]; 43 | _scrollView.alwaysBounceHorizontal = true; 44 | _scrollView.contentSize = self.view.bounds.size; 45 | _scrollView.delegate = self; 46 | [self.view addSubview:_scrollView]; 47 | } 48 | 49 | - (void)didReceiveMemoryWarning { 50 | [super didReceiveMemoryWarning]; 51 | } 52 | 53 | 54 | #pragma mark delegate(UIScrollView) 55 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 56 | NSLog(@"%f",scrollView.contentOffset.x); 57 | 58 | if (scrollView.contentOffset.x==0) { 59 | state = NFXPullStateNone; 60 | scrollView.userInteractionEnabled = true; 61 | return; 62 | } 63 | 64 | if (scrollView.contentOffset.x>0) { 65 | scrollView.contentOffset = CGPointMake(0, 0); 66 | return; 67 | } 68 | 69 | if (state != NFXPullStateReverse) { 70 | int index = -(scrollView.contentOffset.x+60)/(self.view.bounds.size.width/2.5-60)*(_viewcontrollers.count+1); 71 | [_tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] 72 | animated:false 73 | scrollPosition:UITableViewScrollPositionNone]; 74 | } 75 | } 76 | 77 | -(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 78 | if (scrollView.contentOffset.x>=0) { 79 | return; 80 | } 81 | scrollView.userInteractionEnabled = false; 82 | state = NFXPullStateReverse; 83 | int index = -(scrollView.contentOffset.x+60)/(self.view.bounds.size.width/2.5-60)*(_viewcontrollers.count+1); 84 | [self setSelectedIndex:index]; 85 | } 86 | 87 | #pragma mark delegate(UItableView) 88 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 89 | return _viewcontrollers.count; 90 | } 91 | 92 | -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 93 | UITableViewCell*cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 94 | cell.textLabel.textColor = [UIColor whiteColor]; 95 | UIViewController*vc = _viewcontrollers[indexPath.row]; 96 | cell.backgroundColor = [UIColor colorWithRed:0.141 green:0.141 blue:0.141 alpha:1]; 97 | cell.textLabel.text = vc.title; 98 | return cell; 99 | } 100 | 101 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ 102 | return 20; 103 | } 104 | 105 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ 106 | UIView *view = [UIView new]; 107 | view.backgroundColor = [UIColor clearColor]; 108 | return view; 109 | } 110 | 111 | 112 | #pragma mark setter 113 | 114 | -(void)setViewControllers:(NSArray *)controllers{ 115 | _viewcontrollers = controllers; 116 | } 117 | 118 | -(void)setSelectedIndex:(int)index{ 119 | if (_currentIndex>0) { 120 | [self hideContentController:_viewcontrollers[_currentIndex]]; 121 | } else if(index >= _viewcontrollers.count) { //Out of bounds crash fix. 122 | return; 123 | } 124 | [self displayContentController:_viewcontrollers[index]]; 125 | _currentIndex = index; 126 | } 127 | 128 | 129 | #pragma mark container method 130 | - (void)displayContentController:(UIViewController *)content{ 131 | [self addChildViewController:content]; 132 | content.view.bounds = self.view.bounds; 133 | [_scrollView addSubview:content.view]; 134 | [content didMoveToParentViewController:self]; 135 | } 136 | 137 | - (void)hideContentController:(UIViewController *)content{ 138 | [content willMoveToParentViewController:nil]; 139 | [content.view removeFromSuperview]; 140 | [content removeFromParentViewController]; 141 | } 142 | @end 143 | -------------------------------------------------------------------------------- /NFXPullTab/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // NFXPullTab 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | @property int index; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /NFXPullTab/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // NFXPullTab 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | 21 | UILabel*lbl = [[UILabel alloc] initWithFrame:self.view.bounds]; 22 | lbl.text = [NSString stringWithFormat:@"%d",self.index]; 23 | lbl.backgroundColor = [UIColor colorWithHue:(float)self.index/5 saturation:1 brightness:1 alpha:1]; 24 | lbl.textAlignment = NSTextAlignmentCenter; 25 | lbl.font = [UIFont systemFontOfSize:60]; 26 | [self.view addSubview:lbl]; 27 | } 28 | 29 | - (void)didReceiveMemoryWarning { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /NFXPullTab/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NFXPullTab 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NFXPullTabTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.fivemeo.$(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 | -------------------------------------------------------------------------------- /NFXPullTabTests/NFXPullTabTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NFXPullTabTests.m 3 | // NFXPullTabTests 4 | // 5 | // Created by Tomoya_Hirano on 2015/01/27. 6 | // Copyright (c) 2015年 Tomoya_Hirano. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface NFXPullTabTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation NFXPullTabTests 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NFXPullTab 2 | -- 3 | ##Introduction 4 | Easy way to select ViewController. 5 | 6 | ##Demo 7 | ![sample](https://raw.githubusercontent.com/noppefoxwolf/NFXPullTab/master/sample.gif) 8 | 9 | ##Example 10 | 11 | ```objc 12 | NFXPullTabViewController*vc = [[NFXPullTabViewController alloc] init]; 13 | NSMutableArray*vcs = [NSMutableArray new]; 14 | [vc setViewControllers:@[v1,v2,v3]]; 15 | [vc setSelectedIndex:0]; 16 | ``` 17 | 18 | ##License🍺 19 | "THE BEER-WARE LICENSE" (Rivision 42): noppefoxwolf is contributing to this project. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. -------------------------------------------------------------------------------- /sample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noppefoxwolf/NFXPullTab/9539ca6aad88f11502d27ab0aa6181be2c414003/sample.gif --------------------------------------------------------------------------------