├── ExpandyButton_Prefix.pch ├── Classes ├── ViewController.h ├── AppDelegate.h ├── ExpandyButton │ ├── ExpandyButton.h │ └── ExpandyButton.m ├── AppDelegate.m └── ViewController.m ├── main.m ├── ExpandyButton-Info.plist ├── MainWindow.xib ├── ExpandyButton.xcodeproj └── project.pbxproj └── ViewController.xib /ExpandyButton_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ExpandyButton' target in the 'ExpandyButton' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif -------------------------------------------------------------------------------- /Classes/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import 7 | #import 8 | 9 | @interface ViewController : UIViewController 10 | 11 | @end -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import 7 | 8 | int main(int argc, char *argv[]) { 9 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 10 | int retVal = UIApplicationMain(argc, argv, nil, nil); 11 | [pool release]; 12 | return retVal; 13 | } -------------------------------------------------------------------------------- /Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import 7 | 8 | @class ViewController; 9 | 10 | @interface AppDelegate : NSObject { 11 | UIWindow *window; 12 | ViewController *viewController; 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | @property (nonatomic, retain) IBOutlet ViewController *viewController; 17 | 18 | @end -------------------------------------------------------------------------------- /Classes/ExpandyButton/ExpandyButton.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface ExpandyButton : UIButton { 5 | @private 6 | BOOL _expanded; 7 | UILabel *_titleLabel; 8 | CGRect _frameExpanded; 9 | CGRect _frameShrunk; 10 | CGFloat _buttonWidth; 11 | NSInteger _selectedItem; 12 | NSArray *_labels; 13 | } 14 | 15 | - (id)initWithPoint:(CGPoint)point title:(NSString *)title buttonNames:(NSArray *)buttonNames selectedItem:(NSInteger)selectedItem; 16 | - (id)initWithPoint:(CGPoint)point title:(NSString *)title buttonNames:(NSArray *)buttonNames; 17 | 18 | @property (nonatomic,readonly,retain) UILabel *titleLabel; 19 | @property (nonatomic,readonly,retain) NSArray *labels; 20 | @property (nonatomic,assign) NSInteger selectedItem; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import "AppDelegate.h" 7 | #import "ViewController.h" 8 | 9 | @implementation AppDelegate 10 | 11 | @synthesize window; 12 | @synthesize viewController; 13 | 14 | #pragma mark - 15 | #pragma mark Application lifecycle 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 18 | // Override point for customization after application launch. 19 | 20 | // Set the view controller as the window's root view controller and display. 21 | self.window.rootViewController = self.viewController; 22 | [self.window makeKeyAndVisible]; 23 | 24 | return YES; 25 | } 26 | 27 | #pragma mark - 28 | #pragma mark Memory management 29 | 30 | - (void)dealloc { 31 | [viewController release]; 32 | [window release]; 33 | [super dealloc]; 34 | } 35 | 36 | @end -------------------------------------------------------------------------------- /ExpandyButton-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.github.iosdeveloper.expandybutton 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /Classes/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // Created by http://github.com/iosdeveloper 4 | // 5 | 6 | #import "ViewController.h" 7 | #import "ExpandyButton.h" 8 | 9 | @implementation ViewController 10 | 11 | - (void)toggleFlashlight:(id)sender { 12 | AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; 13 | 14 | [device lockForConfiguration:nil]; 15 | [device setTorchMode:[(ExpandyButton *)sender selectedItem]]; 16 | [device unlockForConfiguration]; 17 | } 18 | 19 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | 23 | [[self view] setBackgroundColor:[UIColor blackColor]]; 24 | 25 | AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; 26 | 27 | if ([device hasTorch]) { 28 | ExpandyButton *torchModeButton = [[[ExpandyButton alloc] initWithPoint:CGPointMake(20.0, 20.0) 29 | title:@"Flash" 30 | buttonNames:[NSArray arrayWithObjects:@"Off", @"On", @"Auto", nil] 31 | selectedItem:[device torchMode]] autorelease]; 32 | [torchModeButton addTarget:self action:@selector(toggleFlashlight:) forControlEvents:UIControlEventValueChanged]; 33 | [torchModeButton setHidden:NO]; 34 | 35 | [[self view] addSubview:torchModeButton]; 36 | } 37 | } 38 | 39 | @end -------------------------------------------------------------------------------- /Classes/ExpandyButton/ExpandyButton.m: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | */ 5 | 6 | #import "ExpandyButton.h" 7 | #import 8 | 9 | // Measurements 10 | static Boolean gInitMeasurements = false; 11 | static CGFloat gWidth = 47.f; 12 | static CGFloat gFrameHeight = 32.f; 13 | static CGFloat gTitleXOrigin = 8.f; 14 | static CGFloat gTitleYOrigin = 9.f; 15 | static CGFloat gTitleHeight = 15.f; 16 | static CGFloat gTitleWidth = 35.f; 17 | static CGFloat gButtonHeight = 26.f; 18 | static CGFloat gLabelHeight = 39.f; 19 | static CGFloat gLabelXOrigin = 45.f; 20 | static CGFloat gLabelYOrigin = -3.f; 21 | static CGFloat gDefaultButtonWidth = 44.f; 22 | static CGFloat gFontSize = 12.f; 23 | 24 | // HUD Appearance 25 | static CGFloat gLayerWhite = 1.f; 26 | static CGFloat gLayerAlpha = .2f; 27 | static CGFloat gBorderWhite = .0f; 28 | static CGFloat gBorderAlpha = 1.f; 29 | static CGFloat gBorderWidth = 1.f; 30 | 31 | 32 | @interface ExpandyButton () 33 | 34 | @property (nonatomic,assign) BOOL expanded; 35 | @property (nonatomic,assign) CGRect frameExpanded; 36 | @property (nonatomic,assign) CGRect frameShrunk; 37 | @property (nonatomic,assign) CGFloat buttonWidth; 38 | @property (nonatomic,retain) UILabel *titleLabel; 39 | @property (nonatomic,retain) NSArray *labels; 40 | 41 | @end 42 | 43 | @implementation ExpandyButton 44 | 45 | @synthesize expanded = _expanded; 46 | @synthesize frameExpanded = _frameExpanded; 47 | @synthesize frameShrunk = _frameShrunk; 48 | @synthesize buttonWidth = _buttonWidth; 49 | @synthesize titleLabel = _titleLabel; 50 | @synthesize labels = _labels; 51 | @dynamic selectedItem; 52 | 53 | - (id)initWithPoint:(CGPoint)point title:(NSString *)title buttonNames:(NSArray *)buttonNames selectedItem:(NSInteger)selectedItem 54 | { 55 | if (!gInitMeasurements) { 56 | gInitMeasurements = true; 57 | const Boolean isIPad = ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPhone); 58 | if (isIPad) { 59 | gWidth = 93.f; 60 | gFrameHeight = 64.f; 61 | gTitleXOrigin = 16.f; 62 | gTitleYOrigin = 18.f; 63 | gTitleHeight = 30.f; 64 | gTitleWidth = 75.f; 65 | gButtonHeight = 52.f; 66 | gLabelHeight = 78.f; 67 | gLabelXOrigin = 86.f; 68 | gLabelYOrigin = -6.f; 69 | gDefaultButtonWidth = 100.f; 70 | gFontSize = 24.f; 71 | 72 | gBorderWidth = 2.f; 73 | } 74 | } 75 | 76 | 77 | CGRect frameShrunk = CGRectMake(point.x, point.y, gWidth + gDefaultButtonWidth, gFrameHeight); 78 | CGRect frameExpanded = CGRectMake(point.x, point.y, gWidth + gDefaultButtonWidth * [buttonNames count], gFrameHeight); 79 | if ((self = [super initWithFrame:frameShrunk])) { 80 | [self setFrameShrunk:frameShrunk]; 81 | [self setFrameExpanded:frameExpanded]; 82 | [self setButtonWidth:gDefaultButtonWidth]; 83 | 84 | UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(gTitleXOrigin, gTitleYOrigin, gTitleWidth, gTitleHeight)]; 85 | [titleLabel setText:title]; 86 | [titleLabel setFont:[UIFont systemFontOfSize:gFontSize]]; 87 | [titleLabel setTextColor:[UIColor blackColor]]; 88 | [titleLabel setBackgroundColor:[UIColor clearColor]]; 89 | [self addSubview:titleLabel]; 90 | [self setTitleLabel:titleLabel]; 91 | [titleLabel release]; 92 | 93 | NSMutableArray *labels = [[NSMutableArray alloc] initWithCapacity:3]; 94 | NSInteger index = 0; 95 | UILabel *label; 96 | for (NSString *buttonName in buttonNames) { 97 | label = [[UILabel alloc] initWithFrame:CGRectMake(gLabelXOrigin + (gDefaultButtonWidth * index), gLabelYOrigin, gDefaultButtonWidth, gButtonHeight)]; 98 | [label setText:buttonName]; 99 | [label setFont:[UIFont systemFontOfSize:gFontSize]]; 100 | [label setTextColor:[UIColor blackColor]]; 101 | [label setBackgroundColor:[UIColor clearColor]]; 102 | [label setTextAlignment:UITextAlignmentCenter]; 103 | [self addSubview:label]; 104 | [labels addObject:label]; 105 | [label release]; 106 | index += 1; 107 | } 108 | 109 | [self setLabels:labels]; 110 | [labels release]; 111 | 112 | [self addTarget:self action:@selector(chooseLabel:forEvent:) forControlEvents:UIControlEventTouchUpInside]; 113 | [self setBackgroundColor:[UIColor clearColor]]; 114 | 115 | CALayer *layer = [self layer]; 116 | [layer setBackgroundColor:[[UIColor colorWithWhite:gLayerWhite alpha:gLayerAlpha] CGColor]]; 117 | [layer setBorderWidth:gBorderWidth]; 118 | [layer setBorderColor:[[UIColor colorWithWhite:gBorderWhite alpha:gBorderAlpha] CGColor]]; 119 | [layer setCornerRadius:15.f]; 120 | 121 | [self setExpanded:YES]; 122 | [self setHidden:YES]; 123 | 124 | [self setSelectedItem:selectedItem]; 125 | } 126 | return self; 127 | } 128 | 129 | - (id)initWithPoint:(CGPoint)point title:(NSString *)title buttonNames:(NSArray *)buttonNames 130 | { 131 | return [self initWithPoint:point title:title buttonNames:buttonNames selectedItem:0]; 132 | } 133 | 134 | - (void)chooseLabel:(id)sender forEvent:(UIEvent *)event 135 | { 136 | [UIView beginAnimations:nil context:NULL]; 137 | if ([self expanded] == NO) { 138 | [self setExpanded:YES]; 139 | 140 | NSInteger index = 0; 141 | for (UILabel *label in [self labels]) { 142 | if (index == [self selectedItem]) { 143 | [label setFont:[UIFont boldSystemFontOfSize:gFontSize]]; 144 | } else { 145 | [label setTextColor:[UIColor colorWithWhite:0.f alpha:.8f]]; 146 | } 147 | [label setFrame:CGRectMake(gLabelXOrigin + ([self buttonWidth] * index), gLabelYOrigin, [self buttonWidth], gLabelHeight)]; 148 | index += 1; 149 | } 150 | 151 | [[self layer] setFrame:[self frameExpanded]]; 152 | } else { 153 | BOOL inside = NO; 154 | 155 | NSInteger index = 0; 156 | for (UILabel *label in [self labels]) { 157 | if ([label pointInside:[[[event allTouches] anyObject] locationInView:label] withEvent:event]) { 158 | [label setFrame:CGRectMake(gLabelXOrigin, gLabelYOrigin, [self buttonWidth], gLabelHeight)]; 159 | inside = YES; 160 | break; 161 | } 162 | index += 1; 163 | } 164 | 165 | if (inside) { 166 | [self setSelectedItem:index]; 167 | } 168 | } 169 | [UIView commitAnimations]; 170 | } 171 | 172 | - (NSInteger)selectedItem 173 | { 174 | return _selectedItem; 175 | } 176 | 177 | - (void)setSelectedItem:(NSInteger)selectedItem 178 | { 179 | if (selectedItem < [[self labels] count]) { 180 | CGRect leftShrink = CGRectMake(gLabelXOrigin, gLabelYOrigin, 0.f, gLabelHeight); 181 | CGRect rightShrink = CGRectMake(gLabelXOrigin + [self buttonWidth], gLabelYOrigin, 0.f, gLabelHeight); 182 | CGRect middleExpanded = CGRectMake(gLabelXOrigin, gLabelYOrigin, [self buttonWidth], gLabelHeight); 183 | NSInteger count = 0; 184 | BOOL expanded = [self expanded]; 185 | 186 | if (expanded) { 187 | [UIView beginAnimations:nil context:NULL]; 188 | } 189 | 190 | for (UILabel *label in [self labels]) { 191 | if (count < selectedItem) { 192 | [label setFrame:leftShrink]; 193 | [label setFont:[UIFont systemFontOfSize:gFontSize]]; 194 | } else if (count > selectedItem) { 195 | [label setFrame:rightShrink]; 196 | [label setFont:[UIFont systemFontOfSize:gFontSize]]; 197 | } else if (count == selectedItem) { 198 | [label setFrame:middleExpanded]; 199 | [label setFont:[UIFont systemFontOfSize:gFontSize]]; 200 | [label setTextColor:[UIColor blackColor]]; 201 | } 202 | count += 1; 203 | } 204 | 205 | if (expanded) { 206 | [[self layer] setFrame:[self frameShrunk]]; 207 | [UIView commitAnimations]; 208 | [self setExpanded:NO]; 209 | } 210 | 211 | if (_selectedItem != selectedItem) { 212 | _selectedItem = selectedItem; 213 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 214 | } 215 | } 216 | } 217 | 218 | - (void)dealloc { 219 | [self setTitleLabel:nil]; 220 | [self setLabels:nil]; 221 | [super dealloc]; 222 | } 223 | 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 10J869 6 | 1864 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 865 12 | 13 | 14 | YES 15 | IBUICustomObject 16 | IBUIWindow 17 | IBUIViewController 18 | IBProxyObject 19 | 20 | 21 | YES 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | PluginDependencyRecalculationVersion 26 | 27 | 28 | 29 | YES 30 | 31 | IBFilesOwner 32 | IBCocoaTouchFramework 33 | 34 | 35 | IBFirstResponder 36 | IBCocoaTouchFramework 37 | 38 | 39 | IBCocoaTouchFramework 40 | 41 | 42 | ViewController 43 | 44 | 45 | 1 46 | 1 47 | 48 | IBCocoaTouchFramework 49 | NO 50 | 51 | 52 | 53 | 292 54 | {320, 480} 55 | 56 | 1 57 | MSAxIDEAA 58 | 59 | NO 60 | NO 61 | 62 | IBCocoaTouchFramework 63 | YES 64 | 65 | 66 | 67 | 68 | YES 69 | 70 | 71 | delegate 72 | 73 | 74 | 75 | 4 76 | 77 | 78 | 79 | viewController 80 | 81 | 82 | 83 | 11 84 | 85 | 86 | 87 | window 88 | 89 | 90 | 91 | 14 92 | 93 | 94 | 95 | 96 | YES 97 | 98 | 0 99 | 100 | YES 101 | 102 | 103 | 104 | 105 | 106 | -1 107 | 108 | 109 | File's Owner 110 | 111 | 112 | 3 113 | 114 | 115 | App Delegate 116 | 117 | 118 | -2 119 | 120 | 121 | 122 | 123 | 10 124 | 125 | 126 | 127 | 128 | 12 129 | 130 | 131 | 132 | 133 | 134 | 135 | YES 136 | 137 | YES 138 | -1.CustomClassName 139 | -1.IBPluginDependency 140 | -2.CustomClassName 141 | -2.IBPluginDependency 142 | 10.CustomClassName 143 | 10.IBPluginDependency 144 | 12.IBPluginDependency 145 | 3.CustomClassName 146 | 3.IBPluginDependency 147 | 148 | 149 | YES 150 | UIApplication 151 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 152 | UIResponder 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | ViewController 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 157 | AppDelegate 158 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 159 | 160 | 161 | 162 | YES 163 | 164 | 165 | 166 | 167 | 168 | YES 169 | 170 | 171 | 172 | 173 | 15 174 | 175 | 176 | 177 | YES 178 | 179 | AppDelegate 180 | NSObject 181 | 182 | YES 183 | 184 | YES 185 | viewController 186 | window 187 | 188 | 189 | YES 190 | ViewController 191 | UIWindow 192 | 193 | 194 | 195 | YES 196 | 197 | YES 198 | viewController 199 | window 200 | 201 | 202 | YES 203 | 204 | viewController 205 | ViewController 206 | 207 | 208 | window 209 | UIWindow 210 | 211 | 212 | 213 | 214 | IBProjectSource 215 | ./Classes/AppDelegate.h 216 | 217 | 218 | 219 | ViewController 220 | UIViewController 221 | 222 | IBProjectSource 223 | ./Classes/ViewController.h 224 | 225 | 226 | 227 | 228 | 0 229 | IBCocoaTouchFramework 230 | 231 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 232 | 233 | 234 | YES 235 | 3 236 | 865 237 | 238 | 239 | -------------------------------------------------------------------------------- /ExpandyButton.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; 11 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 12 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 13 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 14 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; 15 | 2899E5220DE3E06400AC0155 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* ViewController.xib */; }; 16 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 17 | 28D7ACF80DDB3853001CB0EB /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* ViewController.m */; }; 18 | 365391EE13A18AF50066E8A4 /* ExpandyButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 365391ED13A18AF50066E8A4 /* ExpandyButton.m */; }; 19 | 3653920713A18B860066E8A4 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3653920613A18B860066E8A4 /* QuartzCore.framework */; }; 20 | 3653929913A18CD90066E8A4 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3653929813A18CD90066E8A4 /* AVFoundation.framework */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 25 | 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | 1D6058910D05DD3D006BFB54 /* ExpandyButton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExpandyButton.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 30 | 2899E5210DE3E06400AC0155 /* ViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ViewController.xib; sourceTree = ""; }; 31 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 32 | 28D7ACF60DDB3853001CB0EB /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 33 | 28D7ACF70DDB3853001CB0EB /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 34 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | 32CA4F630368D1EE00C91783 /* ExpandyButton_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpandyButton_Prefix.pch; sourceTree = ""; }; 36 | 365391EC13A18AF50066E8A4 /* ExpandyButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpandyButton.h; sourceTree = ""; }; 37 | 365391ED13A18AF50066E8A4 /* ExpandyButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExpandyButton.m; sourceTree = ""; }; 38 | 3653920613A18B860066E8A4 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 39 | 3653929813A18CD90066E8A4 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 40 | 8D1107310486CEB800E47090 /* ExpandyButton-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ExpandyButton-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 41 | /* End PBXFileReference section */ 42 | 43 | /* Begin PBXFrameworksBuildPhase section */ 44 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 49 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 50 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, 51 | 3653920713A18B860066E8A4 /* QuartzCore.framework in Frameworks */, 52 | 3653929913A18CD90066E8A4 /* AVFoundation.framework in Frameworks */, 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 080E96DDFE201D6D7F000001 /* Classes */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 365391E113A18AED0066E8A4 /* ExpandyButton */, 63 | 1D3623240D0F684500981E51 /* AppDelegate.h */, 64 | 1D3623250D0F684500981E51 /* AppDelegate.m */, 65 | 28D7ACF60DDB3853001CB0EB /* ViewController.h */, 66 | 28D7ACF70DDB3853001CB0EB /* ViewController.m */, 67 | ); 68 | path = Classes; 69 | sourceTree = ""; 70 | }; 71 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 1D6058910D05DD3D006BFB54 /* ExpandyButton.app */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 080E96DDFE201D6D7F000001 /* Classes */, 83 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 84 | 29B97317FDCFA39411CA2CEA /* Resources */, 85 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 86 | 19C28FACFE9D520D11CA2CBB /* Products */, 87 | ); 88 | name = CustomTemplate; 89 | sourceTree = ""; 90 | }; 91 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 32CA4F630368D1EE00C91783 /* ExpandyButton_Prefix.pch */, 95 | 29B97316FDCFA39411CA2CEA /* main.m */, 96 | ); 97 | name = "Other Sources"; 98 | sourceTree = ""; 99 | }; 100 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 2899E5210DE3E06400AC0155 /* ViewController.xib */, 104 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 105 | 8D1107310486CEB800E47090 /* ExpandyButton-Info.plist */, 106 | ); 107 | name = Resources; 108 | sourceTree = ""; 109 | }; 110 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 3653929813A18CD90066E8A4 /* AVFoundation.framework */, 114 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */, 115 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 116 | 3653920613A18B860066E8A4 /* QuartzCore.framework */, 117 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 118 | ); 119 | name = Frameworks; 120 | sourceTree = ""; 121 | }; 122 | 365391E113A18AED0066E8A4 /* ExpandyButton */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 365391EC13A18AF50066E8A4 /* ExpandyButton.h */, 126 | 365391ED13A18AF50066E8A4 /* ExpandyButton.m */, 127 | ); 128 | path = ExpandyButton; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | 1D6058900D05DD3D006BFB54 /* ExpandyButton */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ExpandyButton" */; 137 | buildPhases = ( 138 | 1D60588D0D05DD3D006BFB54 /* Resources */, 139 | 1D60588E0D05DD3D006BFB54 /* Sources */, 140 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = ExpandyButton; 147 | productName = ExpandyButton; 148 | productReference = 1D6058910D05DD3D006BFB54 /* ExpandyButton.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | /* End PBXNativeTarget section */ 152 | 153 | /* Begin PBXProject section */ 154 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 155 | isa = PBXProject; 156 | attributes = { 157 | LastUpgradeCheck = 0420; 158 | }; 159 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ExpandyButton" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = English; 162 | hasScannedForEncodings = 1; 163 | knownRegions = ( 164 | English, 165 | Japanese, 166 | French, 167 | German, 168 | ); 169 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 1D6058900D05DD3D006BFB54 /* ExpandyButton */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 184 | 2899E5220DE3E06400AC0155 /* ViewController.xib in Resources */, 185 | ); 186 | runOnlyForDeploymentPostprocessing = 0; 187 | }; 188 | /* End PBXResourcesBuildPhase section */ 189 | 190 | /* Begin PBXSourcesBuildPhase section */ 191 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 192 | isa = PBXSourcesBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 196 | 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, 197 | 28D7ACF80DDB3853001CB0EB /* ViewController.m in Sources */, 198 | 365391EE13A18AF50066E8A4 /* ExpandyButton.m in Sources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXSourcesBuildPhase section */ 203 | 204 | /* Begin XCBuildConfiguration section */ 205 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 206 | isa = XCBuildConfiguration; 207 | buildSettings = { 208 | ALWAYS_SEARCH_USER_PATHS = NO; 209 | COPY_PHASE_STRIP = NO; 210 | GCC_DYNAMIC_NO_PIC = NO; 211 | GCC_OPTIMIZATION_LEVEL = 0; 212 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 213 | GCC_PREFIX_HEADER = ExpandyButton_Prefix.pch; 214 | INFOPLIST_FILE = "ExpandyButton-Info.plist"; 215 | PRODUCT_NAME = ExpandyButton; 216 | }; 217 | name = Debug; 218 | }; 219 | 1D6058950D05DD3E006BFB54 /* Release */ = { 220 | isa = XCBuildConfiguration; 221 | buildSettings = { 222 | ALWAYS_SEARCH_USER_PATHS = NO; 223 | COPY_PHASE_STRIP = YES; 224 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 225 | GCC_PREFIX_HEADER = ExpandyButton_Prefix.pch; 226 | INFOPLIST_FILE = "ExpandyButton-Info.plist"; 227 | PRODUCT_NAME = ExpandyButton; 228 | VALIDATE_PRODUCT = YES; 229 | }; 230 | name = Release; 231 | }; 232 | C01FCF4F08A954540054247B /* Debug */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 236 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 237 | GCC_C_LANGUAGE_STANDARD = c99; 238 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 240 | GCC_WARN_UNUSED_VARIABLE = YES; 241 | SDKROOT = iphoneos; 242 | }; 243 | name = Debug; 244 | }; 245 | C01FCF5008A954540054247B /* Release */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 249 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 250 | GCC_C_LANGUAGE_STANDARD = c99; 251 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 252 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 253 | GCC_WARN_UNUSED_VARIABLE = YES; 254 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 255 | SDKROOT = iphoneos; 256 | }; 257 | name = Release; 258 | }; 259 | /* End XCBuildConfiguration section */ 260 | 261 | /* Begin XCConfigurationList section */ 262 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ExpandyButton" */ = { 263 | isa = XCConfigurationList; 264 | buildConfigurations = ( 265 | 1D6058940D05DD3E006BFB54 /* Debug */, 266 | 1D6058950D05DD3E006BFB54 /* Release */, 267 | ); 268 | defaultConfigurationIsVisible = 0; 269 | defaultConfigurationName = Release; 270 | }; 271 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ExpandyButton" */ = { 272 | isa = XCConfigurationList; 273 | buildConfigurations = ( 274 | C01FCF4F08A954540054247B /* Debug */, 275 | C01FCF5008A954540054247B /* Release */, 276 | ); 277 | defaultConfigurationIsVisible = 0; 278 | defaultConfigurationName = Release; 279 | }; 280 | /* End XCConfigurationList section */ 281 | }; 282 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 283 | } 284 | -------------------------------------------------------------------------------- /ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J869 6 | 851 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 141 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | {320, 460} 44 | 45 | 46 | 3 47 | MC43NQA 48 | 49 | 2 50 | 51 | 52 | NO 53 | 54 | IBCocoaTouchFramework 55 | 56 | 57 | 58 | 59 | YES 60 | 61 | 62 | view 63 | 64 | 65 | 66 | 7 67 | 68 | 69 | 70 | 71 | YES 72 | 73 | 0 74 | 75 | 76 | 77 | 78 | 79 | -1 80 | 81 | 82 | File's Owner 83 | 84 | 85 | -2 86 | 87 | 88 | 89 | 90 | 6 91 | 92 | 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | YES 100 | -1.CustomClassName 101 | -2.CustomClassName 102 | 6.IBEditorWindowLastContentRect 103 | 6.IBPluginDependency 104 | 105 | 106 | YES 107 | ViewController 108 | UIResponder 109 | {{239, 556}, {320, 480}} 110 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 111 | 112 | 113 | 114 | YES 115 | 116 | 117 | YES 118 | 119 | 120 | 121 | 122 | YES 123 | 124 | 125 | YES 126 | 127 | 128 | 129 | 7 130 | 131 | 132 | 133 | YES 134 | 135 | ViewController 136 | UIViewController 137 | 138 | IBProjectSource 139 | Classes/ViewController.h 140 | 141 | 142 | 143 | 144 | YES 145 | 146 | NSObject 147 | 148 | IBFrameworkSource 149 | Foundation.framework/Headers/NSError.h 150 | 151 | 152 | 153 | NSObject 154 | 155 | IBFrameworkSource 156 | Foundation.framework/Headers/NSFileManager.h 157 | 158 | 159 | 160 | NSObject 161 | 162 | IBFrameworkSource 163 | Foundation.framework/Headers/NSKeyValueCoding.h 164 | 165 | 166 | 167 | NSObject 168 | 169 | IBFrameworkSource 170 | Foundation.framework/Headers/NSKeyValueObserving.h 171 | 172 | 173 | 174 | NSObject 175 | 176 | IBFrameworkSource 177 | Foundation.framework/Headers/NSKeyedArchiver.h 178 | 179 | 180 | 181 | NSObject 182 | 183 | IBFrameworkSource 184 | Foundation.framework/Headers/NSObject.h 185 | 186 | 187 | 188 | NSObject 189 | 190 | IBFrameworkSource 191 | Foundation.framework/Headers/NSRunLoop.h 192 | 193 | 194 | 195 | NSObject 196 | 197 | IBFrameworkSource 198 | Foundation.framework/Headers/NSThread.h 199 | 200 | 201 | 202 | NSObject 203 | 204 | IBFrameworkSource 205 | Foundation.framework/Headers/NSURL.h 206 | 207 | 208 | 209 | NSObject 210 | 211 | IBFrameworkSource 212 | Foundation.framework/Headers/NSURLConnection.h 213 | 214 | 215 | 216 | NSObject 217 | 218 | IBFrameworkSource 219 | UIKit.framework/Headers/UIAccessibility.h 220 | 221 | 222 | 223 | NSObject 224 | 225 | IBFrameworkSource 226 | UIKit.framework/Headers/UINibLoading.h 227 | 228 | 229 | 230 | NSObject 231 | 232 | IBFrameworkSource 233 | UIKit.framework/Headers/UIResponder.h 234 | 235 | 236 | 237 | UIResponder 238 | NSObject 239 | 240 | 241 | 242 | UISearchBar 243 | UIView 244 | 245 | IBFrameworkSource 246 | UIKit.framework/Headers/UISearchBar.h 247 | 248 | 249 | 250 | UISearchDisplayController 251 | NSObject 252 | 253 | IBFrameworkSource 254 | UIKit.framework/Headers/UISearchDisplayController.h 255 | 256 | 257 | 258 | UIView 259 | 260 | IBFrameworkSource 261 | UIKit.framework/Headers/UIPrintFormatter.h 262 | 263 | 264 | 265 | UIView 266 | 267 | IBFrameworkSource 268 | UIKit.framework/Headers/UITextField.h 269 | 270 | 271 | 272 | UIView 273 | UIResponder 274 | 275 | IBFrameworkSource 276 | UIKit.framework/Headers/UIView.h 277 | 278 | 279 | 280 | UIViewController 281 | 282 | IBFrameworkSource 283 | UIKit.framework/Headers/UINavigationController.h 284 | 285 | 286 | 287 | UIViewController 288 | 289 | IBFrameworkSource 290 | UIKit.framework/Headers/UIPopoverController.h 291 | 292 | 293 | 294 | UIViewController 295 | 296 | IBFrameworkSource 297 | UIKit.framework/Headers/UISplitViewController.h 298 | 299 | 300 | 301 | UIViewController 302 | 303 | IBFrameworkSource 304 | UIKit.framework/Headers/UITabBarController.h 305 | 306 | 307 | 308 | UIViewController 309 | UIResponder 310 | 311 | IBFrameworkSource 312 | UIKit.framework/Headers/UIViewController.h 313 | 314 | 315 | 316 | 317 | 0 318 | IBCocoaTouchFramework 319 | 320 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 321 | 322 | 323 | 324 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 325 | 326 | 327 | YES 328 | ExpandyButton.xcodeproj 329 | 3 330 | 141 331 | 332 | 333 | --------------------------------------------------------------------------------