Permalink
Browse files

Initial commit

  • Loading branch information...
1 parent b07331c commit 28a51de0ac6738354f1a89b45ae360524ee5262c James Addyman committed Oct 25, 2010
Showing with 1,901 additions and 0 deletions.
  1. +22 −0 Demo/Classes/ScrollableTabBarAppDelegate.h
  2. +88 −0 Demo/Classes/ScrollableTabBarAppDelegate.m
  3. +20 −0 Demo/Classes/ScrollableTabBarViewController.h
  4. +111 −0 Demo/Classes/ScrollableTabBarViewController.m
  5. +444 −0 Demo/MainWindow.xib
  6. +30 −0 Demo/ScrollableTabBar-Info.plist
  7. +322 −0 Demo/ScrollableTabBar.xcodeproj/project.pbxproj
  8. +156 −0 Demo/ScrollableTabBarViewController.xib
  9. +8 −0 Demo/ScrollableTabBar_Prefix.pch
  10. +17 −0 Demo/main.m
  11. +51 −0 JSScrollableTabBar.h
  12. +194 −0 JSScrollableTabBar.m
  13. +266 −0 JSScrollableTabBar.xcodeproj/project.pbxproj
  14. +7 −0 JSScrollableTabBar_Prefix.pch
  15. +26 −0 JSTabButton.h
  16. +85 −0 JSTabButton.m
  17. +22 −0 JSTabItem.h
  18. +32 −0 JSTabItem.m
  19. BIN images.bundle/barBackgroundBlack.png
  20. BIN images.bundle/barBackgroundBlack@2x.png
  21. BIN images.bundle/barBackgroundBlue.png
  22. BIN images.bundle/barBackgroundBlue@2x.png
  23. BIN images.bundle/barBackgroundTrans.png
  24. BIN images.bundle/barBackgroundTrans@2x.png
  25. BIN images.bundle/fadeLeft_black.png
  26. BIN images.bundle/fadeLeft_black@2x.png
  27. BIN images.bundle/fadeLeft_blue.png
  28. BIN images.bundle/fadeLeft_blue@2x.png
  29. BIN images.bundle/fadeLeft_trans.png
  30. BIN images.bundle/fadeLeft_trans@2x.png
  31. BIN images.bundle/fadeRight_black.png
  32. BIN images.bundle/fadeRight_black@2x.png
  33. BIN images.bundle/fadeRight_blue.png
  34. BIN images.bundle/fadeRight_blue@2x.png
  35. BIN images.bundle/fadeRight_trans.png
  36. BIN images.bundle/fadeRight_trans@2x.png
  37. BIN images.bundle/tabButtonHighlighted.png
  38. BIN images.bundle/tabButtonHighlighted@2x.png
  39. BIN images.bundle/tabButtonNormal.png
  40. BIN images.bundle/tabButtonNormal@2x.png
View
22 Demo/Classes/ScrollableTabBarAppDelegate.h
@@ -0,0 +1,22 @@
+//
+// ScrollableTabBarAppDelegate.h
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class ScrollableTabBarViewController;
+
+@interface ScrollableTabBarAppDelegate : NSObject <UIApplicationDelegate> {
+ UIWindow *window;
+ ScrollableTabBarViewController *viewController;
+}
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+@property (nonatomic, retain) IBOutlet ScrollableTabBarViewController *viewController;
+
+@end
+
View
88 Demo/Classes/ScrollableTabBarAppDelegate.m
@@ -0,0 +1,88 @@
+//
+// ScrollableTabBarAppDelegate.m
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import "ScrollableTabBarAppDelegate.h"
+#import "ScrollableTabBarViewController.h"
+
+@implementation ScrollableTabBarAppDelegate
+
+@synthesize window;
+@synthesize viewController;
+
+
+#pragma mark -
+#pragma mark Application lifecycle
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+ // Override point for customization after application launch.
+
+ // Add the view controller's view to the window and display.
+ [window addSubview:viewController.view];
+ [window makeKeyAndVisible];
+
+ return YES;
+}
+
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+ /*
+ Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
+ */
+}
+
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+ /*
+ Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ */
+}
+
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+ /*
+ Called when the application is about to terminate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+
+#pragma mark -
+#pragma mark Memory management
+
+- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
+ /*
+ Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
+ */
+}
+
+
+- (void)dealloc {
+ [viewController release];
+ [window release];
+ [super dealloc];
+}
+
+
+@end
View
20 Demo/Classes/ScrollableTabBarViewController.h
@@ -0,0 +1,20 @@
+//
+// ScrollableTabBarViewController.h
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "JSScrollableTabBar.h"
+
+@interface ScrollableTabBarViewController : UIViewController <JSScrollableTabBarDelegate> {
+
+ UILabel *_label;
+ JSScrollableTabBar *_tabBar;
+
+}
+
+@end
+
View
111 Demo/Classes/ScrollableTabBarViewController.m
@@ -0,0 +1,111 @@
+//
+// ScrollableTabBarViewController.m
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import "ScrollableTabBarViewController.h"
+
+@implementation ScrollableTabBarViewController
+
+/*
+// The designated initializer. Override to perform setup that is required before the view is loaded.
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
+ // Custom initialization
+ }
+ return self;
+}
+*/
+
+/*
+// Implement loadView to create a view hierarchy programmatically, without using a nib.
+- (void)loadView {
+}
+*/
+
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ _tabBar = [[[JSScrollableTabBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44) style:JSScrollableTabBarStyleBlack] autorelease];
+ [_tabBar setDelegate:self];
+ [self.view addSubview:_tabBar];
+
+ _label = [[[UILabel alloc] initWithFrame:CGRectMake(0, 90, 320, 30)] autorelease];
+ [self.view addSubview:_label];
+
+ NSMutableArray *items = [NSMutableArray array];
+
+ for (int i = 0; i < 25; i++)
+ {
+ JSTabItem *item = [[JSTabItem alloc] initWithTitle:[NSString stringWithFormat:@"Item %d", i]];
+ [items addObject:item];
+ [item release];
+ }
+
+ [_tabBar setTabItems:items];
+
+ UIButton *styleButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+ [styleButton setTitle:@"Change Style" forState:UIControlStateNormal];
+ [styleButton addTarget:self
+ action:@selector(changeStyle:)
+ forControlEvents:UIControlEventTouchUpInside];
+ [styleButton sizeToFit];
+ CGRect buttonFrame = [styleButton frame];
+ buttonFrame.origin = CGPointMake(150, 150);
+ [styleButton setFrame:buttonFrame];
+ [self.view addSubview:styleButton];
+}
+
+- (void)changeStyle:(id)sender
+{
+ switch (_tabBar.style) {
+ case JSScrollableTabBarStyleBlue:
+ _tabBar.style = JSScrollableTabBarStyleBlack;
+ break;
+ case JSScrollableTabBarStyleBlack:
+ _tabBar.style = JSScrollableTabBarStyleTransparent;
+ break;
+ case JSScrollableTabBarStyleTransparent:
+ _tabBar.style = JSScrollableTabBarStyleBlue;
+ break;
+ default:
+ break;
+ }
+}
+
+- (void)scrollableTabBar:(JSScrollableTabBar *)tabBar didSelectTabAtIndex:(NSInteger)index
+{
+ [_label setText:[NSString stringWithFormat:@"Selected tab: %d", index]];
+}
+
+/*
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+*/
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc that aren't in use.
+}
+
+- (void)viewDidUnload {
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+@end
View
444 Demo/MainWindow.xib
@@ -0,0 +1,444 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1024</int>
+ <string key="IBDocument.SystemVersion">10D571</string>
+ <string key="IBDocument.InterfaceBuilderVersion">786</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">112</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="10"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="841351856">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="427554174">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUICustomObject" id="664661524">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIViewController" id="943309135">
+ <string key="IBUINibName">ScrollableTabBarViewController</string>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
+ </object>
+ <object class="IBUIWindow" id="117978783">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrameSize">{320, 480}</string>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MSAxIDEAA</bytes>
+ </object>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIResizesToFullScreen">YES</bool>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="841351856"/>
+ <reference key="destination" ref="664661524"/>
+ </object>
+ <int key="connectionID">4</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">viewController</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="943309135"/>
+ </object>
+ <int key="connectionID">11</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="117978783"/>
+ </object>
+ <int key="connectionID">14</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="841351856"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="664661524"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">ScrollableTabBar App Delegate</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="427554174"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="943309135"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">12</int>
+ <reference key="object" ref="117978783"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>10.CustomClassName</string>
+ <string>10.IBEditorWindowLastContentRect</string>
+ <string>10.IBPluginDependency</string>
+ <string>12.IBEditorWindowLastContentRect</string>
+ <string>12.IBPluginDependency</string>
+ <string>3.CustomClassName</string>
+ <string>3.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UIApplication</string>
+ <string>UIResponder</string>
+ <string>ScrollableTabBarViewController</string>
+ <string>{{234, 376}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>{{525, 346}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>ScrollableTabBarAppDelegate</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">15</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIWindow</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">ScrollableTabBarAppDelegate</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>viewController</string>
+ <string>window</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>ScrollableTabBarViewController</string>
+ <string>UIWindow</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>viewController</string>
+ <string>window</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">viewController</string>
+ <string key="candidateClassName">ScrollableTabBarViewController</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">window</string>
+ <string key="candidateClassName">UIWindow</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ScrollableTabBarAppDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">ScrollableTabBarAppDelegate</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">ScrollableTabBarViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ScrollableTabBarViewController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="356479594">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIApplication</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="356479594"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIWindow</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIWindow.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <integer value="1024" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3100" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">ScrollableTabBar.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">112</string>
+ </data>
+</archive>
View
30 Demo/ScrollableTabBar-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainWindow</string>
+</dict>
+</plist>
View
322 Demo/ScrollableTabBar.xcodeproj/project.pbxproj
@@ -0,0 +1,322 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1D3623260D0F684500981E51 /* ScrollableTabBarAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* ScrollableTabBarAppDelegate.m */; };
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
+ 2899E5220DE3E06400AC0155 /* ScrollableTabBarViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* ScrollableTabBarViewController.xib */; };
+ 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
+ 28D7ACF80DDB3853001CB0EB /* ScrollableTabBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* ScrollableTabBarViewController.m */; };
+ 75AFA41C12759B4D00447113 /* libJSScrollableTabBar.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 75AFA41B12759B4100447113 /* libJSScrollableTabBar.a */; };
+ 75AFA48912759EE200447113 /* images.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 75AFA48812759EE200447113 /* images.bundle */; };
+ 75DD053F126F50910025998A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75DD053E126F50910025998A /* QuartzCore.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 75AFA41A12759B4100447113 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 75359DEA1275995A00614700 /* JSScrollableTabBar.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = D2AAC07E0554694100DB518D;
+ remoteInfo = JSScrollableTabBar;
+ };
+ 75AFA42A12759BD000447113 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 75359DEA1275995A00614700 /* JSScrollableTabBar.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = D2AAC07D0554694100DB518D;
+ remoteInfo = JSScrollableTabBar;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 1D3623240D0F684500981E51 /* ScrollableTabBarAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollableTabBarAppDelegate.h; sourceTree = "<group>"; };
+ 1D3623250D0F684500981E51 /* ScrollableTabBarAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScrollableTabBarAppDelegate.m; sourceTree = "<group>"; };
+ 1D6058910D05DD3D006BFB54 /* ScrollableTabBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScrollableTabBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 2899E5210DE3E06400AC0155 /* ScrollableTabBarViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ScrollableTabBarViewController.xib; sourceTree = "<group>"; };
+ 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
+ 28D7ACF60DDB3853001CB0EB /* ScrollableTabBarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollableTabBarViewController.h; sourceTree = "<group>"; };
+ 28D7ACF70DDB3853001CB0EB /* ScrollableTabBarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScrollableTabBarViewController.m; sourceTree = "<group>"; };
+ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 32CA4F630368D1EE00C91783 /* ScrollableTabBar_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollableTabBar_Prefix.pch; sourceTree = "<group>"; };
+ 75359DEA1275995A00614700 /* JSScrollableTabBar.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = JSScrollableTabBar.xcodeproj; path = ../JSScrollableTabBar.xcodeproj; sourceTree = SOURCE_ROOT; };
+ 75AFA48812759EE200447113 /* images.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = images.bundle; path = ../images.bundle; sourceTree = SOURCE_ROOT; };
+ 75DD053E126F50910025998A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ 8D1107310486CEB800E47090 /* ScrollableTabBar-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ScrollableTabBar-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
+ 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,
+ 75DD053F126F50910025998A /* QuartzCore.framework in Frameworks */,
+ 75AFA41C12759B4D00447113 /* libJSScrollableTabBar.a in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 1D3623240D0F684500981E51 /* ScrollableTabBarAppDelegate.h */,
+ 1D3623250D0F684500981E51 /* ScrollableTabBarAppDelegate.m */,
+ 28D7ACF60DDB3853001CB0EB /* ScrollableTabBarViewController.h */,
+ 28D7ACF70DDB3853001CB0EB /* ScrollableTabBarViewController.m */,
+ );
+ path = Classes;
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1D6058910D05DD3D006BFB54 /* ScrollableTabBar.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
+ isa = PBXGroup;
+ children = (
+ 75359DEA1275995A00614700 /* JSScrollableTabBar.xcodeproj */,
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = CustomTemplate;
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* ScrollableTabBar_Prefix.pch */,
+ 29B97316FDCFA39411CA2CEA /* main.m */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 75AFA48812759EE200447113 /* images.bundle */,
+ 2899E5210DE3E06400AC0155 /* ScrollableTabBarViewController.xib */,
+ 28AD733E0D9D9553002E5188 /* MainWindow.xib */,
+ 8D1107310486CEB800E47090 /* ScrollableTabBar-Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
+ 1D30AB110D05D00D00671497 /* Foundation.framework */,
+ 288765A40DF7441C002DB57D /* CoreGraphics.framework */,
+ 75DD053E126F50910025998A /* QuartzCore.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 75AFA41712759B4100447113 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 75AFA41B12759B4100447113 /* libJSScrollableTabBar.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1D6058900D05DD3D006BFB54 /* ScrollableTabBar */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ScrollableTabBar" */;
+ buildPhases = (
+ 1D60588D0D05DD3D006BFB54 /* Resources */,
+ 1D60588E0D05DD3D006BFB54 /* Sources */,
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 75AFA42B12759BD000447113 /* PBXTargetDependency */,
+ );
+ name = ScrollableTabBar;
+ productName = ScrollableTabBar;
+ productReference = 1D6058910D05DD3D006BFB54 /* ScrollableTabBar.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScrollableTabBar" */;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = 75AFA41712759B4100447113 /* Products */;
+ ProjectRef = 75359DEA1275995A00614700 /* JSScrollableTabBar.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ 1D6058900D05DD3D006BFB54 /* ScrollableTabBar */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ 75AFA41B12759B4100447113 /* libJSScrollableTabBar.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libJSScrollableTabBar.a;
+ remoteRef = 75AFA41A12759B4100447113 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1D60588D0D05DD3D006BFB54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
+ 2899E5220DE3E06400AC0155 /* ScrollableTabBarViewController.xib in Resources */,
+ 75AFA48912759EE200447113 /* images.bundle in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1D60588E0D05DD3D006BFB54 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */,
+ 1D3623260D0F684500981E51 /* ScrollableTabBarAppDelegate.m in Sources */,
+ 28D7ACF80DDB3853001CB0EB /* ScrollableTabBarViewController.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 75AFA42B12759BD000447113 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = JSScrollableTabBar;
+ targetProxy = 75AFA42A12759BD000447113 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 1D6058940D05DD3E006BFB54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = ScrollableTabBar_Prefix.pch;
+ GCC_VERSION = 4.2;
+ HEADER_SEARCH_PATHS = "$(SRCROOT)/..";
+ INFOPLIST_FILE = "ScrollableTabBar-Info.plist";
+ PRODUCT_NAME = ScrollableTabBar;
+ };
+ name = Debug;
+ };
+ 1D6058950D05DD3E006BFB54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = ScrollableTabBar_Prefix.pch;
+ INFOPLIST_FILE = "ScrollableTabBar-Info.plist";
+ PRODUCT_NAME = ScrollableTabBar;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ SDKROOT = iphoneos4.1;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ PREBINDING = NO;
+ SDKROOT = iphoneos4.1;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ScrollableTabBar" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1D6058940D05DD3E006BFB54 /* Debug */,
+ 1D6058950D05DD3E006BFB54 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScrollableTabBar" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
View
156 Demo/ScrollableTabBarViewController.xib
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">800</int>
+ <string key="IBDocument.SystemVersion">10C540</string>
+ <string key="IBDocument.InterfaceBuilderVersion">759</string>
+ <string key="IBDocument.AppKitVersion">1038.25</string>
+ <string key="IBDocument.HIToolboxVersion">458.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">77</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="6"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="843779117">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="774585933">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{320, 460}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC43NQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="774585933"/>
+ </object>
+ <int key="connectionID">7</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="843779117"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="774585933"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>6.IBEditorWindowLastContentRect</string>
+ <string>6.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>ScrollableTabBarViewController</string>
+ <string>UIResponder</string>
+ <string>{{239, 654}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">7</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ScrollableTabBarViewController</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/ScrollableTabBarViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3100" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">ScrollableTabBar.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">77</string>
+ <nil key="IBCocoaTouchSimulationTargetRuntimeIdentifier"/>
+ </data>
+</archive>
View
8 Demo/ScrollableTabBar_Prefix.pch
@@ -0,0 +1,8 @@
+//
+// Prefix header for all source files of the 'ScrollableTabBar' target in the 'ScrollableTabBar' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+#endif
View
17 Demo/main.m
@@ -0,0 +1,17 @@
+//
+// main.m
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+int main(int argc, char *argv[]) {
+
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ int retVal = UIApplicationMain(argc, argv, nil, nil);
+ [pool release];
+ return retVal;
+}
View
51 JSScrollableTabBar.h
@@ -0,0 +1,51 @@
+//
+// JSScrollableTabBar.h
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "JSTabItem.h"
+
+@class JSScrollableTabBar, JSTabButton;
+
+typedef enum {
+
+ JSScrollableTabBarStyleBlack,
+ JSScrollableTabBarStyleBlue,
+ JSScrollableTabBarStyleTransparent
+
+} JSScrollableTabBarStyle;
+
+@protocol JSScrollableTabBarDelegate <NSObject>
+
+- (void)scrollableTabBar:(JSScrollableTabBar *)tabBar didSelectTabAtIndex:(NSInteger)index;
+
+@end
+
+@interface JSScrollableTabBar : UIView <UIScrollViewDelegate> {
+
+ UIScrollView *_scrollView;
+
+ NSMutableArray *_tabItems;
+
+ JSScrollableTabBarStyle _style;
+
+ UIImageView *_background;
+ UIImageView *_fadeLeft;
+ UIImageView *_fadeRight;
+
+ JSTabButton *_previouslySelectedTabButton;
+
+ id <JSScrollableTabBarDelegate> _delegate;
+}
+
+@property (nonatomic, assign) JSScrollableTabBarStyle style;
+@property (nonatomic, assign) id <JSScrollableTabBarDelegate> delegate;
+
+- (id)initWithFrame:(CGRect)frame style:(JSScrollableTabBarStyle)style;
+- (void)setTabItems:(NSArray *)tabItems;
+
+@end
View
194 JSScrollableTabBar.m
@@ -0,0 +1,194 @@
+//
+// JSScrollableTabBar.m
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+#import "JSScrollableTabBar.h"
+#import "JSTabButton.h"
+
+@interface JSScrollableTabBar ()
+
+- (void)layoutTabs;
+- (void)updateFaders;
+- (void)tabSelected:(id)sender;
+- (void)selectTabAtIndex:(NSInteger)index;
+
+@end
+
+
+@implementation JSScrollableTabBar
+
+@synthesize style = _style;
+@synthesize delegate = _delegate;
+
+- (id)initWithFrame:(CGRect)frame style:(JSScrollableTabBarStyle)style
+{
+ if ((self = [super initWithFrame:frame]))
+ {
+ _tabItems = [[NSMutableArray alloc] init];
+
+ _background = [[UIImageView alloc] initWithFrame:frame];
+ [self addSubview:_background];
+
+ _scrollView = [[UIScrollView alloc] initWithFrame:frame];
+ [_scrollView setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
+ [_scrollView setShowsHorizontalScrollIndicator:NO];
+ [_scrollView setShowsVerticalScrollIndicator:NO];
+ [_scrollView setDelegate:self];
+ [self addSubview:_scrollView];
+
+ _fadeLeft = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
+ _fadeRight = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
+ CGRect fadeFrame = [_fadeRight frame];
+ fadeFrame.origin.x = self.frame.size.width - fadeFrame.size.width;
+ [_fadeRight setFrame:fadeFrame];
+
+ [self addSubview:_fadeLeft];
+ [self addSubview:_fadeRight];
+
+ self.style = style;
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [_tabItems release], _tabItems = nil;
+ [super dealloc];
+}
+
+- (void)setStyle:(JSScrollableTabBarStyle)style
+{
+ _style = style;
+
+ NSString *imageBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"images.bundle"];
+ NSBundle *imageBundle = [NSBundle bundleWithPath:imageBundlePath];
+
+ UIImage *backgroundImage = nil;
+ UIImage *fadeLeft = nil;
+ UIImage *fadeRight = nil;
+
+ switch (self.style)
+ {
+ case JSScrollableTabBarStyleBlue:
+ backgroundImage = [[UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"barBackgroundBlue" ofType:@"png"]] stretchableImageWithLeftCapWidth:1
+ topCapHeight:0];
+ fadeLeft = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"fadeLeft_blue" ofType:@"png"]];
+ fadeRight = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"fadeRight_blue" ofType:@".png"]];
+ break;
+ case JSScrollableTabBarStyleBlack:
+ backgroundImage = [[UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"barBackgroundBlack" ofType:@"png"]] stretchableImageWithLeftCapWidth:1
+ topCapHeight:0];
+ fadeLeft = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"fadeLeft_black" ofType:@"png"]];
+ fadeRight = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"fadeRight_black" ofType:@"png"]];
+ break;
+ case JSScrollableTabBarStyleTransparent:
+ backgroundImage = [[UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"barBackgroundTrans" ofType:@"png"]] stretchableImageWithLeftCapWidth:1
+ topCapHeight:0];
+ fadeLeft = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"fadeLeft_trans" ofType:@"png"]];
+ fadeRight = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"fadeRight_trans" ofType:@"png"]];
+ break;
+ default:
+ break;
+ }
+
+ [_background setImage:backgroundImage];
+ [_fadeLeft setImage:fadeLeft];
+ [_fadeRight setImage:fadeRight];
+}
+
+- (void)setTabItems:(NSArray *)tabItems
+{
+ [_tabItems release];
+ _tabItems = [tabItems mutableCopy];
+
+ [self layoutTabs];
+}
+
+- (void)layoutTabs
+{
+ [[_scrollView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
+
+ CGFloat currentXposition = 4.0;
+ CGFloat padding = 4.0;
+
+ CGFloat overallWidth = 0.0;
+
+ for (JSTabItem *item in _tabItems)
+ {
+ JSTabButton *tabButton = [JSTabButton tabButtonWithTitle:[item title]];
+ [tabButton setTag:[_tabItems indexOfObject:item]];
+ [tabButton addTarget:self
+ action:@selector(tabSelected:)
+ forControlEvents:UIControlEventTouchDown];
+
+ CGRect frame = [tabButton frame];
+ frame.origin.x = currentXposition;
+ frame.origin.y = (self.frame.size.height - frame.size.height) / 2;
+ [tabButton setFrame:frame];
+
+ currentXposition = frame.origin.x + frame.size.width + padding;
+
+ overallWidth += (frame.size.width + padding);
+
+ [_scrollView addSubview:tabButton];
+ }
+
+ [_scrollView setContentSize:CGSizeMake((overallWidth + padding), self.frame.size.height)];
+ [self selectTabAtIndex:0];
+ [self updateFaders];
+}
+
+- (void)updateFaders
+{
+ [UIView beginAnimations:nil context:nil];
+
+ if ([_scrollView contentOffset].x < ([_scrollView contentSize].width - self.frame.size.width))
+ [_fadeRight setAlpha:1.0];
+ else
+ [_fadeRight setAlpha:0.0];
+
+ if ([_scrollView contentOffset].x > 0)
+ [_fadeLeft setAlpha:1.0];
+ else
+ [_fadeLeft setAlpha:0.0];
+
+ [UIView commitAnimations];
+}
+
+- (void)tabSelected:(id)sender
+{
+ JSTabButton *tabButton = (JSTabButton *)sender;
+
+ if ([tabButton isToggled])
+ return;
+
+ [tabButton setToggled:YES];
+
+ [_previouslySelectedTabButton setToggled:NO];
+ _previouslySelectedTabButton = tabButton;
+
+ if ([self.delegate respondsToSelector:@selector(scrollableTabBar:didSelectTabAtIndex:)])
+ {
+ [self.delegate scrollableTabBar:self didSelectTabAtIndex:[tabButton tag]];
+ }
+}
+
+- (void)selectTabAtIndex:(NSInteger)index
+{
+ if (index < 0 || index >= [[_scrollView subviews] count])
+ return;
+
+ JSTabButton *tabButton = [[_scrollView subviews] objectAtIndex:index];
+ [self tabSelected:tabButton];
+}
+
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView
+{
+ [self updateFaders];
+}
+
+@end
View
266 JSScrollableTabBar.xcodeproj/project.pbxproj
@@ -0,0 +1,266 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 75359DCD127598A600614700 /* JSTabButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 75359DC7127598A600614700 /* JSTabButton.h */; };
+ 75359DCE127598A600614700 /* JSTabButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 75359DC8127598A600614700 /* JSTabButton.m */; };
+ 75359DCF127598A600614700 /* JSScrollableTabBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 75359DC9127598A600614700 /* JSScrollableTabBar.h */; };
+ 75359DD0127598A600614700 /* JSScrollableTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 75359DCA127598A600614700 /* JSScrollableTabBar.m */; };
+ 75359DD1127598A600614700 /* JSTabItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 75359DCB127598A600614700 /* JSTabItem.h */; };
+ 75359DD2127598A600614700 /* JSTabItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 75359DCC127598A600614700 /* JSTabItem.m */; };
+ 75359DF61275999100614700 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75359DF51275999100614700 /* CoreGraphics.framework */; };
+ 75359DF81275999100614700 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75359DF71275999100614700 /* QuartzCore.framework */; };
+ 75359DFA1275999100614700 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75359DF91275999100614700 /* UIKit.framework */; };
+ AA747D9F0F9514B9006C5449 /* JSScrollableTabBar_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* JSScrollableTabBar_Prefix.pch */; };
+ AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 75359DC6127598A600614700 /* images.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = images.bundle; sourceTree = "<group>"; };
+ 75359DC7127598A600614700 /* JSTabButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTabButton.h; sourceTree = "<group>"; };
+ 75359DC8127598A600614700 /* JSTabButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSTabButton.m; sourceTree = "<group>"; };
+ 75359DC9127598A600614700 /* JSScrollableTabBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollableTabBar.h; sourceTree = "<group>"; };
+ 75359DCA127598A600614700 /* JSScrollableTabBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSScrollableTabBar.m; sourceTree = "<group>"; };
+ 75359DCB127598A600614700 /* JSTabItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTabItem.h; sourceTree = "<group>"; };
+ 75359DCC127598A600614700 /* JSTabItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSTabItem.m; sourceTree = "<group>"; };
+ 75359DF51275999100614700 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 75359DF71275999100614700 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ 75359DF91275999100614700 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ AA747D9E0F9514B9006C5449 /* JSScrollableTabBar_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollableTabBar_Prefix.pch; sourceTree = SOURCE_ROOT; };
+ AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ D2AAC07E0554694100DB518D /* libJSScrollableTabBar.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libJSScrollableTabBar.a; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D2AAC07C0554694100DB518D /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
+ 75359DF61275999100614700 /* CoreGraphics.framework in Frameworks */,
+ 75359DF81275999100614700 /* QuartzCore.framework in Frameworks */,
+ 75359DFA1275999100614700 /* UIKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 034768DFFF38A50411DB9C8B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D2AAC07E0554694100DB518D /* libJSScrollableTabBar.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 0867D691FE84028FC02AAC07 /* JSScrollableTabBar */ = {
+ isa = PBXGroup;
+ children = (
+ 08FB77AEFE84172EC02AAC07 /* Classes */,
+ 75359DC6127598A600614700 /* images.bundle */,
+ 32C88DFF0371C24200C91783 /* Other Sources */,
+ 0867D69AFE84028FC02AAC07 /* Frameworks */,
+ 034768DFFF38A50411DB9C8B /* Products */,
+ );
+ name = JSScrollableTabBar;
+ sourceTree = "<group>";
+ };
+ 0867D69AFE84028FC02AAC07 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AACBBE490F95108600F1A2B1 /* Foundation.framework */,
+ 75359DF51275999100614700 /* CoreGraphics.framework */,
+ 75359DF71275999100614700 /* QuartzCore.framework */,
+ 75359DF91275999100614700 /* UIKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 08FB77AEFE84172EC02AAC07 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 75359DC9127598A600614700 /* JSScrollableTabBar.h */,
+ 75359DCA127598A600614700 /* JSScrollableTabBar.m */,
+ 75359DCB127598A600614700 /* JSTabItem.h */,
+ 75359DCC127598A600614700 /* JSTabItem.m */,
+ 75359DC7127598A600614700 /* JSTabButton.h */,
+ 75359DC8127598A600614700 /* JSTabButton.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 32C88DFF0371C24200C91783 /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ AA747D9E0F9514B9006C5449 /* JSScrollableTabBar_Prefix.pch */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D2AAC07A0554694100DB518D /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AA747D9F0F9514B9006C5449 /* JSScrollableTabBar_Prefix.pch in Headers */,
+ 75359DCD127598A600614700 /* JSTabButton.h in Headers */,
+ 75359DCF127598A600614700 /* JSScrollableTabBar.h in Headers */,
+ 75359DD1127598A600614700 /* JSTabItem.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D2AAC07D0554694100DB518D /* JSScrollableTabBar */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "JSScrollableTabBar" */;
+ buildPhases = (
+ D2AAC07A0554694100DB518D /* Headers */,
+ D2AAC07B0554694100DB518D /* Sources */,
+ D2AAC07C0554694100DB518D /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = JSScrollableTabBar;
+ productName = JSScrollableTabBar;
+ productReference = D2AAC07E0554694100DB518D /* libJSScrollableTabBar.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 0867D690FE84028FC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ ORGANIZATIONNAME = JamSoft;
+ };
+ buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "JSScrollableTabBar" */;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 0867D691FE84028FC02AAC07 /* JSScrollableTabBar */;
+ productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D2AAC07D0554694100DB518D /* JSScrollableTabBar */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D2AAC07B0554694100DB518D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 75359DCE127598A600614700 /* JSTabButton.m in Sources */,
+ 75359DD0127598A600614700 /* JSScrollableTabBar.m in Sources */,
+ 75359DD2127598A600614700 /* JSTabItem.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1DEB921F08733DC00010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ COPY_PHASE_STRIP = NO;
+ DSTROOT = /tmp/JSScrollableTabBar.dst;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = JSScrollableTabBar_Prefix.pch;
+ INSTALL_PATH = /usr/local/lib;
+ PRODUCT_NAME = JSScrollableTabBar;
+ };
+ name = Debug;
+ };
+ 1DEB922008733DC00010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ DSTROOT = /tmp/JSScrollableTabBar.dst;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = JSScrollableTabBar_Prefix.pch;
+ INSTALL_PATH = /usr/local/lib;
+ PRODUCT_NAME = JSScrollableTabBar;
+ };
+ name = Release;
+ };
+ 1DEB922308733DC00010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PREBINDING = NO;
+ SDKROOT = iphoneos4.1;
+ };
+ name = Debug;
+ };
+ 1DEB922408733DC00010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ OTHER_LDFLAGS = "-ObjC";
+ PREBINDING = NO;
+ SDKROOT = iphoneos4.1;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "JSScrollableTabBar" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB921F08733DC00010E9CD /* Debug */,
+ 1DEB922008733DC00010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "JSScrollableTabBar" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB922308733DC00010E9CD /* Debug */,
+ 1DEB922408733DC00010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
+}
View
7 JSScrollableTabBar_Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project.
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+#endif
View
26 JSTabButton.h
@@ -0,0 +1,26 @@
+//
+// TRPNTokenButton.h
+// TokenTest
+//
+// Created by James Addyman on 29/04/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface JSTabButton : UIButton {
+
+ BOOL _toggled;
+
+ UIImage *_normalBg;
+ UIImage *_highlightedBg;
+}
+
+@property (nonatomic, getter=isToggled) BOOL toggled;
+
+@property (nonatomic, retain) UIImage *normalBg;
+@property (nonatomic, retain) UIImage *highlightedBg;
+
++ (JSTabButton *)tabButtonWithTitle:(NSString *)string;
+
+@end
View
85 JSTabButton.m
@@ -0,0 +1,85 @@
+//
+// TRPNTokenButton.m
+// TokenTest
+//
+// Created by James Addyman on 29/04/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import "JSTabButton.h"
+
+@implementation JSTabButton
+
+@synthesize toggled = _toggled;
+@synthesize normalBg = _normalBg;
+@synthesize highlightedBg = _highlightedBg;
+
++ (JSTabButton *)tabButtonWithTitle:(NSString *)string
+{
+ NSString *imageBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"images.bundle"];
+ NSBundle *imageBundle = [NSBundle bundleWithPath:imageBundlePath];
+
+ static UIImage *normalButton = nil;
+ static UIImage *highlightedButton = nil;
+
+ if (!normalButton)
+ {
+ NSLog(@"setting normal button");
+ normalButton = [[UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"tabButtonNormal" ofType:@"png"]] stretchableImageWithLeftCapWidth:14 topCapHeight:0];
+ }
+
+ if (!highlightedButton)
+ {
+ NSLog(@"setting Highlighted button");
+ highlightedButton = [[UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"tabButtonHighlighted" ofType:@"png"]] stretchableImageWithLeftCapWidth:14 topCapHeight:0];
+ }
+
+ JSTabButton *button = (JSTabButton *)[self buttonWithType:UIButtonTypeCustom];
+ [button setNormalBg:normalButton];
+ [button setHighlightedBg:highlightedButton];
+ [button setAdjustsImageWhenHighlighted:NO];
+ [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+ [[button titleLabel] setFont:[UIFont fontWithName:@"Helvetica-Bold" size:14]];
+ [button setTitleShadowColor:[UIColor whiteColor] forState:UIControlStateNormal];
+ [[button titleLabel] setShadowOffset:CGSizeMake(0.0, 0.5)];
+ [[button titleLabel] setLineBreakMode:UILineBreakModeTailTruncation];
+ [button setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 10)];
+
+ [button setTitle:string forState:UIControlStateNormal];
+
+ [button sizeToFit];
+ CGRect frame = [button frame];
+ frame.size.width += 20;
+ frame.size.height = 25;
+ [button setFrame:frame];
+
+ [button setToggled:NO];
+
+ return button;
+}
+
+- (void)setToggled:(BOOL)toggled
+{
+ _toggled = toggled;
+
+ if (_toggled)
+ {
+ [self setBackgroundImage:self.highlightedBg forState:UIControlStateNormal];
+ [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+ }
+ else
+ {
+ [self setBackgroundImage:self.normalBg forState:UIControlStateNormal];
+ [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+ }
+}
+
+- (void)dealloc
+{
+ self.highlightedBg = nil;
+ self.normalBg = nil;
+ [super dealloc];
+}
+
+
+@end
View
22 JSTabItem.h
@@ -0,0 +1,22 @@
+//
+// JSTabItem.h
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface JSTabItem : NSObject {
+
+ NSString *_title;
+
+}
+
+@property (nonatomic, copy) NSString *title;
+
+- (id)initWithTitle:(NSString *)title;
+
+@end
View
32 JSTabItem.m
@@ -0,0 +1,32 @@
+//
+// JSTabItem.m
+// ScrollableTabBar
+//
+// Created by James Addyman on 20/10/2010.
+// Copyright 2010 JamSoft. All rights reserved.
+//
+
+#import "JSTabItem.h"
+
+
+@implementation JSTabItem
+
+@synthesize title = _title;
+
+- (id)initWithTitle:(NSString *)title
+{
+ if ((self = [super init]))
+ {
+ self.title = title;
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ self.title = nil;
+ [super dealloc];
+}
+
+@end
View
BIN images.bundle/barBackgroundBlack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/barBackgroundBlack@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/barBackgroundBlue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/barBackgroundBlue@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/barBackgroundTrans.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/barBackgroundTrans@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeLeft_black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeLeft_black@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeLeft_blue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeLeft_blue@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeLeft_trans.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeLeft_trans@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeRight_black.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeRight_black@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeRight_blue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeRight_blue@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeRight_trans.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/fadeRight_trans@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/tabButtonHighlighted.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/tabButtonHighlighted@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/tabButtonNormal.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images.bundle/tabButtonNormal@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 28a51de

Please sign in to comment.