diff --git a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo.xcodeproj/project.pbxproj b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo.xcodeproj/project.pbxproj index aed796c..643ae39 100644 --- a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo.xcodeproj/project.pbxproj +++ b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo.xcodeproj/project.pbxproj @@ -7,34 +7,35 @@ objects = { /* Begin PBXBuildFile section */ + 9BA31574153C76CE002E7628 /* libNGTabBarController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BA3156F153C769C002E7628 /* libNGTabBarController.a */; }; 9BEA2B5714ED1B4A00AEE977 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BEA2B5614ED1B4A00AEE977 /* UIKit.framework */; }; 9BEA2B5914ED1B4A00AEE977 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BEA2B5814ED1B4A00AEE977 /* Foundation.framework */; }; 9BEA2B5B14ED1B4A00AEE977 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BEA2B5A14ED1B4A00AEE977 /* CoreGraphics.framework */; }; 9BEA2B6114ED1B4A00AEE977 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9BEA2B5F14ED1B4A00AEE977 /* InfoPlist.strings */; }; 9BEA2B6314ED1B4A00AEE977 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEA2B6214ED1B4A00AEE977 /* main.m */; }; 9BEA2B6714ED1B4A00AEE977 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEA2B6614ED1B4A00AEE977 /* AppDelegate.m */; }; - 9BEA2B7F14ED1B8900AEE977 /* libNGVerticalTabBarController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BEA2B7214ED1B5A00AEE977 /* libNGVerticalTabBarController.a */; }; 9BEA2B8214ED1BC300AEE977 /* NGColoredViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEA2B8114ED1BC300AEE977 /* NGColoredViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 9BEA2B7114ED1B5A00AEE977 /* PBXContainerItemProxy */ = { + 9BA3156E153C769C002E7628 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 9BEA2B6D14ED1B5A00AEE977 /* NGVerticalTabBarController.xcodeproj */; + containerPortal = 9BA31567153C769C002E7628 /* NGTabBarController.xcodeproj */; proxyType = 2; remoteGlobalIDString = 9B80B52D14EA8F7100B83FA0; - remoteInfo = NGVerticalTabBarController; + remoteInfo = NGTabBarController; }; - 9BEA2B7D14ED1B8300AEE977 /* PBXContainerItemProxy */ = { + 9BA31572153C76C8002E7628 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 9BEA2B6D14ED1B5A00AEE977 /* NGVerticalTabBarController.xcodeproj */; + containerPortal = 9BA31567153C769C002E7628 /* NGTabBarController.xcodeproj */; proxyType = 1; remoteGlobalIDString = 9B80B52C14EA8F7100B83FA0; - remoteInfo = NGVerticalTabBarController; + remoteInfo = NGTabBarController; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 9BA31567153C769C002E7628 /* NGTabBarController.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = NGTabBarController.xcodeproj; path = ../../NGTabBarController.xcodeproj; sourceTree = ""; }; 9BEA2B5214ED1B4A00AEE977 /* NGVerticalTabBarControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NGVerticalTabBarControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9BEA2B5614ED1B4A00AEE977 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 9BEA2B5814ED1B4A00AEE977 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -45,7 +46,6 @@ 9BEA2B6414ED1B4A00AEE977 /* NGVerticalTabBarControllerDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NGVerticalTabBarControllerDemo-Prefix.pch"; sourceTree = ""; }; 9BEA2B6514ED1B4A00AEE977 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 9BEA2B6614ED1B4A00AEE977 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9BEA2B6D14ED1B5A00AEE977 /* NGVerticalTabBarController.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = NGVerticalTabBarController.xcodeproj; path = ../../NGVerticalTabBarController.xcodeproj; sourceTree = ""; }; 9BEA2B8014ED1BC300AEE977 /* NGColoredViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGColoredViewController.h; sourceTree = ""; }; 9BEA2B8114ED1BC300AEE977 /* NGColoredViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGColoredViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -55,7 +55,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9BEA2B7F14ED1B8900AEE977 /* libNGVerticalTabBarController.a in Frameworks */, + 9BA31574153C76CE002E7628 /* libNGTabBarController.a in Frameworks */, 9BEA2B5714ED1B4A00AEE977 /* UIKit.framework in Frameworks */, 9BEA2B5914ED1B4A00AEE977 /* Foundation.framework in Frameworks */, 9BEA2B5B14ED1B4A00AEE977 /* CoreGraphics.framework in Frameworks */, @@ -65,6 +65,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 9BA31568153C769C002E7628 /* Products */ = { + isa = PBXGroup; + children = ( + 9BA3156F153C769C002E7628 /* libNGTabBarController.a */, + ); + name = Products; + sourceTree = ""; + }; 9BEA2B4714ED1B4A00AEE977 = { isa = PBXGroup; children = ( @@ -85,7 +93,7 @@ 9BEA2B5514ED1B4A00AEE977 /* Frameworks */ = { isa = PBXGroup; children = ( - 9BEA2B6D14ED1B5A00AEE977 /* NGVerticalTabBarController.xcodeproj */, + 9BA31567153C769C002E7628 /* NGTabBarController.xcodeproj */, 9BEA2B5614ED1B4A00AEE977 /* UIKit.framework */, 9BEA2B5814ED1B4A00AEE977 /* Foundation.framework */, 9BEA2B5A14ED1B4A00AEE977 /* CoreGraphics.framework */, @@ -116,14 +124,6 @@ name = "Supporting Files"; sourceTree = ""; }; - 9BEA2B6E14ED1B5A00AEE977 /* Products */ = { - isa = PBXGroup; - children = ( - 9BEA2B7214ED1B5A00AEE977 /* libNGVerticalTabBarController.a */, - ); - name = Products; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -138,7 +138,7 @@ buildRules = ( ); dependencies = ( - 9BEA2B7E14ED1B8300AEE977 /* PBXTargetDependency */, + 9BA31573153C76C8002E7628 /* PBXTargetDependency */, ); name = NGVerticalTabBarControllerDemo; productName = NGVerticalTabBarControllerDemo; @@ -166,8 +166,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 9BEA2B6E14ED1B5A00AEE977 /* Products */; - ProjectRef = 9BEA2B6D14ED1B5A00AEE977 /* NGVerticalTabBarController.xcodeproj */; + ProductGroup = 9BA31568153C769C002E7628 /* Products */; + ProjectRef = 9BA31567153C769C002E7628 /* NGTabBarController.xcodeproj */; }, ); projectRoot = ""; @@ -178,11 +178,11 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 9BEA2B7214ED1B5A00AEE977 /* libNGVerticalTabBarController.a */ = { + 9BA3156F153C769C002E7628 /* libNGTabBarController.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libNGVerticalTabBarController.a; - remoteRef = 9BEA2B7114ED1B5A00AEE977 /* PBXContainerItemProxy */; + path = libNGTabBarController.a; + remoteRef = 9BA3156E153C769C002E7628 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -212,10 +212,10 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 9BEA2B7E14ED1B8300AEE977 /* PBXTargetDependency */ = { + 9BA31573153C76C8002E7628 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = NGVerticalTabBarController; - targetProxy = 9BEA2B7D14ED1B8300AEE977 /* PBXContainerItemProxy */; + name = NGTabBarController; + targetProxy = 9BA31572153C76C8002E7628 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -285,7 +285,7 @@ buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Prefix.pch"; - HEADER_SEARCH_PATHS = "../../NGVerticalTabBarController/**"; + HEADER_SEARCH_PATHS = "../../NGTabBarController/**"; INFOPLIST_FILE = "NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.0; OTHER_LDFLAGS = "-fobjc-arc"; @@ -299,7 +299,7 @@ buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Prefix.pch"; - HEADER_SEARCH_PATHS = "../../NGVerticalTabBarController/**"; + HEADER_SEARCH_PATHS = "../../NGTabBarController/**"; INFOPLIST_FILE = "NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.0; OTHER_LDFLAGS = "-fobjc-arc"; diff --git a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.h b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.h index fd3ed81..4b8cda6 100644 --- a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.h +++ b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.h @@ -1,15 +1,15 @@ // // AppDelegate.h -// NGVerticalTabBarControllerDemo +// NGTabBarControllerDemo // // Created by Tretter Matthias on 16.02.12. // Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. // #import -#import "NGVerticalTabBarController.h" +#import "NGTabBarController.h" -@interface AppDelegate : UIResponder +@interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; diff --git a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.m b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.m index aaadbc7..86474f0 100644 --- a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.m +++ b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/AppDelegate.m @@ -1,6 +1,6 @@ // // AppDelegate.m -// NGVerticalTabBarControllerDemo +// NGTabBarControllerDemo // // Created by Tretter Matthias on 16.02.12. // Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. @@ -24,9 +24,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [[NGColoredViewController alloc] initWithNibName:nil bundle:nil], [[NGColoredViewController alloc] initWithNibName:nil bundle:nil],nil]; - NGVerticalTabBarController *tabBarController = [[NGVerticalTabBarController alloc] initWithDelegate:self]; + NGTabBarController *tabBarController = [[NGTabBarController alloc] initWithDelegate:self]; - tabBarController.animation = NGVerticalTabBarControllerAnimationMoveAndScale; + tabBarController.animation = NGTabBarControllerAnimationMoveAndScale; tabBarController.viewControllers = viewController; self.window.rootViewController = tabBarController; @@ -36,15 +36,16 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( } //////////////////////////////////////////////////////////////////////// -#pragma mark - NGVerticalTabBarControllerDelegate +#pragma mark - NGTabBarControllerDelegate //////////////////////////////////////////////////////////////////////// -- (NGVerticalTabBarCell *)verticalTabBarController:(NGVerticalTabBarController *)tabBarController - customizedCell:(NGVerticalTabBarCell *)cell - forViewController:(UIViewController *)viewController - atIndex:(NSUInteger)index { - cell.textLabel.text = [NSString stringWithFormat:@"%d", index]; - return cell; +- (NGTabBarItem *)verticalTabBarController:(NGTabBarController *)tabBarController + customizedItem:(NGTabBarItem *)item + forViewController:(UIViewController *)viewController + atIndex:(NSUInteger)index { + item.textLabel.text = [NSString stringWithFormat:@"%d", index]; + + return item; } @end diff --git a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.h b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.h index 9528570..da9ad65 100644 --- a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.h +++ b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.h @@ -1,6 +1,6 @@ // // NGColoredViewController.h -// NGVerticalTabBarControllerDemo +// NGTabBarControllerDemo // // Created by Tretter Matthias on 16.02.12. // Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. diff --git a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.m b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.m index 2499682..8c9ca12 100644 --- a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.m +++ b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGColoredViewController.m @@ -1,6 +1,6 @@ // // NGColoredViewController.m -// NGVerticalTabBarControllerDemo +// NGTabBarControllerDemo // // Created by Tretter Matthias on 16.02.12. // Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. diff --git a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Prefix.pch b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Prefix.pch index 2994443..30743d3 100644 --- a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Prefix.pch +++ b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo-Prefix.pch @@ -1,5 +1,5 @@ // -// Prefix header for all source files of the 'NGVerticalTabBarControllerDemo' target in the 'NGVerticalTabBarControllerDemo' project +// Prefix header for all source files of the 'NGTabBarControllerDemo' target in the 'NGTabBarControllerDemo' project // #import diff --git a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/main.m b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/main.m index 0e184cb..b695ce1 100644 --- a/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/main.m +++ b/Demo/NGVerticalTabBarControllerDemo/NGVerticalTabBarControllerDemo/main.m @@ -1,6 +1,6 @@ // // main.m -// NGVerticalTabBarControllerDemo +// NGTabBarControllerDemo // // Created by Tretter Matthias on 16.02.12. // Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. diff --git a/NGVerticalTabBarController.xcodeproj/project.pbxproj b/NGTabBarController.xcodeproj/project.pbxproj similarity index 53% rename from NGVerticalTabBarController.xcodeproj/project.pbxproj rename to NGTabBarController.xcodeproj/project.pbxproj index c24e914..f99df75 100644 --- a/NGVerticalTabBarController.xcodeproj/project.pbxproj +++ b/NGTabBarController.xcodeproj/project.pbxproj @@ -8,27 +8,29 @@ /* Begin PBXBuildFile section */ 9B80B53114EA8F7100B83FA0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B80B53014EA8F7100B83FA0 /* Foundation.framework */; }; - 9B80B53714EA8F7100B83FA0 /* NGVerticalTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B80B53614EA8F7100B83FA0 /* NGVerticalTabBarController.m */; }; - 9B80B54214EA91C400B83FA0 /* NGVerticalTabBarControllerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B80B54114EA91C300B83FA0 /* NGVerticalTabBarControllerDelegate.h */; }; - 9B80B54514EA9E1000B83FA0 /* NGVerticalTabBarCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B80B54314EA9E1000B83FA0 /* NGVerticalTabBarCell.h */; }; - 9B80B54614EA9E1000B83FA0 /* NGVerticalTabBarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B80B54414EA9E1000B83FA0 /* NGVerticalTabBarCell.m */; }; - 9B80B54914EA9E2900B83FA0 /* NGVerticalTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B80B54714EA9E2900B83FA0 /* NGVerticalTabBar.h */; }; - 9B80B54A14EA9E2900B83FA0 /* NGVerticalTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B80B54814EA9E2900B83FA0 /* NGVerticalTabBar.m */; }; - 9BEA2BE914ED4D6D00AEE977 /* NGVerticalTabBarControllerAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BEA2BE814ED4D6D00AEE977 /* NGVerticalTabBarControllerAnimation.h */; }; + 9B81DCFE153C758C007FEE73 /* NGTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B81DCF5153C758C007FEE73 /* NGTabBar.h */; }; + 9B81DCFF153C758C007FEE73 /* NGTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B81DCF6153C758C007FEE73 /* NGTabBar.m */; }; + 9B81DD00153C758C007FEE73 /* NGTabBarItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B81DCF7153C758C007FEE73 /* NGTabBarItem.h */; }; + 9B81DD01153C758C007FEE73 /* NGTabBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B81DCF8153C758C007FEE73 /* NGTabBarItem.m */; }; + 9B81DD02153C758C007FEE73 /* NGTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B81DCF9153C758C007FEE73 /* NGTabBarController.h */; }; + 9B81DD03153C758C007FEE73 /* NGTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B81DCFA153C758C007FEE73 /* NGTabBarController.m */; }; + 9B81DD04153C758C007FEE73 /* NGTabBarControllerAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B81DCFB153C758C007FEE73 /* NGTabBarControllerAnimation.h */; }; + 9B81DD05153C758C007FEE73 /* NGTabBarControllerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B81DCFC153C758C007FEE73 /* NGTabBarControllerDelegate.h */; }; + 9B81DD06153C758C007FEE73 /* Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 9B81DCFD153C758C007FEE73 /* Prefix.pch */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 9B80B52D14EA8F7100B83FA0 /* libNGVerticalTabBarController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNGVerticalTabBarController.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 9B80B52D14EA8F7100B83FA0 /* libNGTabBarController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libNGTabBarController.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9B80B53014EA8F7100B83FA0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 9B80B53414EA8F7100B83FA0 /* Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; - 9B80B53514EA8F7100B83FA0 /* NGVerticalTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NGVerticalTabBarController.h; sourceTree = ""; }; - 9B80B53614EA8F7100B83FA0 /* NGVerticalTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NGVerticalTabBarController.m; sourceTree = ""; }; - 9B80B54114EA91C300B83FA0 /* NGVerticalTabBarControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGVerticalTabBarControllerDelegate.h; sourceTree = ""; }; - 9B80B54314EA9E1000B83FA0 /* NGVerticalTabBarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGVerticalTabBarCell.h; sourceTree = ""; }; - 9B80B54414EA9E1000B83FA0 /* NGVerticalTabBarCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGVerticalTabBarCell.m; sourceTree = ""; }; - 9B80B54714EA9E2900B83FA0 /* NGVerticalTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGVerticalTabBar.h; sourceTree = ""; }; - 9B80B54814EA9E2900B83FA0 /* NGVerticalTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGVerticalTabBar.m; sourceTree = ""; }; - 9BEA2BE814ED4D6D00AEE977 /* NGVerticalTabBarControllerAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGVerticalTabBarControllerAnimation.h; sourceTree = ""; }; + 9B81DCF5153C758C007FEE73 /* NGTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGTabBar.h; sourceTree = ""; }; + 9B81DCF6153C758C007FEE73 /* NGTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGTabBar.m; sourceTree = ""; }; + 9B81DCF7153C758C007FEE73 /* NGTabBarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGTabBarItem.h; sourceTree = ""; }; + 9B81DCF8153C758C007FEE73 /* NGTabBarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGTabBarItem.m; sourceTree = ""; }; + 9B81DCF9153C758C007FEE73 /* NGTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGTabBarController.h; sourceTree = ""; }; + 9B81DCFA153C758C007FEE73 /* NGTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGTabBarController.m; sourceTree = ""; }; + 9B81DCFB153C758C007FEE73 /* NGTabBarControllerAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGTabBarControllerAnimation.h; sourceTree = ""; }; + 9B81DCFC153C758C007FEE73 /* NGTabBarControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGTabBarControllerDelegate.h; sourceTree = ""; }; + 9B81DCFD153C758C007FEE73 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -46,7 +48,7 @@ 9B80B52214EA8F7100B83FA0 = { isa = PBXGroup; children = ( - 9B80B53214EA8F7100B83FA0 /* NGVerticalTabBarController */, + 9B81DCF4153C758C007FEE73 /* NGTabBarController */, 9B80B52F14EA8F7100B83FA0 /* Frameworks */, 9B80B52E14EA8F7100B83FA0 /* Products */, ); @@ -55,7 +57,7 @@ 9B80B52E14EA8F7100B83FA0 /* Products */ = { isa = PBXGroup; children = ( - 9B80B52D14EA8F7100B83FA0 /* libNGVerticalTabBarController.a */, + 9B80B52D14EA8F7100B83FA0 /* libNGTabBarController.a */, ); name = Products; sourceTree = ""; @@ -68,28 +70,20 @@ name = Frameworks; sourceTree = ""; }; - 9B80B53214EA8F7100B83FA0 /* NGVerticalTabBarController */ = { + 9B81DCF4153C758C007FEE73 /* NGTabBarController */ = { isa = PBXGroup; children = ( - 9B80B53514EA8F7100B83FA0 /* NGVerticalTabBarController.h */, - 9B80B53614EA8F7100B83FA0 /* NGVerticalTabBarController.m */, - 9B80B54714EA9E2900B83FA0 /* NGVerticalTabBar.h */, - 9B80B54814EA9E2900B83FA0 /* NGVerticalTabBar.m */, - 9B80B54314EA9E1000B83FA0 /* NGVerticalTabBarCell.h */, - 9B80B54414EA9E1000B83FA0 /* NGVerticalTabBarCell.m */, - 9B80B54114EA91C300B83FA0 /* NGVerticalTabBarControllerDelegate.h */, - 9BEA2BE814ED4D6D00AEE977 /* NGVerticalTabBarControllerAnimation.h */, - 9B80B53314EA8F7100B83FA0 /* Supporting Files */, + 9B81DCF5153C758C007FEE73 /* NGTabBar.h */, + 9B81DCF6153C758C007FEE73 /* NGTabBar.m */, + 9B81DCF7153C758C007FEE73 /* NGTabBarItem.h */, + 9B81DCF8153C758C007FEE73 /* NGTabBarItem.m */, + 9B81DCF9153C758C007FEE73 /* NGTabBarController.h */, + 9B81DCFA153C758C007FEE73 /* NGTabBarController.m */, + 9B81DCFB153C758C007FEE73 /* NGTabBarControllerAnimation.h */, + 9B81DCFC153C758C007FEE73 /* NGTabBarControllerDelegate.h */, + 9B81DCFD153C758C007FEE73 /* Prefix.pch */, ); - path = NGVerticalTabBarController; - sourceTree = ""; - }; - 9B80B53314EA8F7100B83FA0 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 9B80B53414EA8F7100B83FA0 /* Prefix.pch */, - ); - name = "Supporting Files"; + path = NGTabBarController; sourceTree = ""; }; /* End PBXGroup section */ @@ -99,19 +93,21 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 9B80B54214EA91C400B83FA0 /* NGVerticalTabBarControllerDelegate.h in Headers */, - 9B80B54514EA9E1000B83FA0 /* NGVerticalTabBarCell.h in Headers */, - 9B80B54914EA9E2900B83FA0 /* NGVerticalTabBar.h in Headers */, - 9BEA2BE914ED4D6D00AEE977 /* NGVerticalTabBarControllerAnimation.h in Headers */, + 9B81DCFE153C758C007FEE73 /* NGTabBar.h in Headers */, + 9B81DD00153C758C007FEE73 /* NGTabBarItem.h in Headers */, + 9B81DD02153C758C007FEE73 /* NGTabBarController.h in Headers */, + 9B81DD04153C758C007FEE73 /* NGTabBarControllerAnimation.h in Headers */, + 9B81DD05153C758C007FEE73 /* NGTabBarControllerDelegate.h in Headers */, + 9B81DD06153C758C007FEE73 /* Prefix.pch in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 9B80B52C14EA8F7100B83FA0 /* NGVerticalTabBarController */ = { + 9B80B52C14EA8F7100B83FA0 /* NGTabBarController */ = { isa = PBXNativeTarget; - buildConfigurationList = 9B80B53A14EA8F7100B83FA0 /* Build configuration list for PBXNativeTarget "NGVerticalTabBarController" */; + buildConfigurationList = 9B80B53A14EA8F7100B83FA0 /* Build configuration list for PBXNativeTarget "NGTabBarController" */; buildPhases = ( 9B80B52914EA8F7100B83FA0 /* Sources */, 9B80B52A14EA8F7100B83FA0 /* Frameworks */, @@ -121,9 +117,9 @@ ); dependencies = ( ); - name = NGVerticalTabBarController; + name = NGTabBarController; productName = NGVerticalTabBarController; - productReference = 9B80B52D14EA8F7100B83FA0 /* libNGVerticalTabBarController.a */; + productReference = 9B80B52D14EA8F7100B83FA0 /* libNGTabBarController.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -135,7 +131,7 @@ LastUpgradeCheck = 0420; ORGANIZATIONNAME = "NOUS Wissensmanagement GmbH"; }; - buildConfigurationList = 9B80B52714EA8F7100B83FA0 /* Build configuration list for PBXProject "NGVerticalTabBarController" */; + buildConfigurationList = 9B80B52714EA8F7100B83FA0 /* Build configuration list for PBXProject "NGTabBarController" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -147,7 +143,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 9B80B52C14EA8F7100B83FA0 /* NGVerticalTabBarController */, + 9B80B52C14EA8F7100B83FA0 /* NGTabBarController */, ); }; /* End PBXProject section */ @@ -157,9 +153,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9B80B53714EA8F7100B83FA0 /* NGVerticalTabBarController.m in Sources */, - 9B80B54614EA9E1000B83FA0 /* NGVerticalTabBarCell.m in Sources */, - 9B80B54A14EA9E2900B83FA0 /* NGVerticalTabBar.m in Sources */, + 9B81DCFF153C758C007FEE73 /* NGTabBar.m in Sources */, + 9B81DD01153C758C007FEE73 /* NGTabBarItem.m in Sources */, + 9B81DD03153C758C007FEE73 /* NGTabBarController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -213,7 +209,7 @@ buildSettings = { DSTROOT = /tmp/NGVerticalTabBarController.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = NGVerticalTabBarController/Prefix.pch; + GCC_PREFIX_HEADER = NGTabBarController/Prefix.pch; IPHONEOS_DEPLOYMENT_TARGET = 4.0; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -226,7 +222,7 @@ buildSettings = { DSTROOT = /tmp/NGVerticalTabBarController.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = NGVerticalTabBarController/Prefix.pch; + GCC_PREFIX_HEADER = NGTabBarController/Prefix.pch; IPHONEOS_DEPLOYMENT_TARGET = 4.0; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -237,7 +233,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 9B80B52714EA8F7100B83FA0 /* Build configuration list for PBXProject "NGVerticalTabBarController" */ = { + 9B80B52714EA8F7100B83FA0 /* Build configuration list for PBXProject "NGTabBarController" */ = { isa = XCConfigurationList; buildConfigurations = ( 9B80B53814EA8F7100B83FA0 /* Debug */, @@ -246,7 +242,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9B80B53A14EA8F7100B83FA0 /* Build configuration list for PBXNativeTarget "NGVerticalTabBarController" */ = { + 9B80B53A14EA8F7100B83FA0 /* Build configuration list for PBXNativeTarget "NGTabBarController" */ = { isa = XCConfigurationList; buildConfigurations = ( 9B80B53B14EA8F7100B83FA0 /* Debug */, diff --git a/NGVerticalTabBarController/NGVerticalTabBar.h b/NGTabBarController/NGTabBar.h similarity index 62% rename from NGVerticalTabBarController/NGVerticalTabBar.h rename to NGTabBarController/NGTabBar.h index cb42b4d..d4e1e12 100644 --- a/NGVerticalTabBarController/NGVerticalTabBar.h +++ b/NGTabBarController/NGTabBar.h @@ -1,6 +1,6 @@ // -// NGVerticalTabBar.h -// NGVerticalTabBarController +// NGTabBar.h +// NGTabBarController // // Created by Tretter Matthias on 14.02.12. // Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. @@ -8,6 +8,6 @@ #import -@interface NGVerticalTabBar : UITableView +@interface NGTabBar : UITableView @end diff --git a/NGVerticalTabBarController/NGVerticalTabBar.m b/NGTabBarController/NGTabBar.m similarity index 90% rename from NGVerticalTabBarController/NGVerticalTabBar.m rename to NGTabBarController/NGTabBar.m index 3cce473..1de3795 100644 --- a/NGVerticalTabBarController/NGVerticalTabBar.m +++ b/NGTabBarController/NGTabBar.m @@ -1,6 +1,6 @@ -#import "NGVerticalTabBar.h" +#import "NGTabBar.h" -@implementation NGVerticalTabBar +@implementation NGTabBar //////////////////////////////////////////////////////////////////////// #pragma mark - Lifecycle diff --git a/NGVerticalTabBarController/NGVerticalTabBarController.h b/NGTabBarController/NGTabBarController.h similarity index 60% rename from NGVerticalTabBarController/NGVerticalTabBarController.h rename to NGTabBarController/NGTabBarController.h index 7f9bab0..6310bbb 100644 --- a/NGVerticalTabBarController/NGVerticalTabBarController.h +++ b/NGTabBarController/NGTabBarController.h @@ -1,19 +1,19 @@ // -// NGVerticalTabBarController.h -// NGVerticalTabBarController +// NGTabBarController.h +// NGTabBarController // // Created by Tretter Matthias on 14.02.12. // Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. // -#import "NGVerticalTabBarControllerDelegate.h" -#import "NGVerticalTabBar.h" -#import "NGVerticalTabBarCell.h" -#import "NGVerticalTabBarControllerAnimation.h" +#import "NGTabBarControllerDelegate.h" +#import "NGTabBar.h" +#import "NGTabBarItem.h" +#import "NGTabBarControllerAnimation.h" -/** NGVerticalTabBarController is a vertical TabBar displayed on the left side of the device */ -@interface NGVerticalTabBarController : UIViewController +/** NGTabBarController is a vertical TabBar displayed on the left side of the device */ +@interface NGTabBarController : UIViewController /** An array of the view controllers displayed by the tab bar */ @property (nonatomic, copy) NSArray *viewControllers; @@ -23,15 +23,15 @@ @property (nonatomic, unsafe_unretained) UIViewController *selectedViewController; /** The tab bar controller’s delegate object. */ -@property (nonatomic, unsafe_unretained) id delegate; +@property (nonatomic, unsafe_unretained) id delegate; /** The tableView used to display all tab bar elements */ -@property (nonatomic, strong, readonly) NGVerticalTabBar *tabBar; -/** The class of the tableViewCell of the tabBar, defaults to NGVerticalTabBarCell */ -@property (nonatomic, assign) Class tabBarCellClass; +@property (nonatomic, strong, readonly) NGTabBar *tabBar; +/** The class of the tableViewCell of the tabBar, defaults to NGTabBarCell */ +@property (nonatomic, assign) Class tabBarItemClass; /** The animation used when changing selected tabBarItem, default: none */ -@property (nonatomic, assign) NGVerticalTabBarControllerAnimation animation; +@property (nonatomic, assign) NGTabBarControllerAnimation animation; /** The duration of the used animation, only taken into account when animation is different from none */ @property (nonatomic, assign) NSTimeInterval animationDuration; @@ -39,6 +39,6 @@ - (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated; /** The designated initializer. */ -- (id)initWithDelegate:(id)delegate; +- (id)initWithDelegate:(id)delegate; @end diff --git a/NGVerticalTabBarController/NGVerticalTabBarController.m b/NGTabBarController/NGTabBarController.m similarity index 92% rename from NGVerticalTabBarController/NGVerticalTabBarController.m rename to NGTabBarController/NGTabBarController.m index 6001112..111fb3c 100644 --- a/NGVerticalTabBarController/NGVerticalTabBarController.m +++ b/NGTabBarController/NGTabBarController.m @@ -1,4 +1,4 @@ -#import "NGVerticalTabBarController.h" +#import "NGTabBarController.h" // the default width of the tabBar @@ -9,7 +9,7 @@ #define kNGScaleDuration 0.15f -@interface NGVerticalTabBarController () { +@interface NGTabBarController () { // re-defined as mutable NSMutableArray *_viewControllers; @@ -25,7 +25,7 @@ @interface NGVerticalTabBarController () )delegate { +- (id)initWithDelegate:(id)delegate { if ((self = [super initWithNibName:nil bundle:nil])) { - _tabBarCellClass = [NGVerticalTabBarCell class]; + _tabBarCellClass = [NGTabBarItem class]; _selectedIndex = NSNotFound; _oldSelectedIndex = NSNotFound; - _animation = NGVerticalTabBarControllerAnimationNone; + _animation = NGTabBarControllerAnimationNone; _animationDuration = kNGDefaultAnimationDuration; _moveScaleAnimationActive = NO; @@ -88,7 +88,7 @@ - (void)viewDidLoad { NSAssert(self.delegate != nil, @"No delegate set"); CGFloat width = [self delegatedTabBarWidth]; - self.tabBar = [[NGVerticalTabBar alloc] initWithFrame:CGRectMake(0.f, 0.f, width, self.view.bounds.size.height) style:UITableViewStylePlain]; + self.tabBar = [[NGTabBar alloc] initWithFrame:CGRectMake(0.f, 0.f, width, self.view.bounds.size.height) style:UITableViewStylePlain]; self.tabBar.dataSource = self; self.tabBar.delegate = self; [self.view addSubview:self.tabBar]; @@ -190,10 +190,10 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO } //////////////////////////////////////////////////////////////////////// -#pragma mark - NGVerticalTabBarController +#pragma mark - NGTabBarController //////////////////////////////////////////////////////////////////////// -- (void)setDelegate:(id)delegate { +- (void)setDelegate:(id)delegate { if (delegate != _delegate) { _delegate = delegate; @@ -287,12 +287,12 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - NGVerticalTabBarCell *cell = [self.tabBarCellClass cellForTabBar:self.tabBar]; + NGTabBarItem *cell = [self.tabBarItemClass itemForTabBar:self.tabBar]; UIViewController *viewController = [self.viewControllers objectAtIndex:indexPath.row]; // give delegate the chance to customize cell cell = [self.delegate verticalTabBarController:self - customizedCell:cell + customizedItem:cell forViewController:viewController atIndex:indexPath.row]; @@ -342,8 +342,8 @@ - (void)updateUI { if (self.containmentAPISupported) { // custom move animation - if (self.animation == NGVerticalTabBarControllerAnimationMove || - self.animation == NGVerticalTabBarControllerAnimationMoveAndScale) { + if (self.animation == NGTabBarControllerAnimationMove || + self.animation == NGTabBarControllerAnimationMoveAndScale) { CGRect frame = self.childViewControllerFrame; if (self.oldSelectedIndex < self.selectedIndex) { @@ -354,7 +354,7 @@ - (void)updateUI { newSelectedViewController.view.frame = frame; - if (self.animation == NGVerticalTabBarControllerAnimationMoveAndScale) { + if (self.animation == NGTabBarControllerAnimationMoveAndScale) { _moveScaleAnimationActive = YES; [UIView animateWithDuration:kNGScaleDuration @@ -374,8 +374,8 @@ - (void)updateUI { duration:self.animationDuration options:self.currentActiveAnimationOptions animations:^{ - if (self.animation == NGVerticalTabBarControllerAnimationMove || - self.animation == NGVerticalTabBarControllerAnimationMoveAndScale) { + if (self.animation == NGTabBarControllerAnimationMove || + self.animation == NGTabBarControllerAnimationMoveAndScale) { CGRect frame = oldSelectedViewController.view.frame; newSelectedViewController.view.frame = frame; @@ -391,7 +391,7 @@ - (void)updateUI { } completion:^(BOOL finished) { self.tabBar.userInteractionEnabled = YES; - if (self.animation == NGVerticalTabBarControllerAnimationMoveAndScale) { + if (self.animation == NGTabBarControllerAnimationMoveAndScale) { [UIView animateWithDuration:kNGScaleDuration animations:^{ oldSelectedViewController.view.transform = CGAffineTransformMakeScale(1.f, 1.f); @@ -460,22 +460,22 @@ - (UIViewAnimationOptions)currentActiveAnimationOptions { UIViewAnimationOptions animationOptions = UIViewAnimationOptionTransitionNone; switch (self.animation) { - case NGVerticalTabBarControllerAnimationFade: + case NGTabBarControllerAnimationFade: animationOptions = UIViewAnimationOptionTransitionCrossDissolve; break; - case NGVerticalTabBarControllerAnimationCurl: + case NGTabBarControllerAnimationCurl: animationOptions = (self.oldSelectedIndex > self.selectedIndex) ? UIViewAnimationOptionTransitionCurlDown : UIViewAnimationOptionTransitionCurlUp; break; - case NGVerticalTabBarControllerAnimationMove: - case NGVerticalTabBarControllerAnimationMoveAndScale: + case NGTabBarControllerAnimationMove: + case NGTabBarControllerAnimationMoveAndScale: // this animation is done manually. animationOptions = UIViewAnimationOptionLayoutSubviews; break; - case NGVerticalTabBarControllerAnimationNone: + case NGTabBarControllerAnimationNone: default: // do nothing break; diff --git a/NGTabBarController/NGTabBarControllerAnimation.h b/NGTabBarController/NGTabBarControllerAnimation.h new file mode 100644 index 0000000..76a6c70 --- /dev/null +++ b/NGTabBarController/NGTabBarControllerAnimation.h @@ -0,0 +1,18 @@ +// +// NGTabBarControllerAnimation.h +// NGTabBarController +// +// Created by Tretter Matthias on 16.02.12. +// Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. +// + +/** + The animation used when we change the selected tabItem, default is none. Animations are only supported on iOS 5. + */ +typedef enum { + NGTabBarControllerAnimationNone = 0, + NGTabBarControllerAnimationFade, + NGTabBarControllerAnimationCurl, + NGTabBarControllerAnimationMove, + NGTabBarControllerAnimationMoveAndScale +} NGTabBarControllerAnimation; \ No newline at end of file diff --git a/NGTabBarController/NGTabBarControllerDelegate.h b/NGTabBarController/NGTabBarControllerDelegate.h new file mode 100644 index 0000000..b21ce5c --- /dev/null +++ b/NGTabBarController/NGTabBarControllerDelegate.h @@ -0,0 +1,40 @@ +// +// NGTabBarControllerDelegate.h +// NGTabBarController +// +// Created by Tretter Matthias on 14.02.12. +// Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. +// + +@class NGTabBarController; +@class NGTabBarItem; + +@protocol NGTabBarControllerDelegate + +@required + +/** Asks the delegate to customized the cell of the tabBar */ +- (NGTabBarItem *)verticalTabBarController:(NGTabBarController *)tabBarController + customizedItem:(NGTabBarItem *)item + forViewController:(UIViewController *)viewController + atIndex:(NSUInteger)index; + +@optional + +/** Asks the delegate for the width of the UITableView that acts as the tabBar */ +- (CGFloat)widthOfTabBarOfVerticalTabBarController:(NGTabBarController *)tabBarController; + +/** Asks the delegate fot the specific height of an NGTabBarCell */ +- (CGFloat)heightForTabBarCell:(NGTabBarController *)taabBarController atIndex:(NSUInteger)index; + +/** Asks the delegate whether the specified view controller should be made active. */ +- (BOOL)verticalTabBarController:(NGTabBarController *)tabBarController + shouldSelectViewController:(UIViewController *)viewController + atIndex:(NSUInteger)index; + +/** Tells the delegate that the user selected an item in the tab bar. */ +- (void)verticalTabBarController:(NGTabBarController *)tabBarController + didSelectViewController:(UIViewController *)viewController + atIndex:(NSUInteger)index; + +@end diff --git a/NGTabBarController/NGTabBarItem.h b/NGTabBarController/NGTabBarItem.h new file mode 100644 index 0000000..4df73d2 --- /dev/null +++ b/NGTabBarController/NGTabBarItem.h @@ -0,0 +1,16 @@ +// +// NGTabBarCell.h +// NGTabBarController +// +// Created by Tretter Matthias on 14.02.12. +// Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. +// + +@class NGTabBar; + +@interface NGTabBarItem : UITableViewCell + ++ (id)itemForTabBar:(NGTabBar *)tabBar; + + +@end diff --git a/NGTabBarController/NGTabBarItem.m b/NGTabBarController/NGTabBarItem.m new file mode 100644 index 0000000..75f8d7b --- /dev/null +++ b/NGTabBarController/NGTabBarItem.m @@ -0,0 +1,17 @@ +#import "NGTabBarItem.h" +#import "NGTabBar.h" + +@implementation NGTabBarItem + ++ (id)itemForTabBar:(NGTabBar *)tabBar { + NSString *reuseIdentifier = NSStringFromClass([self class]); + NGTabBarItem *cell = [tabBar dequeueReusableCellWithIdentifier:reuseIdentifier]; + + if (cell == nil) { + cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; + } + + return cell; +} + +@end diff --git a/NGTabBarController/Prefix.pch b/NGTabBarController/Prefix.pch new file mode 100644 index 0000000..4cfff91 --- /dev/null +++ b/NGTabBarController/Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'NGTabBarController' target in the 'NGTabBarController' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/NGVerticalTabBarController/NGVerticalTabBarCell.h b/NGVerticalTabBarController/NGVerticalTabBarCell.h deleted file mode 100644 index ce5daf0..0000000 --- a/NGVerticalTabBarController/NGVerticalTabBarCell.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// NGVerticalTabBarCell.h -// NGVerticalTabBarController -// -// Created by Tretter Matthias on 14.02.12. -// Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. -// - -@class NGVerticalTabBar; - -@interface NGVerticalTabBarCell : UITableViewCell - -+ (id)cellForTabBar:(NGVerticalTabBar *)tabBar; - - -@end diff --git a/NGVerticalTabBarController/NGVerticalTabBarCell.m b/NGVerticalTabBarController/NGVerticalTabBarCell.m deleted file mode 100644 index 16aed28..0000000 --- a/NGVerticalTabBarController/NGVerticalTabBarCell.m +++ /dev/null @@ -1,17 +0,0 @@ -#import "NGVerticalTabBarCell.h" -#import "NGVerticalTabBar.h" - -@implementation NGVerticalTabBarCell - -+ (id)cellForTabBar:(NGVerticalTabBar *)tabBar { - NSString *reuseIdentifier = NSStringFromClass([self class]); - NGVerticalTabBarCell *cell = [tabBar dequeueReusableCellWithIdentifier:reuseIdentifier]; - - if (cell == nil) { - cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; - } - - return cell; -} - -@end diff --git a/NGVerticalTabBarController/NGVerticalTabBarControllerAnimation.h b/NGVerticalTabBarController/NGVerticalTabBarControllerAnimation.h deleted file mode 100644 index f56a25d..0000000 --- a/NGVerticalTabBarController/NGVerticalTabBarControllerAnimation.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// NGVerticalTabBarControllerAnimation.h -// NGVerticalTabBarController -// -// Created by Tretter Matthias on 16.02.12. -// Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. -// - -/** - The animation used when we change the selected tabItem, default is none. Animations are only supported on iOS 5. - */ -typedef enum { - NGVerticalTabBarControllerAnimationNone = 0, - NGVerticalTabBarControllerAnimationFade, - NGVerticalTabBarControllerAnimationCurl, - NGVerticalTabBarControllerAnimationMove, - NGVerticalTabBarControllerAnimationMoveAndScale -} NGVerticalTabBarControllerAnimation; \ No newline at end of file diff --git a/NGVerticalTabBarController/NGVerticalTabBarControllerDelegate.h b/NGVerticalTabBarController/NGVerticalTabBarControllerDelegate.h deleted file mode 100644 index 779d103..0000000 --- a/NGVerticalTabBarController/NGVerticalTabBarControllerDelegate.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// NGVerticalTabBarControllerDelegate.h -// NGVerticalTabBarController -// -// Created by Tretter Matthias on 14.02.12. -// Copyright (c) 2012 NOUS Wissensmanagement GmbH. All rights reserved. -// - -@class NGVerticalTabBarController; -@class NGVerticalTabBarCell; - -@protocol NGVerticalTabBarControllerDelegate - -@required - -/** Asks the delegate to customized the cell of the tabBar */ -- (NGVerticalTabBarCell *)verticalTabBarController:(NGVerticalTabBarController *)tabBarController - customizedCell:(NGVerticalTabBarCell *)cell - forViewController:(UIViewController *)viewController - atIndex:(NSUInteger)index; - -@optional - -/** Asks the delegate for the width of the UITableView that acts as the tabBar */ -- (CGFloat)widthOfTabBarOfVerticalTabBarController:(NGVerticalTabBarController *)tabBarController; - -/** Asks the delegate fot the specific height of an NGVerticalTabBarCell */ -- (CGFloat)heightForTabBarCell:(NGVerticalTabBarController *)tabBarController atIndex:(NSUInteger)index; - -/** Asks the delegate whether the specified view controller should be made active. */ -- (BOOL)verticalTabBarController:(NGVerticalTabBarController *)tabBarController - shouldSelectViewController:(UIViewController *)viewController - atIndex:(NSUInteger)index; - -/** Tells the delegate that the user selected an item in the tab bar. */ -- (void)verticalTabBarController:(NGVerticalTabBarController *)tabBarController - didSelectViewController:(UIViewController *)viewController - atIndex:(NSUInteger)index; - -@end diff --git a/NGVerticalTabBarController/Prefix.pch b/NGVerticalTabBarController/Prefix.pch deleted file mode 100644 index e7892ce..0000000 --- a/NGVerticalTabBarController/Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'NGVerticalTabBarController' target in the 'NGVerticalTabBarController' project -// - -#ifdef __OBJC__ - #import - #import -#endif