├── tab.psd ├── example ├── res │ ├── magnifying-glass.png │ ├── magnifying-glass@2x.png │ ├── magnifying-glass-selected.png │ └── magnifying-glass-selected@2x.png └── src │ ├── main.m │ ├── EXViewController.h │ ├── base │ └── prefix.pch │ ├── EXAppDelegate.h │ ├── EXViewController.m │ └── EXAppDelegate.m ├── BCTabBarController.bundle ├── tab-arrow.png ├── tab-arrow@2x.png ├── tab-background.png ├── tab-background@2x.png ├── tab-bar-background.png ├── tab-right-border.png ├── tab-right-border@2x.png └── tab-bar-background@2x.png ├── src ├── UIViewController+iconImage.h ├── BCTab.h ├── UINavigationController+icons.h ├── BCTabBarView.h ├── UIViewController+iconImage.m ├── UINavigationController+icons.m ├── base │ └── prefix.pch ├── BCTabBarController.h ├── BCTabBar.h ├── BCTabBarView.m ├── BCTab.m ├── BCTabBar.m └── BCTabBarController.m ├── .gitignore ├── Example-Info.plist ├── LICENSE ├── Readme.markdown └── BCTabBarController.xcodeproj └── project.pbxproj /tab.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/tab.psd -------------------------------------------------------------------------------- /example/res/magnifying-glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/example/res/magnifying-glass.png -------------------------------------------------------------------------------- /example/res/magnifying-glass@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/example/res/magnifying-glass@2x.png -------------------------------------------------------------------------------- /example/src/main.m: -------------------------------------------------------------------------------- 1 | 2 | int main(int argc, char *argv[]) { 3 | return UIApplicationMain(argc, argv, nil, @"EXAppDelegate"); 4 | } 5 | -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-arrow.png -------------------------------------------------------------------------------- /src/UIViewController+iconImage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | @interface UIViewController (BCTabBarController) 4 | 5 | - (NSString *)iconImageName; 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-arrow@2x.png -------------------------------------------------------------------------------- /example/res/magnifying-glass-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/example/res/magnifying-glass-selected.png -------------------------------------------------------------------------------- /example/src/EXViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface EXViewController : UIViewController { 4 | 5 | } 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-background.png -------------------------------------------------------------------------------- /example/res/magnifying-glass-selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/example/res/magnifying-glass-selected@2x.png -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-background@2x.png -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-bar-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-bar-background.png -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-right-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-right-border.png -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-right-border@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-right-border@2x.png -------------------------------------------------------------------------------- /BCTabBarController.bundle/tab-bar-background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/briancollins/BCTabBarController/HEAD/BCTabBarController.bundle/tab-bar-background@2x.png -------------------------------------------------------------------------------- /src/BCTab.h: -------------------------------------------------------------------------------- 1 | 2 | @interface BCTab : UIButton { 3 | UIImage *background; 4 | UIImage *rightBorder; 5 | } 6 | 7 | - (id)initWithIconImageName:(NSString *)imageName; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /src/UINavigationController+icons.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface UINavigationController (BCTabBarController) 5 | 6 | - (NSString *)iconImageName; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | *.pbxuser 3 | *.mode1v3 4 | 5 | # old skool 6 | .svn 7 | 8 | # osx noise 9 | .DS_Store 10 | profile 11 | 12 | beta 13 | 14 | xcuserdata 15 | 16 | project.xcworkspace 17 | -------------------------------------------------------------------------------- /src/BCTabBarView.h: -------------------------------------------------------------------------------- 1 | @class BCTabBar; 2 | 3 | @interface BCTabBarView : UIView 4 | 5 | @property (nonatomic, assign) UIView *contentView; 6 | @property (nonatomic, assign) BCTabBar *tabBar; 7 | 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /src/UIViewController+iconImage.m: -------------------------------------------------------------------------------- 1 | #import "UIViewController+iconImage.h" 2 | 3 | 4 | @implementation UIViewController (BCTabBarController) 5 | 6 | - (NSString *)iconImageName { 7 | return nil; 8 | } 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /src/UINavigationController+icons.m: -------------------------------------------------------------------------------- 1 | #import "UINavigationController+icons.h" 2 | 3 | 4 | @implementation UINavigationController (BCTabBarController) 5 | 6 | - (NSString *)iconImageName { 7 | return [[self.viewControllers objectAtIndex:0] iconImageName]; 8 | } 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /src/base/prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #import 4 | #endif 5 | 6 | #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1] 7 | #define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)] 8 | -------------------------------------------------------------------------------- /example/src/base/prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #import 4 | #endif 5 | 6 | #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1] 7 | #define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)] 8 | -------------------------------------------------------------------------------- /example/src/EXAppDelegate.h: -------------------------------------------------------------------------------- 1 | @class BCTabBarController; 2 | 3 | @interface EXAppDelegate : NSObject { 4 | BCTabBarController *tabBarController; 5 | UIWindow *window; 6 | } 7 | 8 | @property (nonatomic, retain) BCTabBarController *tabBarController; 9 | @property (nonatomic, retain) UIWindow *window; 10 | @end 11 | -------------------------------------------------------------------------------- /src/BCTabBarController.h: -------------------------------------------------------------------------------- 1 | #import "BCTabBar.h" 2 | @class BCTabBarView; 3 | 4 | @interface BCTabBarController : UIViewController 5 | 6 | @property (nonatomic, retain) NSArray *viewControllers; 7 | @property (nonatomic, retain) BCTabBar *tabBar; 8 | @property (nonatomic, retain) UIViewController *selectedViewController; 9 | @property (nonatomic, retain) BCTabBarView *tabBarView; 10 | @property (nonatomic) NSUInteger selectedIndex; 11 | @property (nonatomic, readonly) BOOL visible; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /src/BCTabBar.h: -------------------------------------------------------------------------------- 1 | @class BCTab; 2 | 3 | @protocol BCTabBarDelegate; 4 | 5 | @interface BCTabBar : UIView 6 | 7 | - (id)initWithFrame:(CGRect)aFrame; 8 | - (void)setSelectedTab:(BCTab *)aTab animated:(BOOL)animated; 9 | 10 | @property (nonatomic, retain) NSArray *tabs; 11 | @property (nonatomic, retain) BCTab *selectedTab; 12 | @property (nonatomic, assign) id delegate; 13 | @property (nonatomic, retain) UIImageView *arrow; 14 | @end 15 | 16 | @protocol BCTabBarDelegate 17 | - (void)tabBar:(BCTabBar *)aTabBar didSelectTabAtIndex:(NSInteger)index; 18 | @end -------------------------------------------------------------------------------- /Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /example/src/EXViewController.m: -------------------------------------------------------------------------------- 1 | #import "EXViewController.h" 2 | 3 | @implementation EXViewController 4 | 5 | - (void)viewDidLoad { 6 | [super viewDidLoad]; 7 | self.view.backgroundColor = RGBCOLOR(rand() % 255, rand() % 255, rand() % 255); 8 | } 9 | 10 | - (NSString *)iconImageName { 11 | return @"magnifying-glass.png"; 12 | } 13 | 14 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 15 | return YES; 16 | } 17 | 18 | - (void)viewWillAppear:(BOOL)animated { 19 | [super viewWillAppear:animated]; 20 | NSLog(@"viewWillAppear"); 21 | } 22 | 23 | - (void)viewDidAppear:(BOOL)animated { 24 | [super viewDidAppear:animated]; 25 | NSLog(@"viewDidAppear"); 26 | } 27 | 28 | - (void)viewWillDisappear:(BOOL)animated { 29 | [super viewWillDisappear:animated]; 30 | NSLog(@"viewWillDisappear"); 31 | } 32 | 33 | - (void)viewDidDisappear:(BOOL)animated { 34 | [super viewDidDisappear:animated]; 35 | NSLog(@"viewDidDisappear"); 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /example/src/EXAppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "EXAppDelegate.h" 2 | #import "BCTabBarController.h" 3 | #import "EXViewController.h" 4 | 5 | @implementation EXAppDelegate 6 | @synthesize tabBarController, window; 7 | 8 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 9 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 10 | self.tabBarController = [[BCTabBarController alloc] init]; 11 | self.tabBarController.viewControllers = [NSArray arrayWithObjects: 12 | [[UINavigationController alloc] 13 | initWithRootViewController:[[EXViewController alloc] init]], 14 | [[EXViewController alloc] init], 15 | [[EXViewController alloc] init], 16 | [[EXViewController alloc] init], 17 | [[EXViewController alloc] init], 18 | nil]; 19 | [self.window addSubview:self.tabBarController.view]; 20 | [self.window makeKeyAndVisible]; 21 | return YES; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /src/BCTabBarView.m: -------------------------------------------------------------------------------- 1 | #import "BCTabBarView.h" 2 | #import "BCTabBar.h" 3 | 4 | @implementation BCTabBarView 5 | @synthesize tabBar, contentView; 6 | 7 | - (void)setTabBar:(BCTabBar *)aTabBar { 8 | if (tabBar != aTabBar) { 9 | [tabBar removeFromSuperview]; 10 | tabBar = aTabBar; 11 | [self addSubview:tabBar]; 12 | } 13 | } 14 | 15 | - (void)setContentView:(UIView *)aContentView { 16 | [contentView removeFromSuperview]; 17 | contentView = aContentView; 18 | contentView.frame = CGRectMake(0, 0, self.bounds.size.width, self.tabBar.frame.origin.y); 19 | 20 | [self addSubview:contentView]; 21 | [self sendSubviewToBack:contentView]; 22 | } 23 | 24 | - (void)layoutSubviews { 25 | [super layoutSubviews]; 26 | CGRect f = contentView.frame; 27 | f.size.height = self.tabBar.frame.origin.y; 28 | contentView.frame = f; 29 | [contentView layoutSubviews]; 30 | } 31 | 32 | - (void)drawRect:(CGRect)rect { 33 | CGContextRef c = UIGraphicsGetCurrentContext(); 34 | [RGBCOLOR(230, 230, 230) set]; 35 | CGContextFillRect(c, self.bounds); 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Brian Collins 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Readme.markdown: -------------------------------------------------------------------------------- 1 | ### BCTabBarController 2 | 3 | BCTabBarController is a Tweetie-style tab bar for iPhone. See below for screenshots. 4 | 5 | 6 | ### Why? 7 | 8 | There are several problems with using the standard UITabBarController including: 9 | 10 | * It is too tall, especially in landscape mode 11 | * The height doesn't match the UIToolbar 12 | * It cannot be customized without using private APIs 13 | * It has labels. Sometimes you don't need labels. 14 | 15 | BCTabBarController is completely written from scratch using public APIs to fix all of these problems and behaves almost identically to a normal UITabBarController. 16 | 17 | ### Features 18 | 19 | * A cool little arrow that slides around to indicate the current tab 20 | * Support for all orientations 21 | * Same height as a standard UIToolbar 22 | 23 | ### Usage 24 | * Add BCTabBarController.xcodeproj to your project by dragging it into the Groups & Files sidebar. 25 | * Select the added project file in the sidebar and then check the box next to libBCTabBarController.a 26 | * Select your project's target and right-click and choose "Get Info" 27 | * Click the + icon underneath Direct Dependencies and add the BCTabBarController target 28 | * libBCTabBarController.a should already be in the list of Linked Libraries 29 | * Drag BCTabBarController.bundle into your project's resources 30 | * If you haven't already, add the QuartzCore and Core Graphics frameworks to your project 31 | * Define the method - (NSString *)iconImageName in each view controller that you add to the tab bar. It should return the filename of the grey tab icon (see creation steps below) 32 | * See the example target for usage 33 | 34 | 35 | ### Creating icons 36 | Unlike UITabBarController, the tab bar icons in BCTabBars are have two pre-rendered states (four if you count the retina versions). You can use the provided tab.psd file to create those files. 37 | 38 | * Replace the layer masks in the PSD with the silhouette of the icon you wish to create 39 | * Save the grey layer as name.png and the blue layer as name-selected.png and add them to your project. 40 | 41 | 42 | ### Screenshots 43 | ![](http://brisy.info/upload/b2AxI.png) ![](http://brisy.info/upload/CWX5J.png) 44 | 45 | 46 | ### Acknowledgements 47 | This controller wouldn't be possible without the original innovative design of Tweetie by Loren Brichter (atebits). 48 | -------------------------------------------------------------------------------- /src/BCTab.m: -------------------------------------------------------------------------------- 1 | #import "BCTab.h" 2 | 3 | @interface BCTab () 4 | @property (nonatomic, retain) UIImage *rightBorder; 5 | @property (nonatomic, retain) UIImage *background; 6 | @end 7 | 8 | @implementation BCTab 9 | @synthesize rightBorder, background; 10 | 11 | - (id)initWithIconImageName:(NSString *)imageName { 12 | if (self = [super init]) { 13 | self.adjustsImageWhenHighlighted = NO; 14 | self.background = [UIImage imageNamed:@"BCTabBarController.bundle/tab-background.png"]; 15 | self.rightBorder = [UIImage imageNamed:@"BCTabBarController.bundle/tab-right-border.png"]; 16 | self.backgroundColor = [UIColor clearColor]; 17 | 18 | NSString *selectedName = [NSString stringWithFormat:@"%@-selected.%@", 19 | [imageName stringByDeletingPathExtension], 20 | [imageName pathExtension]]; 21 | 22 | [self setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal]; 23 | [self setImage:[UIImage imageNamed:selectedName] forState:UIControlStateSelected]; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)setHighlighted:(BOOL)aBool { 29 | // no highlight state 30 | } 31 | 32 | - (void)drawRect:(CGRect)rect { 33 | if (self.selected) { 34 | [background drawAtPoint:CGPointMake(0, 2)]; 35 | [rightBorder drawAtPoint:CGPointMake(self.bounds.size.width - rightBorder.size.width, 2)]; 36 | CGContextRef c = UIGraphicsGetCurrentContext(); 37 | [RGBCOLOR(24, 24, 24) set]; 38 | CGContextFillRect(c, CGRectMake(0, self.bounds.size.height / 2, self.bounds.size.width, self.bounds.size.height / 2)); 39 | [RGBCOLOR(14, 14, 14) set]; 40 | CGContextFillRect(c, CGRectMake(0, self.bounds.size.height / 2, 0.5, self.bounds.size.height / 2)); 41 | CGContextFillRect(c, CGRectMake(self.bounds.size.width - 0.5, self.bounds.size.height / 2, 0.5, self.bounds.size.height / 2)); 42 | } 43 | } 44 | 45 | - (void)setFrame:(CGRect)aFrame { 46 | [super setFrame:aFrame]; 47 | [self setNeedsDisplay]; 48 | } 49 | 50 | - (void)layoutSubviews { 51 | [super layoutSubviews]; 52 | 53 | UIEdgeInsets imageInsets = UIEdgeInsetsMake(floor((self.bounds.size.height / 2) - 54 | (self.imageView.image.size.height / 2)), 55 | floor((self.bounds.size.width / 2) - 56 | (self.imageView.image.size.width / 2)), 57 | floor((self.bounds.size.height / 2) - 58 | (self.imageView.image.size.height / 2)), 59 | floor((self.bounds.size.width / 2) - 60 | (self.imageView.image.size.width / 2))); 61 | self.imageEdgeInsets = imageInsets; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /src/BCTabBar.m: -------------------------------------------------------------------------------- 1 | #import "BCTabBar.h" 2 | #import "BCTab.h" 3 | #define kTabMargin 2.0 4 | 5 | @interface BCTabBar () 6 | @property (nonatomic, retain) UIImage *backgroundImage; 7 | 8 | - (void)positionArrowAnimated:(BOOL)animated; 9 | @end 10 | 11 | @implementation BCTabBar 12 | @synthesize tabs, selectedTab, backgroundImage, arrow, delegate; 13 | 14 | - (id)initWithFrame:(CGRect)aFrame { 15 | 16 | if (self = [super initWithFrame:aFrame]) { 17 | self.backgroundImage = [UIImage imageNamed:@"BCTabBarController.bundle/tab-bar-background.png"]; 18 | self.arrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"BCTabBarController.bundle/tab-arrow.png"]]; 19 | CGRect r = self.arrow.frame; 20 | r.origin.y = - (r.size.height - 2); 21 | self.arrow.frame = r; 22 | [self addSubview:self.arrow]; 23 | self.userInteractionEnabled = YES; 24 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | 25 | UIViewAutoresizingFlexibleTopMargin; 26 | 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)drawRect:(CGRect)rect { 33 | [super drawRect:rect]; 34 | CGContextRef context = UIGraphicsGetCurrentContext(); 35 | [self.backgroundImage drawAtPoint:CGPointMake(0, 0)]; 36 | [[UIColor blackColor] set]; 37 | CGContextFillRect(context, CGRectMake(0, self.bounds.size.height / 2, self.bounds.size.width, self.bounds.size.height / 2)); 38 | } 39 | 40 | - (void)setTabs:(NSArray *)array { 41 | if (tabs != array) { 42 | for (BCTab *tab in tabs) { 43 | [tab removeFromSuperview]; 44 | } 45 | 46 | tabs = array; 47 | 48 | for (BCTab *tab in tabs) { 49 | tab.userInteractionEnabled = YES; 50 | [tab addTarget:self action:@selector(tabSelected:) forControlEvents:UIControlEventTouchDown]; 51 | } 52 | [self setNeedsLayout]; 53 | 54 | } 55 | } 56 | 57 | - (void)setSelectedTab:(BCTab *)aTab animated:(BOOL)animated { 58 | if (aTab != selectedTab) { 59 | selectedTab = aTab; 60 | selectedTab.selected = YES; 61 | 62 | for (BCTab *tab in tabs) { 63 | if (tab == aTab) continue; 64 | 65 | tab.selected = NO; 66 | } 67 | } 68 | 69 | [self positionArrowAnimated:animated]; 70 | } 71 | 72 | - (void)setSelectedTab:(BCTab *)aTab { 73 | [self setSelectedTab:aTab animated:YES]; 74 | } 75 | 76 | - (void)tabSelected:(BCTab *)sender { 77 | [self.delegate tabBar:self didSelectTabAtIndex:[self.tabs indexOfObject:sender]]; 78 | } 79 | 80 | - (void)positionArrowAnimated:(BOOL)animated { 81 | if (animated) { 82 | [UIView beginAnimations:nil context:NULL]; 83 | [UIView setAnimationDuration:0.2]; 84 | } 85 | CGRect f = self.arrow.frame; 86 | f.origin.x = self.selectedTab.frame.origin.x + ((self.selectedTab.frame.size.width / 2) - (f.size.width / 2)); 87 | self.arrow.frame = f; 88 | 89 | if (animated) { 90 | [UIView commitAnimations]; 91 | } 92 | } 93 | 94 | - (void)layoutSubviews { 95 | [super layoutSubviews]; 96 | CGRect f = self.bounds; 97 | f.size.width /= self.tabs.count; 98 | f.size.width -= (kTabMargin * (self.tabs.count + 1)) / self.tabs.count; 99 | for (BCTab *tab in self.tabs) { 100 | f.origin.x += kTabMargin; 101 | tab.frame = CGRectMake(floorf(f.origin.x), f.origin.y, floorf(f.size.width), f.size.height); 102 | f.origin.x += f.size.width; 103 | [self addSubview:tab]; 104 | } 105 | 106 | [self positionArrowAnimated:NO]; 107 | } 108 | 109 | - (void)setFrame:(CGRect)aFrame { 110 | [super setFrame:aFrame]; 111 | [self setNeedsDisplay]; 112 | } 113 | 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /src/BCTabBarController.m: -------------------------------------------------------------------------------- 1 | #import "BCTabBarController.h" 2 | #import "BCTabBar.h" 3 | #import "BCTab.h" 4 | #import "UIViewController+iconImage.h" 5 | #import "BCTabBarView.h" 6 | 7 | @interface BCTabBarController () 8 | 9 | - (void)loadTabs; 10 | 11 | @property (nonatomic, retain) UIImageView *selectedTab; 12 | @property (nonatomic, readwrite) BOOL visible; 13 | 14 | @end 15 | 16 | 17 | @implementation BCTabBarController 18 | @synthesize viewControllers, tabBar, selectedTab, selectedViewController, tabBarView, visible; 19 | 20 | - (void)loadView { 21 | self.tabBarView = [[BCTabBarView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; 22 | self.view = self.tabBarView; 23 | 24 | CGFloat tabBarHeight = 44 + 6; // tabbar + arrow 25 | CGFloat adjust = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? 1 : 0; 26 | self.tabBar = [[BCTabBar alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height - tabBarHeight, self.view.bounds.size.width, tabBarHeight + adjust)]; 27 | self.tabBar.delegate = self; 28 | 29 | self.tabBarView.backgroundColor = [UIColor clearColor]; 30 | self.tabBarView.tabBar = self.tabBar; 31 | [self loadTabs]; 32 | 33 | UIViewController *tmp = selectedViewController; 34 | selectedViewController = nil; 35 | [self setSelectedViewController:tmp]; 36 | } 37 | 38 | - (void)tabBar:(BCTabBar *)aTabBar didSelectTabAtIndex:(NSInteger)index { 39 | UIViewController *vc = [self.viewControllers objectAtIndex:index]; 40 | if (self.selectedViewController == vc) { 41 | if ([self.selectedViewController isKindOfClass:[UINavigationController class]]) { 42 | [(UINavigationController *)self.selectedViewController popToRootViewControllerAnimated:YES]; 43 | } 44 | } else { 45 | self.selectedViewController = vc; 46 | } 47 | 48 | } 49 | 50 | - (void)setSelectedViewController:(UIViewController *)vc { 51 | UIViewController *oldVC = selectedViewController; 52 | if (selectedViewController != vc) { 53 | selectedViewController = vc; 54 | if (!self.childViewControllers && visible) { 55 | [oldVC viewWillDisappear:NO]; 56 | [selectedViewController viewWillAppear:NO]; 57 | } 58 | self.tabBarView.contentView = vc.view; 59 | if (!self.childViewControllers && visible) { 60 | [oldVC viewDidDisappear:NO]; 61 | [selectedViewController viewDidAppear:NO]; 62 | } 63 | 64 | [self.tabBar setSelectedTab:[self.tabBar.tabs objectAtIndex:self.selectedIndex] animated:(oldVC != nil)]; 65 | } 66 | } 67 | 68 | - (void)viewWillAppear:(BOOL)animated { 69 | [super viewWillAppear:animated]; 70 | 71 | if (!self.childViewControllers) 72 | [self.selectedViewController viewWillAppear:animated]; 73 | } 74 | 75 | - (void)viewDidAppear:(BOOL)animated { 76 | [super viewDidAppear:animated]; 77 | 78 | if (!self.childViewControllers) 79 | [self.selectedViewController viewDidAppear:animated]; 80 | 81 | visible = YES; 82 | } 83 | 84 | - (void)viewWillDisappear:(BOOL)animated { 85 | [super viewWillDisappear:animated]; 86 | 87 | if (!self.childViewControllers) 88 | [self.selectedViewController viewWillDisappear:animated]; 89 | } 90 | 91 | - (void)viewDidDisappear:(BOOL)animated { 92 | [super viewDidDisappear:animated]; 93 | 94 | if (![self respondsToSelector:@selector(addChildViewController:)]) 95 | [self.selectedViewController viewDidDisappear:animated]; 96 | visible = NO; 97 | } 98 | 99 | 100 | 101 | - (NSUInteger)selectedIndex { 102 | return [self.viewControllers indexOfObject:self.selectedViewController]; 103 | } 104 | 105 | - (void)setSelectedIndex:(NSUInteger)aSelectedIndex { 106 | if (self.viewControllers.count > aSelectedIndex) 107 | self.selectedViewController = [self.viewControllers objectAtIndex:aSelectedIndex]; 108 | } 109 | 110 | - (void)loadTabs { 111 | NSMutableArray *tabs = [NSMutableArray arrayWithCapacity:self.viewControllers.count]; 112 | for (UIViewController *vc in self.viewControllers) { 113 | [tabs addObject:[[BCTab alloc] initWithIconImageName:[vc iconImageName]]]; 114 | } 115 | self.tabBar.tabs = tabs; 116 | [self.tabBar setSelectedTab:[self.tabBar.tabs objectAtIndex:self.selectedIndex] animated:NO]; 117 | } 118 | 119 | - (void)viewDidUnload { 120 | self.tabBar = nil; 121 | self.selectedTab = nil; 122 | } 123 | 124 | - (void)setViewControllers:(NSArray *)array { 125 | if (array != viewControllers) { 126 | viewControllers = array; 127 | 128 | if (viewControllers != nil) { 129 | [self loadTabs]; 130 | } 131 | } 132 | 133 | self.selectedIndex = 0; 134 | } 135 | 136 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 137 | return [self.selectedViewController shouldAutorotateToInterfaceOrientation:toInterfaceOrientation]; 138 | } 139 | 140 | - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 141 | [self.selectedViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; 142 | } 143 | 144 | - (void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 145 | [self.selectedViewController willAnimateFirstHalfOfRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; 146 | } 147 | 148 | - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { 149 | [self.selectedViewController willAnimateRotationToInterfaceOrientation:interfaceOrientation duration:duration]; 150 | } 151 | 152 | - (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration { 153 | [self.selectedViewController willAnimateSecondHalfOfRotationFromInterfaceOrientation:fromInterfaceOrientation duration:duration]; 154 | } 155 | 156 | - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { 157 | [self.selectedViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; 158 | } 159 | 160 | @end 161 | -------------------------------------------------------------------------------- /BCTabBarController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; 11 | D35297821285834A00CC4AE1 /* UINavigationController+icons.m in Sources */ = {isa = PBXBuildFile; fileRef = D35297811285834A00CC4AE1 /* UINavigationController+icons.m */; }; 12 | D3B2F6C712855CAC0089B15B /* prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = D3B2F6BE12855CAC0089B15B /* prefix.pch */; }; 13 | D3B2F6C812855CAC0089B15B /* BCTab.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B2F6BF12855CAC0089B15B /* BCTab.h */; }; 14 | D3B2F6C912855CAC0089B15B /* BCTab.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F6C012855CAC0089B15B /* BCTab.m */; }; 15 | D3B2F6CA12855CAC0089B15B /* BCTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B2F6C112855CAC0089B15B /* BCTabBar.h */; }; 16 | D3B2F6CB12855CAC0089B15B /* BCTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F6C212855CAC0089B15B /* BCTabBar.m */; }; 17 | D3B2F6CC12855CAC0089B15B /* BCTabBarController.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B2F6C312855CAC0089B15B /* BCTabBarController.h */; }; 18 | D3B2F6CD12855CAC0089B15B /* BCTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F6C412855CAC0089B15B /* BCTabBarController.m */; }; 19 | D3B2F6CE12855CAC0089B15B /* BCTabBarView.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B2F6C512855CAC0089B15B /* BCTabBarView.h */; }; 20 | D3B2F6CF12855CAC0089B15B /* BCTabBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F6C612855CAC0089B15B /* BCTabBarView.m */; }; 21 | D3B2F72E12855CF10089B15B /* UIViewController+iconImage.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B2F72C12855CF10089B15B /* UIViewController+iconImage.h */; }; 22 | D3B2F72F12855CF10089B15B /* UIViewController+iconImage.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F72D12855CF10089B15B /* UIViewController+iconImage.m */; }; 23 | D3B2F78512855EF30089B15B /* libBCTabBarController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2AAC07E0554694100DB518D /* libBCTabBarController.a */; }; 24 | D3B2F78812855F020089B15B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; 25 | D3B2F7DF12855F110089B15B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3B2F78912855F090089B15B /* UIKit.framework */; }; 26 | D3B2F7F312855F460089B15B /* EXAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F7F212855F460089B15B /* EXAppDelegate.m */; }; 27 | D3B2F7F812855F650089B15B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F7F712855F650089B15B /* main.m */; }; 28 | D3B2F812128560560089B15B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3B2F811128560560089B15B /* QuartzCore.framework */; }; 29 | D3B2F82D128560670089B15B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3B2F82C128560670089B15B /* CoreGraphics.framework */; }; 30 | D3B2F83F128560940089B15B /* EXViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D3B2F83E128560940089B15B /* EXViewController.m */; }; 31 | D3B2F8651285618F0089B15B /* magnifying-glass-selected.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B2F8611285618F0089B15B /* magnifying-glass-selected.png */; }; 32 | D3B2F8661285618F0089B15B /* magnifying-glass-selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B2F8621285618F0089B15B /* magnifying-glass-selected@2x.png */; }; 33 | D3B2F8671285618F0089B15B /* magnifying-glass.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B2F8631285618F0089B15B /* magnifying-glass.png */; }; 34 | D3B2F8681285618F0089B15B /* magnifying-glass@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D3B2F8641285618F0089B15B /* magnifying-glass@2x.png */; }; 35 | D3B2F8E3128563170089B15B /* BCTabBarController.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D3B2F8E2128563170089B15B /* BCTabBarController.bundle */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXContainerItemProxy section */ 39 | D3B2F78312855EEF0089B15B /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 42 | proxyType = 1; 43 | remoteGlobalIDString = D2AAC07D0554694100DB518D; 44 | remoteInfo = BCTabBarController; 45 | }; 46 | /* End PBXContainerItemProxy section */ 47 | 48 | /* Begin PBXFileReference section */ 49 | AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 50 | D2AAC07E0554694100DB518D /* libBCTabBarController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBCTabBarController.a; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | D352977312856A9F00CC4AE1 /* Readme.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.markdown; sourceTree = ""; }; 52 | D35297801285834A00CC4AE1 /* UINavigationController+icons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+icons.h"; sourceTree = ""; }; 53 | D35297811285834A00CC4AE1 /* UINavigationController+icons.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+icons.m"; sourceTree = ""; }; 54 | D3B2F6BE12855CAC0089B15B /* prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prefix.pch; sourceTree = ""; }; 55 | D3B2F6BF12855CAC0089B15B /* BCTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BCTab.h; sourceTree = ""; }; 56 | D3B2F6C012855CAC0089B15B /* BCTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BCTab.m; sourceTree = ""; }; 57 | D3B2F6C112855CAC0089B15B /* BCTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BCTabBar.h; sourceTree = ""; }; 58 | D3B2F6C212855CAC0089B15B /* BCTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BCTabBar.m; sourceTree = ""; }; 59 | D3B2F6C312855CAC0089B15B /* BCTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BCTabBarController.h; sourceTree = ""; }; 60 | D3B2F6C412855CAC0089B15B /* BCTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BCTabBarController.m; sourceTree = ""; }; 61 | D3B2F6C512855CAC0089B15B /* BCTabBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BCTabBarView.h; sourceTree = ""; }; 62 | D3B2F6C612855CAC0089B15B /* BCTabBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BCTabBarView.m; sourceTree = ""; }; 63 | D3B2F72C12855CF10089B15B /* UIViewController+iconImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+iconImage.h"; sourceTree = ""; }; 64 | D3B2F72D12855CF10089B15B /* UIViewController+iconImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+iconImage.m"; sourceTree = ""; }; 65 | D3B2F77712855E1B0089B15B /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | D3B2F77912855E1B0089B15B /* Example-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Example-Info.plist"; sourceTree = ""; }; 67 | D3B2F78912855F090089B15B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 68 | D3B2F7F112855F460089B15B /* EXAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXAppDelegate.h; sourceTree = ""; }; 69 | D3B2F7F212855F460089B15B /* EXAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EXAppDelegate.m; sourceTree = ""; }; 70 | D3B2F7F712855F650089B15B /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 71 | D3B2F811128560560089B15B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 72 | D3B2F82C128560670089B15B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 73 | D3B2F83D128560940089B15B /* EXViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXViewController.h; sourceTree = ""; }; 74 | D3B2F83E128560940089B15B /* EXViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EXViewController.m; sourceTree = ""; }; 75 | D3B2F84E1285610A0089B15B /* prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prefix.pch; sourceTree = ""; }; 76 | D3B2F8611285618F0089B15B /* magnifying-glass-selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "magnifying-glass-selected.png"; sourceTree = ""; }; 77 | D3B2F8621285618F0089B15B /* magnifying-glass-selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "magnifying-glass-selected@2x.png"; sourceTree = ""; }; 78 | D3B2F8631285618F0089B15B /* magnifying-glass.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "magnifying-glass.png"; sourceTree = ""; }; 79 | D3B2F8641285618F0089B15B /* magnifying-glass@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "magnifying-glass@2x.png"; sourceTree = ""; }; 80 | D3B2F8E2128563170089B15B /* BCTabBarController.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = BCTabBarController.bundle; sourceTree = SOURCE_ROOT; }; 81 | /* End PBXFileReference section */ 82 | 83 | /* Begin PBXFrameworksBuildPhase section */ 84 | D2AAC07C0554694100DB518D /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | D3B2F77512855E1B0089B15B /* Frameworks */ = { 93 | isa = PBXFrameworksBuildPhase; 94 | buildActionMask = 2147483647; 95 | files = ( 96 | D3B2F78512855EF30089B15B /* libBCTabBarController.a in Frameworks */, 97 | D3B2F78812855F020089B15B /* Foundation.framework in Frameworks */, 98 | D3B2F7DF12855F110089B15B /* UIKit.framework in Frameworks */, 99 | D3B2F812128560560089B15B /* QuartzCore.framework in Frameworks */, 100 | D3B2F82D128560670089B15B /* CoreGraphics.framework in Frameworks */, 101 | ); 102 | runOnlyForDeploymentPostprocessing = 0; 103 | }; 104 | /* End PBXFrameworksBuildPhase section */ 105 | 106 | /* Begin PBXGroup section */ 107 | 034768DFFF38A50411DB9C8B /* Products */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | D2AAC07E0554694100DB518D /* libBCTabBarController.a */, 111 | D3B2F77712855E1B0089B15B /* Example.app */, 112 | ); 113 | name = Products; 114 | sourceTree = ""; 115 | }; 116 | 0867D691FE84028FC02AAC07 /* BCTabBarController */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | D3B2F6BC12855CAC0089B15B /* src */, 120 | D3B2F77D12855E4B0089B15B /* example */, 121 | 0867D69AFE84028FC02AAC07 /* Frameworks */, 122 | 034768DFFF38A50411DB9C8B /* Products */, 123 | D3B2F77912855E1B0089B15B /* Example-Info.plist */, 124 | D352977312856A9F00CC4AE1 /* Readme.markdown */, 125 | ); 126 | name = BCTabBarController; 127 | sourceTree = ""; 128 | }; 129 | 0867D69AFE84028FC02AAC07 /* Frameworks */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | AACBBE490F95108600F1A2B1 /* Foundation.framework */, 133 | D3B2F78912855F090089B15B /* UIKit.framework */, 134 | D3B2F811128560560089B15B /* QuartzCore.framework */, 135 | D3B2F82C128560670089B15B /* CoreGraphics.framework */, 136 | ); 137 | name = Frameworks; 138 | sourceTree = ""; 139 | }; 140 | D3B2F6BC12855CAC0089B15B /* src */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | D3B2F6BD12855CAC0089B15B /* base */, 144 | D3B2F6BF12855CAC0089B15B /* BCTab.h */, 145 | D3B2F6C012855CAC0089B15B /* BCTab.m */, 146 | D3B2F6C112855CAC0089B15B /* BCTabBar.h */, 147 | D3B2F6C212855CAC0089B15B /* BCTabBar.m */, 148 | D3B2F6C312855CAC0089B15B /* BCTabBarController.h */, 149 | D3B2F6C412855CAC0089B15B /* BCTabBarController.m */, 150 | D3B2F6C512855CAC0089B15B /* BCTabBarView.h */, 151 | D3B2F6C612855CAC0089B15B /* BCTabBarView.m */, 152 | D3B2F72C12855CF10089B15B /* UIViewController+iconImage.h */, 153 | D3B2F72D12855CF10089B15B /* UIViewController+iconImage.m */, 154 | D35297801285834A00CC4AE1 /* UINavigationController+icons.h */, 155 | D35297811285834A00CC4AE1 /* UINavigationController+icons.m */, 156 | ); 157 | path = src; 158 | sourceTree = ""; 159 | }; 160 | D3B2F6BD12855CAC0089B15B /* base */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | D3B2F6BE12855CAC0089B15B /* prefix.pch */, 164 | ); 165 | path = base; 166 | sourceTree = ""; 167 | }; 168 | D3B2F77D12855E4B0089B15B /* example */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | D3B2F7E512855F260089B15B /* src */, 172 | D3B2F77E12855E4B0089B15B /* res */, 173 | ); 174 | path = example; 175 | sourceTree = ""; 176 | }; 177 | D3B2F77E12855E4B0089B15B /* res */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | D3B2F8611285618F0089B15B /* magnifying-glass-selected.png */, 181 | D3B2F8621285618F0089B15B /* magnifying-glass-selected@2x.png */, 182 | D3B2F8631285618F0089B15B /* magnifying-glass.png */, 183 | D3B2F8641285618F0089B15B /* magnifying-glass@2x.png */, 184 | D3B2F8E2128563170089B15B /* BCTabBarController.bundle */, 185 | ); 186 | path = res; 187 | sourceTree = ""; 188 | }; 189 | D3B2F7E512855F260089B15B /* src */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | D3B2F84D128561010089B15B /* base */, 193 | D3B2F7F112855F460089B15B /* EXAppDelegate.h */, 194 | D3B2F7F212855F460089B15B /* EXAppDelegate.m */, 195 | D3B2F7F712855F650089B15B /* main.m */, 196 | D3B2F83D128560940089B15B /* EXViewController.h */, 197 | D3B2F83E128560940089B15B /* EXViewController.m */, 198 | ); 199 | path = src; 200 | sourceTree = ""; 201 | }; 202 | D3B2F84D128561010089B15B /* base */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | D3B2F84E1285610A0089B15B /* prefix.pch */, 206 | ); 207 | path = base; 208 | sourceTree = ""; 209 | }; 210 | /* End PBXGroup section */ 211 | 212 | /* Begin PBXHeadersBuildPhase section */ 213 | D2AAC07A0554694100DB518D /* Headers */ = { 214 | isa = PBXHeadersBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | D3B2F6C712855CAC0089B15B /* prefix.pch in Headers */, 218 | D3B2F6C812855CAC0089B15B /* BCTab.h in Headers */, 219 | D3B2F6CA12855CAC0089B15B /* BCTabBar.h in Headers */, 220 | D3B2F6CC12855CAC0089B15B /* BCTabBarController.h in Headers */, 221 | D3B2F6CE12855CAC0089B15B /* BCTabBarView.h in Headers */, 222 | D3B2F72E12855CF10089B15B /* UIViewController+iconImage.h in Headers */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | /* End PBXHeadersBuildPhase section */ 227 | 228 | /* Begin PBXNativeTarget section */ 229 | D2AAC07D0554694100DB518D /* BCTabBarController */ = { 230 | isa = PBXNativeTarget; 231 | buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "BCTabBarController" */; 232 | buildPhases = ( 233 | D2AAC07A0554694100DB518D /* Headers */, 234 | D2AAC07B0554694100DB518D /* Sources */, 235 | D2AAC07C0554694100DB518D /* Frameworks */, 236 | ); 237 | buildRules = ( 238 | ); 239 | dependencies = ( 240 | ); 241 | name = BCTabBarController; 242 | productName = BCTabBarController; 243 | productReference = D2AAC07E0554694100DB518D /* libBCTabBarController.a */; 244 | productType = "com.apple.product-type.library.static"; 245 | }; 246 | D3B2F77612855E1B0089B15B /* Example */ = { 247 | isa = PBXNativeTarget; 248 | buildConfigurationList = D3B2F77C12855E1C0089B15B /* Build configuration list for PBXNativeTarget "Example" */; 249 | buildPhases = ( 250 | D3B2F77312855E1B0089B15B /* Resources */, 251 | D3B2F77412855E1B0089B15B /* Sources */, 252 | D3B2F77512855E1B0089B15B /* Frameworks */, 253 | ); 254 | buildRules = ( 255 | ); 256 | dependencies = ( 257 | D3B2F78412855EEF0089B15B /* PBXTargetDependency */, 258 | ); 259 | name = Example; 260 | productName = Example; 261 | productReference = D3B2F77712855E1B0089B15B /* Example.app */; 262 | productType = "com.apple.product-type.application"; 263 | }; 264 | /* End PBXNativeTarget section */ 265 | 266 | /* Begin PBXProject section */ 267 | 0867D690FE84028FC02AAC07 /* Project object */ = { 268 | isa = PBXProject; 269 | attributes = { 270 | LastUpgradeCheck = 0420; 271 | }; 272 | buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "BCTabBarController" */; 273 | compatibilityVersion = "Xcode 3.2"; 274 | developmentRegion = English; 275 | hasScannedForEncodings = 1; 276 | knownRegions = ( 277 | English, 278 | Japanese, 279 | French, 280 | German, 281 | ); 282 | mainGroup = 0867D691FE84028FC02AAC07 /* BCTabBarController */; 283 | productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; 284 | projectDirPath = ""; 285 | projectRoot = ""; 286 | targets = ( 287 | D2AAC07D0554694100DB518D /* BCTabBarController */, 288 | D3B2F77612855E1B0089B15B /* Example */, 289 | ); 290 | }; 291 | /* End PBXProject section */ 292 | 293 | /* Begin PBXResourcesBuildPhase section */ 294 | D3B2F77312855E1B0089B15B /* Resources */ = { 295 | isa = PBXResourcesBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | D3B2F8651285618F0089B15B /* magnifying-glass-selected.png in Resources */, 299 | D3B2F8661285618F0089B15B /* magnifying-glass-selected@2x.png in Resources */, 300 | D3B2F8671285618F0089B15B /* magnifying-glass.png in Resources */, 301 | D3B2F8681285618F0089B15B /* magnifying-glass@2x.png in Resources */, 302 | D3B2F8E3128563170089B15B /* BCTabBarController.bundle in Resources */, 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | }; 306 | /* End PBXResourcesBuildPhase section */ 307 | 308 | /* Begin PBXSourcesBuildPhase section */ 309 | D2AAC07B0554694100DB518D /* Sources */ = { 310 | isa = PBXSourcesBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | D3B2F6C912855CAC0089B15B /* BCTab.m in Sources */, 314 | D3B2F6CB12855CAC0089B15B /* BCTabBar.m in Sources */, 315 | D3B2F6CD12855CAC0089B15B /* BCTabBarController.m in Sources */, 316 | D3B2F6CF12855CAC0089B15B /* BCTabBarView.m in Sources */, 317 | D3B2F72F12855CF10089B15B /* UIViewController+iconImage.m in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | D3B2F77412855E1B0089B15B /* Sources */ = { 322 | isa = PBXSourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | D3B2F7F312855F460089B15B /* EXAppDelegate.m in Sources */, 326 | D3B2F7F812855F650089B15B /* main.m in Sources */, 327 | D3B2F83F128560940089B15B /* EXViewController.m in Sources */, 328 | D35297821285834A00CC4AE1 /* UINavigationController+icons.m in Sources */, 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | }; 332 | /* End PBXSourcesBuildPhase section */ 333 | 334 | /* Begin PBXTargetDependency section */ 335 | D3B2F78412855EEF0089B15B /* PBXTargetDependency */ = { 336 | isa = PBXTargetDependency; 337 | target = D2AAC07D0554694100DB518D /* BCTabBarController */; 338 | targetProxy = D3B2F78312855EEF0089B15B /* PBXContainerItemProxy */; 339 | }; 340 | /* End PBXTargetDependency section */ 341 | 342 | /* Begin XCBuildConfiguration section */ 343 | 1DEB921F08733DC00010E9CD /* Debug */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | ALWAYS_SEARCH_USER_PATHS = NO; 347 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 348 | COPY_PHASE_STRIP = NO; 349 | DSTROOT = /tmp/BCTabBarController.dst; 350 | GCC_DYNAMIC_NO_PIC = NO; 351 | GCC_MODEL_TUNING = G5; 352 | GCC_OPTIMIZATION_LEVEL = 0; 353 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 354 | GCC_PREFIX_HEADER = src/base/prefix.pch; 355 | INSTALL_PATH = /usr/local/lib; 356 | PRODUCT_NAME = BCTabBarController; 357 | }; 358 | name = Debug; 359 | }; 360 | 1DEB922008733DC00010E9CD /* Release */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 365 | DSTROOT = /tmp/BCTabBarController.dst; 366 | GCC_MODEL_TUNING = G5; 367 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 368 | GCC_PREFIX_HEADER = BCTabBarController_Prefix.pch; 369 | INSTALL_PATH = /usr/local/lib; 370 | PRODUCT_NAME = BCTabBarController; 371 | }; 372 | name = Release; 373 | }; 374 | 1DEB922308733DC00010E9CD /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 378 | CLANG_ENABLE_OBJC_ARC = YES; 379 | GCC_C_LANGUAGE_STANDARD = c99; 380 | GCC_OPTIMIZATION_LEVEL = 0; 381 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | OTHER_LDFLAGS = "-ObjC"; 384 | SDKROOT = iphoneos; 385 | }; 386 | name = Debug; 387 | }; 388 | 1DEB922408733DC00010E9CD /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 392 | CLANG_ENABLE_OBJC_ARC = YES; 393 | GCC_C_LANGUAGE_STANDARD = c99; 394 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 395 | GCC_WARN_UNUSED_VARIABLE = YES; 396 | OTHER_LDFLAGS = "-ObjC"; 397 | SDKROOT = iphoneos; 398 | }; 399 | name = Release; 400 | }; 401 | D3B2F77A12855E1C0089B15B /* Debug */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | ALWAYS_SEARCH_USER_PATHS = NO; 405 | CODE_SIGN_IDENTITY = "iPhone Developer"; 406 | COPY_PHASE_STRIP = NO; 407 | GCC_DYNAMIC_NO_PIC = NO; 408 | GCC_OPTIMIZATION_LEVEL = 0; 409 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 410 | GCC_PREFIX_HEADER = example/src/base/prefix.pch; 411 | INFOPLIST_FILE = "Example-Info.plist"; 412 | INSTALL_PATH = "$(HOME)/Applications"; 413 | IPHONEOS_DEPLOYMENT_TARGET = 4.0; 414 | OTHER_LDFLAGS = ( 415 | "-framework", 416 | Foundation, 417 | "-framework", 418 | UIKit, 419 | ); 420 | PRODUCT_NAME = Example; 421 | SDKROOT = iphoneos; 422 | }; 423 | name = Debug; 424 | }; 425 | D3B2F77B12855E1C0089B15B /* Release */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | ALWAYS_SEARCH_USER_PATHS = NO; 429 | CODE_SIGN_IDENTITY = "iPhone Developer"; 430 | COPY_PHASE_STRIP = YES; 431 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 432 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 433 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h"; 434 | INFOPLIST_FILE = "Example-Info.plist"; 435 | INSTALL_PATH = "$(HOME)/Applications"; 436 | IPHONEOS_DEPLOYMENT_TARGET = 4.0; 437 | OTHER_LDFLAGS = ( 438 | "-framework", 439 | Foundation, 440 | "-framework", 441 | UIKit, 442 | ); 443 | PRODUCT_NAME = Example; 444 | SDKROOT = iphoneos; 445 | ZERO_LINK = NO; 446 | }; 447 | name = Release; 448 | }; 449 | /* End XCBuildConfiguration section */ 450 | 451 | /* Begin XCConfigurationList section */ 452 | 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "BCTabBarController" */ = { 453 | isa = XCConfigurationList; 454 | buildConfigurations = ( 455 | 1DEB921F08733DC00010E9CD /* Debug */, 456 | 1DEB922008733DC00010E9CD /* Release */, 457 | ); 458 | defaultConfigurationIsVisible = 0; 459 | defaultConfigurationName = Release; 460 | }; 461 | 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "BCTabBarController" */ = { 462 | isa = XCConfigurationList; 463 | buildConfigurations = ( 464 | 1DEB922308733DC00010E9CD /* Debug */, 465 | 1DEB922408733DC00010E9CD /* Release */, 466 | ); 467 | defaultConfigurationIsVisible = 0; 468 | defaultConfigurationName = Release; 469 | }; 470 | D3B2F77C12855E1C0089B15B /* Build configuration list for PBXNativeTarget "Example" */ = { 471 | isa = XCConfigurationList; 472 | buildConfigurations = ( 473 | D3B2F77A12855E1C0089B15B /* Debug */, 474 | D3B2F77B12855E1C0089B15B /* Release */, 475 | ); 476 | defaultConfigurationIsVisible = 0; 477 | defaultConfigurationName = Release; 478 | }; 479 | /* End XCConfigurationList section */ 480 | }; 481 | rootObject = 0867D690FE84028FC02AAC07 /* Project object */; 482 | } 483 | --------------------------------------------------------------------------------