├── PickerSamplePad ├── PickerSamplePad_Prefix.pch ├── Classes │ ├── PickerSampleTableViewController.h │ ├── PickerSamplePadAppDelegate.h │ ├── PickerSamplePadViewController.h │ ├── PickerSamplePadAppDelegate.m │ ├── PickerSampleTableViewController.m │ └── PickerSamplePadViewController.m ├── main.m ├── PickerSamplePad-Info.plist ├── PickerSamplePad.xcodeproj │ └── project.pbxproj ├── MainWindow.xib └── PickerSamplePadViewController.xib ├── .gitignore ├── InfColorPicker.xcworkspace └── contents.xcworkspacedata ├── InfColorPicker ├── InfColorIndicatorView.h ├── InfSourceColorView.h ├── InfColorBarPicker.h ├── InfColorPickerNavigationController.h ├── InfColorSquarePicker.h ├── InfColorPickerController.h ├── InfColorPickerNavigationController.m ├── InfColorPicker.h ├── InfHSBSupport.h ├── InfColorIndicatorView.m ├── InfSourceColorView.m ├── InfColorBarPicker.m ├── InfColorSquarePicker.m ├── InfHSBSupport.m └── InfColorPickerController.m ├── PickerSamplePhone ├── main.m ├── Classes │ ├── PickerSamplePhoneViewController.h │ ├── PickerSamplePhoneAppDelegate.h │ ├── PickerSamplePhoneAppDelegate.m │ └── PickerSamplePhoneViewController.m ├── PickerSamplePhone-Info.plist ├── PickerSamplePhoneViewController.xib ├── PickerSamplePhone.xcodeproj │ └── project.pbxproj └── MainWindow.xib ├── LICENSE.txt └── README.markdown /PickerSamplePad/PickerSamplePad_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'PickerSamplePad' target in the 'PickerSamplePad' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OS X 2 | *.DS_Store 3 | 4 | # Xcode 5 | *.pbxuser 6 | *.mode1v3 7 | *.mode2v3 8 | *.perspectivev3 9 | *.xcuserstate 10 | *.xccheckout 11 | project.xcworkspace/ 12 | xcuserdata/ 13 | 14 | # Generated files 15 | *.[oa] 16 | 17 | # Hg 18 | .hg* 19 | 20 | # Backup files 21 | *~.nib -------------------------------------------------------------------------------- /InfColorPicker.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PickerSamplePad/Classes/PickerSampleTableViewController.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSampleTableViewController.h 4 | // PickerSamplePad 5 | // 6 | // Created by Troy Gaul on 9/7/11. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | #import "InfColorPicker.h" 16 | 17 | @interface PickerSampleTableViewController : UITableViewController 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorIndicatorView.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorIndicatorView.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/10/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | @interface InfColorIndicatorView : UIView 18 | 19 | @property (nonatomic) UIColor* color; 20 | 21 | @end 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /InfColorPicker/InfSourceColorView.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfSourceColorView.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/10/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | @interface InfSourceColorView : UIControl 18 | 19 | @property (nonatomic) BOOL trackingInside; 20 | 21 | @end 22 | 23 | //------------------------------------------------------------------------------ 24 | -------------------------------------------------------------------------------- /PickerSamplePad/main.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // main.m 4 | // PickerSamplePad 5 | // 6 | // Created by Troy Gaul on 8/17/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | int main(int argc, char* argv[]) 18 | { 19 | @autoreleasepool { 20 | int retVal = UIApplicationMain(argc, argv, nil, nil); 21 | return retVal; 22 | } 23 | } 24 | 25 | //------------------------------------------------------------------------------ 26 | -------------------------------------------------------------------------------- /PickerSamplePhone/main.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // main.m 4 | // PickerSamplePhone 5 | // 6 | // Created by Troy Gaul on 8/12/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | int main(int argc, char* argv[]) 18 | { 19 | @autoreleasepool { 20 | int retVal = UIApplicationMain(argc, argv, nil, nil); 21 | 22 | return retVal; 23 | } 24 | } 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /PickerSamplePhone/Classes/PickerSamplePhoneViewController.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePhoneViewController.h 4 | // PickerSamplePhone 5 | // 6 | // Created by Troy Gaul on 8/12/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | #import "InfColorPickerController.h" 16 | 17 | //------------------------------------------------------------------------------ 18 | 19 | @interface PickerSamplePhoneViewController : UIViewController 20 | 21 | - (IBAction) changeBackgroundColor; 22 | 23 | @end 24 | 25 | //------------------------------------------------------------------------------ 26 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorBarPicker.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorBarPicker.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/9/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | @interface InfColorBarView : UIView 18 | 19 | @end 20 | 21 | //------------------------------------------------------------------------------ 22 | 23 | @interface InfColorBarPicker : UIControl 24 | 25 | @property (nonatomic) float value; 26 | 27 | @end 28 | 29 | //------------------------------------------------------------------------------ 30 | -------------------------------------------------------------------------------- /PickerSamplePad/Classes/PickerSamplePadAppDelegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePadAppDelegate.h 4 | // PickerSamplePad 5 | // 6 | // Created by Troy Gaul on 8/17/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | @class PickerSamplePadViewController; 16 | 17 | //------------------------------------------------------------------------------ 18 | 19 | @interface PickerSamplePadAppDelegate : NSObject< UIApplicationDelegate > 20 | 21 | @property (nonatomic) IBOutlet UIWindow* window; 22 | @property (nonatomic) IBOutlet PickerSamplePadViewController* viewController; 23 | 24 | @end 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorPickerNavigationController.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorPickerNavigationController.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 11 Dec 2013. 7 | // 8 | // Copyright (c) 2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | // This navigation controller subclass forwards orientation requests to 17 | // the top view controller hosted within it so that it can choose to limit 18 | // the orientations it is displayed in. 19 | 20 | @interface InfColorPickerNavigationController : UINavigationController 21 | 22 | @end 23 | 24 | //------------------------------------------------------------------------------ 25 | -------------------------------------------------------------------------------- /PickerSamplePhone/Classes/PickerSamplePhoneAppDelegate.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePhoneAppDelegate.h 4 | // PickerSamplePhone 5 | // 6 | // Created by Troy Gaul on 8/12/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | @class PickerSamplePhoneViewController; 16 | 17 | //------------------------------------------------------------------------------ 18 | 19 | @interface PickerSamplePhoneAppDelegate : NSObject 20 | 21 | @property (nonatomic) IBOutlet UIWindow* window; 22 | @property (nonatomic) IBOutlet PickerSamplePhoneViewController* viewController; 23 | 24 | @end 25 | 26 | //------------------------------------------------------------------------------ 27 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorSquarePicker.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorSquarePicker.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/9/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | @interface InfColorSquareView : UIImageView 18 | 19 | @property (nonatomic) float hue; 20 | 21 | @end 22 | 23 | //------------------------------------------------------------------------------ 24 | 25 | @interface InfColorSquarePicker : UIControl 26 | 27 | @property (nonatomic) float hue; 28 | @property (nonatomic) CGPoint value; 29 | 30 | @end 31 | 32 | //------------------------------------------------------------------------------ 33 | -------------------------------------------------------------------------------- /PickerSamplePhone/PickerSamplePhone-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | HSB Sample 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.infinitapps.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.1 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /PickerSamplePad/Classes/PickerSamplePadViewController.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePadViewController.h 4 | // PickerSamplePad 5 | // 6 | // Created by Troy Gaul on 8/17/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | #import "InfColorPicker.h" 16 | 17 | //------------------------------------------------------------------------------ 18 | 19 | @interface PickerSamplePadViewController : UIViewController 22 | 23 | - (IBAction) takeUpdateLive: (id) sender; 24 | - (IBAction) changeColor: (id) sender; 25 | - (IBAction) showColorTable: (id) sender; 26 | 27 | @end 28 | 29 | //------------------------------------------------------------------------------ 30 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by InfinitApps LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /PickerSamplePad/Classes/PickerSamplePadAppDelegate.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePadAppDelegate.m 4 | // PickerSamplePad 5 | // 6 | // Created by Troy Gaul on 8/17/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "PickerSamplePadAppDelegate.h" 14 | #import "PickerSamplePadViewController.h" 15 | 16 | //------------------------------------------------------------------------------ 17 | 18 | @implementation PickerSamplePadAppDelegate 19 | 20 | //------------------------------------------------------------------------------ 21 | 22 | @synthesize window; 23 | @synthesize viewController; 24 | 25 | //------------------------------------------------------------------------------ 26 | 27 | - (BOOL) application: (UIApplication*) application didFinishLaunchingWithOptions: (NSDictionary*) launchOptions 28 | { 29 | [window setRootViewController: viewController]; 30 | [window makeKeyAndVisible]; 31 | 32 | return YES; 33 | } 34 | 35 | //------------------------------------------------------------------------------ 36 | 37 | @end 38 | 39 | //------------------------------------------------------------------------------ 40 | -------------------------------------------------------------------------------- /PickerSamplePad/PickerSamplePad-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.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.1 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationPortraitUpsideDown 33 | UIInterfaceOrientationLandscapeLeft 34 | UIInterfaceOrientationLandscapeRight 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /PickerSamplePhone/Classes/PickerSamplePhoneAppDelegate.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePhoneAppDelegate.m 4 | // PickerSamplePhone 5 | // 6 | // Created by Troy Gaul on 8/12/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "PickerSamplePhoneAppDelegate.h" 14 | 15 | #import "PickerSamplePhoneViewController.h" 16 | 17 | //============================================================================== 18 | 19 | @implementation PickerSamplePhoneAppDelegate 20 | 21 | //------------------------------------------------------------------------------ 22 | 23 | @synthesize window; 24 | @synthesize viewController; 25 | 26 | //------------------------------------------------------------------------------ 27 | 28 | - (BOOL) application: (UIApplication*) application 29 | didFinishLaunchingWithOptions: (NSDictionary*) launchOptions 30 | { 31 | [window setRootViewController: viewController]; 32 | [window makeKeyAndVisible]; 33 | 34 | return YES; 35 | } 36 | 37 | //------------------------------------------------------------------------------ 38 | 39 | 40 | //------------------------------------------------------------------------------ 41 | 42 | @end 43 | 44 | //============================================================================== 45 | -------------------------------------------------------------------------------- /PickerSamplePhone/Classes/PickerSamplePhoneViewController.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePhoneViewController.m 4 | // PickerSamplePhone 5 | // 6 | // Created by Troy Gaul on 8/12/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "PickerSamplePhoneViewController.h" 14 | 15 | #import "InfColorPicker.h" 16 | 17 | //------------------------------------------------------------------------------ 18 | 19 | @implementation PickerSamplePhoneViewController 20 | 21 | //------------------------------------------------------------------------------ 22 | 23 | - (IBAction) changeBackgroundColor 24 | { 25 | InfColorPickerController* picker = [InfColorPickerController colorPickerViewController]; 26 | 27 | picker.sourceColor = self.view.backgroundColor; 28 | picker.delegate = self; 29 | 30 | [picker presentModallyOverViewController: self]; 31 | } 32 | 33 | //------------------------------------------------------------------------------ 34 | 35 | - (void) colorPickerControllerDidFinish: (InfColorPickerController*) picker 36 | { 37 | self.view.backgroundColor = picker.resultColor; 38 | 39 | [self dismissModalViewControllerAnimated: YES]; 40 | } 41 | 42 | //------------------------------------------------------------------------------ 43 | 44 | @end 45 | 46 | //------------------------------------------------------------------------------ 47 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorPickerController.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorPickerController.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 7 Aug 2010. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | @protocol InfColorPickerControllerDelegate; 16 | 17 | //------------------------------------------------------------------------------ 18 | 19 | @interface InfColorPickerController : UIViewController 20 | 21 | // Public API: 22 | 23 | + (InfColorPickerController*) colorPickerViewController; 24 | + (CGSize) idealSizeForViewInPopover; 25 | 26 | - (void) presentModallyOverViewController: (UIViewController*) controller; 27 | 28 | @property (nonatomic) UIColor* sourceColor; 29 | @property (nonatomic) UIColor* resultColor; 30 | 31 | @property (weak, nonatomic) id delegate; 32 | 33 | @end 34 | 35 | //------------------------------------------------------------------------------ 36 | 37 | @protocol InfColorPickerControllerDelegate 38 | 39 | @optional 40 | 41 | - (void) colorPickerControllerDidFinish: (InfColorPickerController*) controller; 42 | // This is only called when the color picker is presented modally. 43 | 44 | - (void) colorPickerControllerDidChangeColor: (InfColorPickerController*) controller; 45 | 46 | @end 47 | 48 | //------------------------------------------------------------------------------ 49 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | The InfinitApps Color Picker, known as InfColorPicker, is a view controller for use in iOS applications to allow the selection of a color from RGB space, but using an HSB representation of that color space to make selection of a color easier for a human. 2 | 3 | ![InfColorPicker Screenshot](http://f.cl.ly/items/0b0X0Z1t2A170E0c3L1R/InfColorPicker.png) 4 | 5 | InfColorPicker is distributed with an MIT license. 6 | 7 | It is ARC-based and supports iPhone OS 5 and later (with one small change it could be made compatible back to iOS 4 if that's necessary). 8 | 9 | Usage 10 | ----- 11 | 12 | The main component is the `InfColorPickerController` class, which can be instantiated and hosted in a few different ways, such as in a popover view controller for the iPad, pushed onto a navigation controller navigation stack, or presented modally on an iPhone. 13 | 14 | The initial color can be set via the property `sourceColor`, which will be shown alongside the user-selected `resultColor` color, and these can be accessed and changed while the color picker is visible. 15 | 16 | In order to receive the selected color(s) back from the controller, you have to have an object that implements one of the methods in the `InfColorPickerControllerDelegate` protocol. 17 | 18 | Example 19 | ------- 20 | 21 | - (void) changeColor 22 | { 23 | InfColorPickerController* picker = [ InfColorPickerController colorPickerViewController ]; 24 | 25 | picker.sourceColor = self.color; 26 | picker.delegate = self; 27 | 28 | [ picker presentModallyOverViewController: self ]; 29 | } 30 | 31 | - (void) colorPickerControllerDidFinish: (InfColorPickerController*) picker 32 | { 33 | self.color = picker.resultColor; 34 | 35 | [ self dismissModalViewControllerAnimated: YES ]; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorPickerNavigationController.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorPickerNavigationController.m 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 11 Dec 2013. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "InfColorPickerNavigationController.h" 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | #if !__has_feature(objc_arc) 18 | #error This file must be compiled with ARC enabled (-fobjc-arc). 19 | #endif 20 | 21 | //============================================================================== 22 | 23 | @implementation InfColorPickerNavigationController 24 | 25 | //------------------------------------------------------------------------------ 26 | 27 | - (BOOL) shouldAutorotate 28 | { 29 | return [self.topViewController shouldAutorotate]; 30 | } 31 | 32 | //------------------------------------------------------------------------------ 33 | 34 | - (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation 35 | { 36 | return [self.topViewController shouldAutorotateToInterfaceOrientation: interfaceOrientation]; 37 | } 38 | 39 | //------------------------------------------------------------------------------ 40 | 41 | - (NSUInteger) supportedInterfaceOrientations 42 | { 43 | return self.topViewController.supportedInterfaceOrientations; 44 | } 45 | 46 | //------------------------------------------------------------------------------ 47 | 48 | @end 49 | 50 | //============================================================================== 51 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorPicker.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorPicker.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 7 Aug 2010. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | /* 13 | 14 | The InfiniApps Color Picker, known as InfColorPicker, is a view controller 15 | for use in iOS applications to allow the selection of a color from RGB space, 16 | but using an HSB representation of that color space to make selection of a 17 | color easier for a human. 18 | 19 | InfColorPicker is distributed with an MIT license. It supports iPhone OS 3.x 20 | as well as iOS 4 and 5. 21 | 22 | Usage 23 | ----- 24 | 25 | The main component is the `InfColorPickerController` class, which can be 26 | instantiated and hosted in a few different ways, such as in a popover view 27 | controller for the iPad, pushed onto a navigation controller navigation 28 | stack, or presented modally on an iPhone. 29 | 30 | The initial color can be set via the property `sourceColor`, which will be 31 | shown alongside the user-selected `resultColor` color, and these can be 32 | accessed and changed while the color picker is visible. 33 | 34 | In order to receive the selected color(s) back from the controller, you have 35 | to have an object that implements one of the methods in the 36 | `InfColorPickerControllerDelegate` protocol. 37 | 38 | Example 39 | ------- 40 | 41 | - (IBAction) changeBackgroundColor 42 | { 43 | InfColorPickerController* picker = [InfColorPickerController colorPickerViewController]; 44 | 45 | picker.sourceColor = self.view.backgroundColor; 46 | picker.delegate = self; 47 | 48 | [picker presentModallyOverViewController: self]; 49 | } 50 | 51 | - (void) colorPickerControllerDidFinish: (InfColorPickerController*) picker 52 | { 53 | self.view.backgroundColor = picker.resultColor; 54 | 55 | [self dismissModalViewControllerAnimated: YES]; 56 | } 57 | 58 | */ 59 | 60 | #import "InfColorPickerController.h" 61 | -------------------------------------------------------------------------------- /InfColorPicker/InfHSBSupport.h: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfHSBSupport.h 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 7 Aug 2010. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | float pin(float minValue, float value, float maxValue); 18 | 19 | //------------------------------------------------------------------------------ 20 | 21 | // These functions convert between an RGB value with components in the 22 | // 0.0f..1.0f range to HSV where Hue is 0 .. 360 and Saturation and 23 | // Value (aka Brightness) are percentages expressed as 0.0f..1.0f. 24 | // 25 | // Note that HSB (B = Brightness) and HSV (V = Value) are interchangeable 26 | // names that mean the same thing. I use V here as it is unambiguous 27 | // relative to the B in RGB, which is Blue. 28 | 29 | void HSVtoRGB(float h, float s, float v, float* r, float* g, float* b); 30 | 31 | void RGBToHSV(float r, float g, float b, float* h, float* s, float* v, 32 | BOOL preserveHS); 33 | 34 | //------------------------------------------------------------------------------ 35 | 36 | CGImageRef createSaturationBrightnessSquareContentImageWithHue(float hue); 37 | // Generates a 256x256 image with the specified constant hue where the 38 | // Saturation and value vary in the X and Y axes respectively. 39 | 40 | //------------------------------------------------------------------------------ 41 | 42 | typedef enum { 43 | InfComponentIndexHue = 0, 44 | InfComponentIndexSaturation = 1, 45 | InfComponentIndexBrightness = 2, 46 | } InfComponentIndex; 47 | 48 | CGImageRef createHSVBarContentImage(InfComponentIndex barComponentIndex, float hsv[3]); 49 | // Generates an image where the specified barComponentIndex (0=H, 1=S, 2=V) 50 | // varies across the x-axis of the 256x1 pixel image and the other components 51 | // remain at the constant value specified in the hsv array. 52 | 53 | //------------------------------------------------------------------------------ 54 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorIndicatorView.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorIndicatorView.m 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/10/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "InfColorIndicatorView.h" 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | #if !__has_feature(objc_arc) 18 | #error This file must be compiled with ARC enabled (-fobjc-arc). 19 | #endif 20 | 21 | //============================================================================== 22 | 23 | @implementation InfColorIndicatorView 24 | 25 | //------------------------------------------------------------------------------ 26 | 27 | - (id) initWithFrame: (CGRect) frame 28 | { 29 | self = [super initWithFrame: frame]; 30 | 31 | if (self) { 32 | self.opaque = NO; 33 | self.userInteractionEnabled = NO; 34 | } 35 | 36 | return self; 37 | } 38 | 39 | //------------------------------------------------------------------------------ 40 | 41 | - (void) setColor: (UIColor*) newColor 42 | { 43 | if (![_color isEqual: newColor]) { 44 | _color = newColor; 45 | 46 | [self setNeedsDisplay]; 47 | } 48 | } 49 | 50 | //------------------------------------------------------------------------------ 51 | 52 | - (void) drawRect: (CGRect) rect 53 | { 54 | CGContextRef context = UIGraphicsGetCurrentContext(); 55 | 56 | CGPoint center = { CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds) }; 57 | CGFloat radius = CGRectGetMidX(self.bounds); 58 | 59 | // Fill it: 60 | 61 | CGContextAddArc(context, center.x, center.y, radius - 1.0f, 0.0f, 2.0f * (float) M_PI, YES); 62 | [self.color setFill]; 63 | CGContextFillPath(context); 64 | 65 | // Stroke it (black transucent, inner): 66 | 67 | CGContextAddArc(context, center.x, center.y, radius - 1.0f, 0.0f, 2.0f * (float) M_PI, YES); 68 | CGContextSetGrayStrokeColor(context, 0.0f, 0.5f); 69 | CGContextSetLineWidth(context, 2.0f); 70 | CGContextStrokePath(context); 71 | 72 | // Stroke it (white, outer): 73 | 74 | CGContextAddArc(context, center.x, center.y, radius - 2.0f, 0.0f, 2.0f * (float) M_PI, YES); 75 | CGContextSetGrayStrokeColor(context, 1.0f, 1.0f); 76 | CGContextSetLineWidth(context, 2.0f); 77 | CGContextStrokePath(context); 78 | } 79 | 80 | //------------------------------------------------------------------------------ 81 | 82 | @end 83 | 84 | //============================================================================== 85 | -------------------------------------------------------------------------------- /InfColorPicker/InfSourceColorView.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfSourceColorView.m 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/10/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "InfSourceColorView.h" 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | #if !__has_feature(objc_arc) 18 | #error This file must be compiled with ARC enabled (-fobjc-arc). 19 | #endif 20 | 21 | //============================================================================== 22 | 23 | @implementation InfSourceColorView 24 | 25 | //------------------------------------------------------------------------------ 26 | #pragma mark UIView overrides 27 | //------------------------------------------------------------------------------ 28 | 29 | - (void) drawRect: (CGRect) rect 30 | { 31 | [super drawRect: rect]; 32 | 33 | if (self.enabled && self.trackingInside) { 34 | CGRect bounds = [self bounds]; 35 | 36 | [[UIColor whiteColor] set]; 37 | CGContextStrokeRectWithWidth(UIGraphicsGetCurrentContext(), 38 | CGRectInset(bounds, 1, 1), 2); 39 | 40 | [[UIColor blackColor] set]; 41 | UIRectFrame(CGRectInset(bounds, 2, 2)); 42 | } 43 | } 44 | 45 | //------------------------------------------------------------------------------ 46 | #pragma mark UIControl overrides 47 | //------------------------------------------------------------------------------ 48 | 49 | - (void) setTrackingInside: (BOOL) newValue 50 | { 51 | if (newValue != _trackingInside) { 52 | _trackingInside = newValue; 53 | [self setNeedsDisplay]; 54 | } 55 | } 56 | 57 | //------------------------------------------------------------------------------ 58 | 59 | - (BOOL) beginTrackingWithTouch: (UITouch*) touch 60 | withEvent: (UIEvent*) event 61 | { 62 | if (self.enabled) { 63 | self.trackingInside = YES; 64 | 65 | return [super beginTrackingWithTouch: touch withEvent: event]; 66 | } 67 | else { 68 | return NO; 69 | } 70 | } 71 | 72 | //------------------------------------------------------------------------------ 73 | 74 | - (BOOL) continueTrackingWithTouch: (UITouch*) touch withEvent: (UIEvent*) event 75 | { 76 | BOOL isTrackingInside = CGRectContainsPoint([self bounds], [touch locationInView: self]); 77 | 78 | self.trackingInside = isTrackingInside; 79 | 80 | return [super continueTrackingWithTouch: touch withEvent: event]; 81 | } 82 | 83 | //------------------------------------------------------------------------------ 84 | 85 | - (void) endTrackingWithTouch: (UITouch*) touch withEvent: (UIEvent*) event 86 | { 87 | self.trackingInside = NO; 88 | 89 | [super endTrackingWithTouch: touch withEvent: event]; 90 | } 91 | 92 | //------------------------------------------------------------------------------ 93 | 94 | - (void) cancelTrackingWithEvent: (UIEvent*) event 95 | { 96 | self.trackingInside = NO; 97 | 98 | [super cancelTrackingWithEvent: event]; 99 | } 100 | 101 | //------------------------------------------------------------------------------ 102 | 103 | @end 104 | 105 | //============================================================================== 106 | -------------------------------------------------------------------------------- /PickerSamplePad/Classes/PickerSampleTableViewController.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSampleTableViewController.m 4 | // PickerSamplePad 5 | // 6 | // Created by Troy Gaul on 9/7/11. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "PickerSampleTableViewController.h" 14 | 15 | //============================================================================== 16 | 17 | @implementation PickerSampleTableViewController { 18 | NSMutableArray* colors; 19 | int pickingColorIndex; 20 | } 21 | 22 | //------------------------------------------------------------------------------ 23 | #pragma mark - View lifecycle 24 | //------------------------------------------------------------------------------ 25 | 26 | - (void) viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | 30 | if (colors == nil) { 31 | colors = [NSMutableArray array]; 32 | 33 | [colors addObject: [UIColor blackColor]]; 34 | [colors addObject: [UIColor redColor]]; 35 | [colors addObject: [UIColor greenColor]]; 36 | } 37 | 38 | self.contentSizeForViewInPopover = [InfColorPickerController idealSizeForViewInPopover]; 39 | } 40 | 41 | //------------------------------------------------------------------------------ 42 | 43 | - (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation 44 | { 45 | return YES; 46 | } 47 | 48 | //------------------------------------------------------------------------------ 49 | #pragma mark - Table view data source 50 | //------------------------------------------------------------------------------ 51 | 52 | - (NSInteger) tableView: (UITableView*) tableView numberOfRowsInSection: (NSInteger) section 53 | { 54 | return colors.count; 55 | } 56 | 57 | //------------------------------------------------------------------------------ 58 | 59 | - (UITableViewCell*) tableView: (UITableView*) tableView cellForRowAtIndexPath: (NSIndexPath*) indexPath 60 | { 61 | static NSString* CellIdentifier = @"Cell"; 62 | 63 | UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier]; 64 | 65 | if (cell == nil) { 66 | cell = [[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault 67 | reuseIdentifier: CellIdentifier]; 68 | } 69 | 70 | // Configure the cell: 71 | 72 | if (indexPath.row < colors.count) // just a sanity test 73 | cell.textLabel.textColor = colors[indexPath.row]; 74 | 75 | cell.textLabel.text = [NSString stringWithFormat: @"Color # %d", indexPath.row + 1]; 76 | 77 | return cell; 78 | } 79 | 80 | //------------------------------------------------------------------------------ 81 | #pragma mark - Table view delegate 82 | //------------------------------------------------------------------------------ 83 | 84 | - (void) tableView: (UITableView*) tableView didSelectRowAtIndexPath: (NSIndexPath*) indexPath 85 | { 86 | UITableViewCell* cell = [self.tableView cellForRowAtIndexPath: indexPath]; 87 | 88 | pickingColorIndex = indexPath.row; 89 | 90 | InfColorPickerController* picker = [InfColorPickerController colorPickerViewController]; 91 | 92 | picker.sourceColor = colors[pickingColorIndex]; 93 | picker.delegate = self; 94 | picker.navigationItem.title = cell.textLabel.text; 95 | 96 | [self.navigationController pushViewController: picker animated: YES]; 97 | } 98 | 99 | //------------------------------------------------------------------------------ 100 | #pragma mark - InfColorPickerControllerDelegate 101 | //------------------------------------------------------------------------------ 102 | 103 | - (void) colorPickerControllerDidChangeColor: (InfColorPickerController*) controller 104 | { 105 | NSUInteger indexes[2] = { 0, pickingColorIndex }; 106 | NSIndexPath* indexPath = [NSIndexPath indexPathWithIndexes: indexes length: 2]; 107 | UITableViewCell* cell = [self.tableView cellForRowAtIndexPath: indexPath]; 108 | 109 | colors[pickingColorIndex] = controller.resultColor; 110 | 111 | cell.textLabel.textColor = controller.resultColor; 112 | } 113 | 114 | //------------------------------------------------------------------------------ 115 | 116 | @end 117 | 118 | //============================================================================== 119 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorBarPicker.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorBarPicker.m 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/9/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "InfColorBarPicker.h" 14 | 15 | #import "InfColorIndicatorView.h" 16 | #import "InfHSBSupport.h" 17 | 18 | //------------------------------------------------------------------------------ 19 | 20 | #if !__has_feature(objc_arc) 21 | #error This file must be compiled with ARC enabled (-fobjc-arc). 22 | #endif 23 | 24 | //------------------------------------------------------------------------------ 25 | 26 | #define kContentInsetX 20 27 | 28 | //============================================================================== 29 | 30 | @implementation InfColorBarView 31 | 32 | //------------------------------------------------------------------------------ 33 | 34 | static CGImageRef createContentImage() 35 | { 36 | float hsv[] = { 0.0f, 1.0f, 1.0f }; 37 | return createHSVBarContentImage(InfComponentIndexHue, hsv); 38 | } 39 | 40 | //------------------------------------------------------------------------------ 41 | 42 | - (void) drawRect: (CGRect) rect 43 | { 44 | CGImageRef image = createContentImage(); 45 | 46 | if (image) { 47 | CGContextRef context = UIGraphicsGetCurrentContext(); 48 | 49 | CGContextDrawImage(context, [self bounds], image); 50 | 51 | CGImageRelease(image); 52 | } 53 | } 54 | 55 | //------------------------------------------------------------------------------ 56 | 57 | @end 58 | 59 | //============================================================================== 60 | 61 | @implementation InfColorBarPicker { 62 | InfColorIndicatorView* indicator; 63 | } 64 | 65 | //------------------------------------------------------------------------------ 66 | #pragma mark Drawing 67 | //------------------------------------------------------------------------------ 68 | 69 | - (void) layoutSubviews 70 | { 71 | if (indicator == nil) { 72 | CGFloat kIndicatorSize = 24.0f; 73 | indicator = [[InfColorIndicatorView alloc] initWithFrame: CGRectMake(0, 0, kIndicatorSize, kIndicatorSize)]; 74 | [self addSubview: indicator]; 75 | } 76 | 77 | indicator.color = [UIColor colorWithHue: self.value 78 | saturation: 1.0f 79 | brightness: 1.0f 80 | alpha: 1.0f]; 81 | 82 | CGFloat indicatorLoc = kContentInsetX + (self.value * (self.bounds.size.width - 2 * kContentInsetX)); 83 | indicator.center = CGPointMake(indicatorLoc, CGRectGetMidY(self.bounds)); 84 | } 85 | 86 | //------------------------------------------------------------------------------ 87 | #pragma mark Properties 88 | //------------------------------------------------------------------------------ 89 | 90 | - (void) setValue: (float) newValue 91 | { 92 | if (newValue != _value) { 93 | _value = newValue; 94 | 95 | [self sendActionsForControlEvents: UIControlEventValueChanged]; 96 | [self setNeedsLayout]; 97 | } 98 | } 99 | 100 | //------------------------------------------------------------------------------ 101 | #pragma mark Tracking 102 | //------------------------------------------------------------------------------ 103 | 104 | - (void) trackIndicatorWithTouch: (UITouch*) touch 105 | { 106 | float percent = ([touch locationInView: self].x - kContentInsetX) 107 | / (self.bounds.size.width - 2 * kContentInsetX); 108 | 109 | self.value = pin(0.0f, percent, 1.0f); 110 | } 111 | 112 | //------------------------------------------------------------------------------ 113 | 114 | - (BOOL) beginTrackingWithTouch: (UITouch*) touch 115 | withEvent: (UIEvent*) event 116 | { 117 | [self trackIndicatorWithTouch: touch]; 118 | 119 | return YES; 120 | } 121 | 122 | //------------------------------------------------------------------------------ 123 | 124 | - (BOOL) continueTrackingWithTouch: (UITouch*) touch 125 | withEvent: (UIEvent*) event 126 | { 127 | [self trackIndicatorWithTouch: touch]; 128 | 129 | return YES; 130 | } 131 | 132 | //------------------------------------------------------------------------------ 133 | #pragma mark Accessibility 134 | //------------------------------------------------------------------------------ 135 | 136 | - (UIAccessibilityTraits) accessibilityTraits 137 | { 138 | UIAccessibilityTraits t = super.accessibilityTraits; 139 | 140 | t |= UIAccessibilityTraitAdjustable; 141 | 142 | return t; 143 | } 144 | 145 | //------------------------------------------------------------------------------ 146 | 147 | - (void) accessibilityIncrement 148 | { 149 | float newValue = self.value + 0.05; 150 | 151 | if (newValue > 1.0) 152 | newValue -= 1.0; 153 | 154 | self.value = newValue; 155 | } 156 | 157 | //------------------------------------------------------------------------------ 158 | 159 | - (void) accessibilityDecrement 160 | { 161 | float newValue = self.value - 0.05; 162 | 163 | if (newValue < 0) 164 | newValue += 1.0; 165 | 166 | self.value = newValue; 167 | } 168 | 169 | //------------------------------------------------------------------------------ 170 | 171 | - (NSString*) accessibilityValue 172 | { 173 | return [NSString stringWithFormat: @"%d degrees hue", (int) (self.value * 360.0)]; 174 | } 175 | 176 | //------------------------------------------------------------------------------ 177 | 178 | @end 179 | 180 | //============================================================================== 181 | -------------------------------------------------------------------------------- /PickerSamplePad/Classes/PickerSamplePadViewController.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // PickerSamplePadViewController.m 4 | // PickerSamplePad 5 | // 6 | // Created by Troy Gaul on 8/17/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "PickerSamplePadViewController.h" 14 | 15 | #import "PickerSampleTableViewController.h" 16 | 17 | //============================================================================== 18 | 19 | @implementation PickerSamplePadViewController { 20 | UIPopoverController* activePopover; 21 | BOOL updateLive; 22 | } 23 | 24 | //------------------------------------------------------------------------------ 25 | 26 | - (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation 27 | { 28 | return YES; 29 | } 30 | 31 | //------------------------------------------------------------------------------ 32 | 33 | - (void) applyPickedColor: (InfColorPickerController*) picker 34 | { 35 | self.view.backgroundColor = picker.resultColor; 36 | } 37 | 38 | //------------------------------------------------------------------------------ 39 | #pragma mark UIPopoverControllerDelegate methods 40 | //------------------------------------------------------------------------------ 41 | 42 | - (void) popoverControllerDidDismissPopover: (UIPopoverController*) popoverController 43 | { 44 | if ([popoverController.contentViewController isKindOfClass: [InfColorPickerController class]]) { 45 | InfColorPickerController* picker = (InfColorPickerController*) popoverController.contentViewController; 46 | [self applyPickedColor: picker]; 47 | } 48 | 49 | if (popoverController == activePopover) { 50 | activePopover = nil; 51 | } 52 | } 53 | 54 | //------------------------------------------------------------------------------ 55 | 56 | - (void) showPopover: (UIPopoverController*) popover from: (id) sender 57 | { 58 | popover.delegate = self; 59 | 60 | activePopover = popover; 61 | 62 | if ([sender isKindOfClass: [UIBarButtonItem class]]) { 63 | [activePopover presentPopoverFromBarButtonItem: sender 64 | permittedArrowDirections: UIPopoverArrowDirectionAny 65 | animated: YES]; 66 | } else { 67 | UIView* senderView = sender; 68 | 69 | [activePopover presentPopoverFromRect: [senderView bounds] 70 | inView: senderView 71 | permittedArrowDirections: UIPopoverArrowDirectionAny 72 | animated: YES]; 73 | } 74 | } 75 | 76 | //------------------------------------------------------------------------------ 77 | 78 | - (BOOL) dismissActivePopover 79 | { 80 | if (activePopover) { 81 | [activePopover dismissPopoverAnimated: YES]; 82 | [self popoverControllerDidDismissPopover: activePopover]; 83 | 84 | return YES; 85 | } 86 | 87 | return NO; 88 | } 89 | 90 | //------------------------------------------------------------------------------ 91 | #pragma mark InfHSBColorPickerControllerDelegate methods 92 | //------------------------------------------------------------------------------ 93 | 94 | - (void) colorPickerControllerDidChangeColor: (InfColorPickerController*) picker 95 | { 96 | if (updateLive) 97 | [self applyPickedColor: picker]; 98 | } 99 | 100 | //------------------------------------------------------------------------------ 101 | 102 | - (void) colorPickerControllerDidFinish: (InfColorPickerController*) picker 103 | { 104 | [self applyPickedColor: picker]; 105 | 106 | [activePopover dismissPopoverAnimated: YES]; 107 | } 108 | 109 | //------------------------------------------------------------------------------ 110 | #pragma mark IB actions 111 | //------------------------------------------------------------------------------ 112 | 113 | - (IBAction) takeUpdateLive: (UISwitch*) sender 114 | { 115 | updateLive = [sender isOn]; 116 | } 117 | 118 | //------------------------------------------------------------------------------ 119 | 120 | - (IBAction) finishColorTable 121 | { 122 | [self dismissActivePopover]; 123 | } 124 | 125 | - (IBAction) showColorTable: (id) sender 126 | { 127 | if ([self dismissActivePopover]) 128 | return; 129 | 130 | PickerSampleTableViewController* vc = [[PickerSampleTableViewController alloc] init]; 131 | UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController: vc]; 132 | 133 | nav.navigationBar.barStyle = UIBarStyleBlackOpaque; 134 | 135 | vc.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemDone 136 | target: self 137 | action: @selector(finishColorTable)]; 138 | 139 | UIPopoverController* popover = [[UIPopoverController alloc] initWithContentViewController: nav]; 140 | 141 | [self showPopover: popover from: sender]; 142 | } 143 | 144 | //------------------------------------------------------------------------------ 145 | 146 | - (IBAction) changeColor: (id) sender 147 | { 148 | if ([self dismissActivePopover]) return; 149 | 150 | InfColorPickerController* picker = [InfColorPickerController colorPickerViewController]; 151 | 152 | picker.sourceColor = self.view.backgroundColor; 153 | picker.delegate = self; 154 | 155 | UIPopoverController* popover = [[UIPopoverController alloc] initWithContentViewController: picker]; 156 | 157 | [self showPopover: popover from: sender]; 158 | } 159 | 160 | //------------------------------------------------------------------------------ 161 | 162 | @end 163 | 164 | //============================================================================== 165 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorSquarePicker.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorSquarePicker.m 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 8/9/10. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "InfColorSquarePicker.h" 14 | 15 | #import "InfColorIndicatorView.h" 16 | #import "InfHSBSupport.h" 17 | 18 | //------------------------------------------------------------------------------ 19 | 20 | #if !__has_feature(objc_arc) 21 | #error This file must be compiled with ARC enabled (-fobjc-arc). 22 | #endif 23 | 24 | //------------------------------------------------------------------------------ 25 | 26 | #define kContentInsetX 20 27 | #define kContentInsetY 20 28 | 29 | #define kIndicatorSize 24 30 | 31 | //============================================================================== 32 | 33 | @implementation InfColorSquareView 34 | 35 | //------------------------------------------------------------------------------ 36 | 37 | - (void) updateContent 38 | { 39 | CGImageRef imageRef = createSaturationBrightnessSquareContentImageWithHue(self.hue * 360); 40 | self.image = [UIImage imageWithCGImage: imageRef]; 41 | CGImageRelease(imageRef); 42 | } 43 | 44 | //------------------------------------------------------------------------------ 45 | #pragma mark Properties 46 | //------------------------------------------------------------------------------ 47 | 48 | - (void) setHue: (float) value 49 | { 50 | if (value != _hue || self.image == nil) { 51 | _hue = value; 52 | 53 | [self updateContent]; 54 | } 55 | } 56 | 57 | //------------------------------------------------------------------------------ 58 | 59 | @end 60 | 61 | //============================================================================== 62 | 63 | @implementation InfColorSquarePicker { 64 | InfColorIndicatorView* indicator; 65 | } 66 | 67 | //------------------------------------------------------------------------------ 68 | #pragma mark Appearance 69 | //------------------------------------------------------------------------------ 70 | 71 | - (void) setIndicatorColor 72 | { 73 | if (indicator == nil) 74 | return; 75 | 76 | indicator.color = [UIColor colorWithHue: self.hue 77 | saturation: self.value.x 78 | brightness: self.value.y 79 | alpha: 1.0f]; 80 | } 81 | 82 | //------------------------------------------------------------------------------ 83 | 84 | - (NSString*) spokenValue 85 | { 86 | return [NSString stringWithFormat: @"%d%% saturation, %d%% brightness", 87 | (int) (self.value.x * 100), (int) (self.value.y * 100)]; 88 | } 89 | 90 | //------------------------------------------------------------------------------ 91 | 92 | - (void) layoutSubviews 93 | { 94 | if (indicator == nil) { 95 | CGRect indicatorRect = { CGPointZero, { kIndicatorSize, kIndicatorSize } }; 96 | indicator = [[InfColorIndicatorView alloc] initWithFrame: indicatorRect]; 97 | [self addSubview: indicator]; 98 | } 99 | 100 | [self setIndicatorColor]; 101 | 102 | CGFloat indicatorX = kContentInsetX + (self.value.x * (self.bounds.size.width - 2 * kContentInsetX)); 103 | CGFloat indicatorY = self.bounds.size.height - kContentInsetY 104 | - (self.value.y * (self.bounds.size.height - 2 * kContentInsetY)); 105 | 106 | indicator.center = CGPointMake(indicatorX, indicatorY); 107 | } 108 | 109 | //------------------------------------------------------------------------------ 110 | #pragma mark Properties 111 | //------------------------------------------------------------------------------ 112 | 113 | - (void) setHue: (float) newValue 114 | { 115 | if (newValue != _hue) { 116 | _hue = newValue; 117 | 118 | [self setIndicatorColor]; 119 | } 120 | } 121 | 122 | //------------------------------------------------------------------------------ 123 | 124 | - (void) setValue: (CGPoint) newValue 125 | { 126 | if (!CGPointEqualToPoint(newValue, _value)) { 127 | _value = newValue; 128 | 129 | [self sendActionsForControlEvents: UIControlEventValueChanged]; 130 | [self setNeedsLayout]; 131 | } 132 | } 133 | 134 | //------------------------------------------------------------------------------ 135 | #pragma mark Tracking 136 | //------------------------------------------------------------------------------ 137 | 138 | - (void) trackIndicatorWithTouch: (UITouch*) touch 139 | { 140 | CGRect bounds = self.bounds; 141 | 142 | CGPoint touchValue; 143 | 144 | touchValue.x = ([touch locationInView: self].x - kContentInsetX) 145 | / (bounds.size.width - 2 * kContentInsetX); 146 | 147 | touchValue.y = ([touch locationInView: self].y - kContentInsetY) 148 | / (bounds.size.height - 2 * kContentInsetY); 149 | 150 | touchValue.x = pin(0.0f, touchValue.x, 1.0f); 151 | touchValue.y = 1.0f - pin(0.0f, touchValue.y, 1.0f); 152 | 153 | self.value = touchValue; 154 | } 155 | 156 | //------------------------------------------------------------------------------ 157 | 158 | - (BOOL) beginTrackingWithTouch: (UITouch*) touch 159 | withEvent: (UIEvent*) event 160 | { 161 | [self trackIndicatorWithTouch: touch]; 162 | return YES; 163 | } 164 | 165 | //------------------------------------------------------------------------------ 166 | 167 | - (BOOL) continueTrackingWithTouch: (UITouch*) touch 168 | withEvent: (UIEvent*) event 169 | { 170 | [self trackIndicatorWithTouch: touch]; 171 | return YES; 172 | } 173 | 174 | //------------------------------------------------------------------------------ 175 | 176 | @end 177 | 178 | //============================================================================== 179 | -------------------------------------------------------------------------------- /InfColorPicker/InfHSBSupport.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfHSBSupport.m 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 7 Aug 2010. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "InfHSBSupport.h" 14 | 15 | //------------------------------------------------------------------------------ 16 | 17 | float pin(float minValue, float value, float maxValue) 18 | { 19 | if (minValue > value) 20 | return minValue; 21 | else if (maxValue < value) 22 | return maxValue; 23 | else 24 | return value; 25 | } 26 | 27 | //------------------------------------------------------------------------------ 28 | #pragma mark Floating point conversion 29 | //------------------------------------------------------------------------------ 30 | 31 | static void hueToComponentFactors(float h, float* r, float* g, float* b) 32 | { 33 | float h_prime = h / 60.0f; 34 | float x = 1.0f - fabsf(fmodf(h_prime, 2.0f) - 1.0f); 35 | 36 | if (h_prime < 1.0f) { 37 | *r = 1; 38 | *g = x; 39 | *b = 0; 40 | } 41 | else if (h_prime < 2.0f) { 42 | *r = x; 43 | *g = 1; 44 | *b = 0; 45 | } 46 | else if (h_prime < 3.0f) { 47 | *r = 0; 48 | *g = 1; 49 | *b = x; 50 | } 51 | else if (h_prime < 4.0f) { 52 | *r = 0; 53 | *g = x; 54 | *b = 1; 55 | } 56 | else if (h_prime < 5.0f) { 57 | *r = x; 58 | *g = 0; 59 | *b = 1; 60 | } 61 | else { 62 | *r = 1; 63 | *g = 0; 64 | *b = x; 65 | } 66 | } 67 | 68 | //------------------------------------------------------------------------------ 69 | 70 | void HSVtoRGB(float h, float s, float v, float* r, float* g, float* b) 71 | { 72 | hueToComponentFactors(h, r, g, b); 73 | 74 | float c = v * s; 75 | float m = v - c; 76 | 77 | *r = *r * c + m; 78 | *g = *g * c + m; 79 | *b = *b * c + m; 80 | } 81 | 82 | //------------------------------------------------------------------------------ 83 | 84 | void RGBToHSV(float r, float g, float b, float* h, float* s, float* v, BOOL preserveHS) 85 | { 86 | float max = r; 87 | 88 | if (max < g) 89 | max = g; 90 | 91 | if (max < b) 92 | max = b; 93 | 94 | float min = r; 95 | 96 | if (min > g) 97 | min = g; 98 | 99 | if (min > b) 100 | min = b; 101 | 102 | // Brightness (aka Value) 103 | 104 | *v = max; 105 | 106 | // Saturation 107 | 108 | float sat; 109 | 110 | if (max != 0.0f) { 111 | sat = (max - min) / max; 112 | *s = sat; 113 | } 114 | else { 115 | sat = 0.0f; 116 | 117 | if (!preserveHS) 118 | *s = 0.0f; // Black, so sat is undefined, use 0 119 | } 120 | 121 | // Hue 122 | 123 | float delta; 124 | 125 | if (sat == 0.0f) { 126 | if (!preserveHS) 127 | *h = 0.0f; // No color, so hue is undefined, use 0 128 | } 129 | else { 130 | delta = max - min; 131 | 132 | float hue; 133 | 134 | if (r == max) 135 | hue = (g - b) / delta; 136 | else if (g == max) 137 | hue = 2 + (b - r) / delta; 138 | else 139 | hue = 4 + (r - g) / delta; 140 | 141 | hue /= 6.0f; 142 | 143 | if (hue < 0.0f) 144 | hue += 1.0f; 145 | 146 | if (!preserveHS || fabsf(hue - *h) != 1.0f) 147 | *h = hue; // 0.0 and 1.0 hues are actually both the same (red) 148 | } 149 | } 150 | 151 | //------------------------------------------------------------------------------ 152 | #pragma mark Square/Bar image creation 153 | //------------------------------------------------------------------------------ 154 | 155 | static UInt8 blend(UInt8 value, UInt8 percentIn255) 156 | { 157 | return (UInt8) ((int) value * percentIn255 / 255); 158 | } 159 | 160 | //------------------------------------------------------------------------------ 161 | 162 | static CGContextRef createBGRxImageContext(int w, int h, void* data) 163 | { 164 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 165 | 166 | CGBitmapInfo kBGRxBitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst; 167 | // BGRA is the most efficient on the iPhone. 168 | 169 | CGContextRef context = CGBitmapContextCreate(data, w, h, 8, w * 4, colorSpace, kBGRxBitmapInfo); 170 | 171 | CGColorSpaceRelease(colorSpace); 172 | 173 | return context; 174 | } 175 | 176 | //------------------------------------------------------------------------------ 177 | 178 | CGImageRef createSaturationBrightnessSquareContentImageWithHue(float hue) 179 | { 180 | void* data = malloc(256 * 256 * 4); 181 | if (data == nil) 182 | return nil; 183 | 184 | CGContextRef context = createBGRxImageContext(256, 256, data); 185 | 186 | if (context == nil) { 187 | free(data); 188 | return nil; 189 | } 190 | 191 | UInt8* dataPtr = data; 192 | size_t rowBytes = CGBitmapContextGetBytesPerRow(context); 193 | 194 | float r, g, b; 195 | hueToComponentFactors(hue, &r, &g, &b); 196 | 197 | UInt8 r_s = (UInt8) ((1.0f - r) * 255); 198 | UInt8 g_s = (UInt8) ((1.0f - g) * 255); 199 | UInt8 b_s = (UInt8) ((1.0f - b) * 255); 200 | 201 | for (int s = 0; s < 256; ++s) { 202 | register UInt8* ptr = dataPtr; 203 | 204 | register unsigned int r_hs = 255 - blend(s, r_s); 205 | register unsigned int g_hs = 255 - blend(s, g_s); 206 | register unsigned int b_hs = 255 - blend(s, b_s); 207 | 208 | for (register int v = 255; v >= 0; --v) { 209 | ptr[0] = (UInt8) (v * b_hs >> 8); 210 | ptr[1] = (UInt8) (v * g_hs >> 8); 211 | ptr[2] = (UInt8) (v * r_hs >> 8); 212 | 213 | // Really, these should all be of the form used in blend(), 214 | // which does a divide by 255. However, integer divide is 215 | // implemented in software on ARM, so a divide by 256 216 | // (done as a bit shift) will be *nearly* the same value, 217 | // and is faster. The more-accurate versions would look like: 218 | // ptr[0] = blend(v, b_hs); 219 | 220 | ptr += rowBytes; 221 | } 222 | 223 | dataPtr += 4; 224 | } 225 | 226 | // Return an image of the context's content: 227 | 228 | CGImageRef image = CGBitmapContextCreateImage(context); 229 | 230 | CGContextRelease(context); 231 | free(data); 232 | 233 | return image; 234 | } 235 | 236 | //------------------------------------------------------------------------------ 237 | 238 | CGImageRef createHSVBarContentImage(InfComponentIndex barComponentIndex, float hsv[3]) 239 | { 240 | UInt8 data[256 * 4]; 241 | 242 | // Set up the bitmap context for filling with color: 243 | 244 | CGContextRef context = createBGRxImageContext(256, 1, data); 245 | 246 | if (context == nil) 247 | return nil; 248 | 249 | // Draw into context here: 250 | 251 | UInt8* ptr = CGBitmapContextGetData(context); 252 | if (ptr == nil) { 253 | CGContextRelease(context); 254 | return nil; 255 | } 256 | 257 | float r, g, b; 258 | for (int x = 0; x < 256; ++x) { 259 | hsv[barComponentIndex] = (float) x / 255.0f; 260 | 261 | HSVtoRGB(hsv[0] * 360.0f, hsv[1], hsv[2], &r, &g, &b); 262 | 263 | ptr[0] = (UInt8) (b * 255.0f); 264 | ptr[1] = (UInt8) (g * 255.0f); 265 | ptr[2] = (UInt8) (r * 255.0f); 266 | 267 | ptr += 4; 268 | } 269 | 270 | // Return an image of the context's content: 271 | 272 | CGImageRef image = CGBitmapContextCreateImage(context); 273 | 274 | CGContextRelease(context); 275 | 276 | return image; 277 | } 278 | 279 | //------------------------------------------------------------------------------ 280 | -------------------------------------------------------------------------------- /InfColorPicker/InfColorPickerController.m: -------------------------------------------------------------------------------- 1 | //============================================================================== 2 | // 3 | // InfColorPickerController.m 4 | // InfColorPicker 5 | // 6 | // Created by Troy Gaul on 7 Aug 2010. 7 | // 8 | // Copyright (c) 2011-2013 InfinitApps LLC: http://infinitapps.com 9 | // Some rights reserved: http://opensource.org/licenses/MIT 10 | // 11 | //============================================================================== 12 | 13 | #import "InfColorPickerController.h" 14 | 15 | #import "InfColorBarPicker.h" 16 | #import "InfColorSquarePicker.h" 17 | #import "InfColorPickerNavigationController.h" 18 | #import "InfHSBSupport.h" 19 | 20 | //------------------------------------------------------------------------------ 21 | 22 | #if !__has_feature(objc_arc) 23 | #error This file must be compiled with ARC enabled (-fobjc-arc). 24 | #endif 25 | 26 | //------------------------------------------------------------------------------ 27 | 28 | static void HSVFromUIColor(UIColor* color, float* h, float* s, float* v) 29 | { 30 | CGColorRef colorRef = [color CGColor]; 31 | 32 | const CGFloat* components = CGColorGetComponents(colorRef); 33 | size_t numComponents = CGColorGetNumberOfComponents(colorRef); 34 | 35 | CGFloat r, g, b; 36 | 37 | if (numComponents < 3) { 38 | r = g = b = components[0]; 39 | } 40 | else { 41 | r = components[0]; 42 | g = components[1]; 43 | b = components[2]; 44 | } 45 | 46 | RGBToHSV(r, g, b, h, s, v, YES); 47 | } 48 | 49 | //============================================================================== 50 | 51 | @interface InfColorPickerController () 52 | 53 | @property (nonatomic) IBOutlet InfColorBarView* barView; 54 | @property (nonatomic) IBOutlet InfColorSquareView* squareView; 55 | @property (nonatomic) IBOutlet InfColorBarPicker* barPicker; 56 | @property (nonatomic) IBOutlet InfColorSquarePicker* squarePicker; 57 | @property (nonatomic) IBOutlet UIView* sourceColorView; 58 | @property (nonatomic) IBOutlet UIView* resultColorView; 59 | @property (nonatomic) IBOutlet UINavigationController* navController; 60 | 61 | @end 62 | 63 | //============================================================================== 64 | 65 | @implementation InfColorPickerController { 66 | float _hue; 67 | float _saturation; 68 | float _brightness; 69 | } 70 | 71 | //------------------------------------------------------------------------------ 72 | #pragma mark Class methods 73 | //------------------------------------------------------------------------------ 74 | 75 | + (InfColorPickerController*) colorPickerViewController 76 | { 77 | return [[self alloc] initWithNibName: @"InfColorPickerView" bundle: nil]; 78 | } 79 | 80 | //------------------------------------------------------------------------------ 81 | 82 | + (CGSize) idealSizeForViewInPopover 83 | { 84 | return CGSizeMake(256 + (1 + 20) * 2, 420); 85 | } 86 | 87 | //------------------------------------------------------------------------------ 88 | #pragma mark Creation 89 | //------------------------------------------------------------------------------ 90 | 91 | - (id) initWithNibName: (NSString*) nibNameOrNil bundle: (NSBundle*) nibBundleOrNil 92 | { 93 | self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]; 94 | 95 | if (self) { 96 | self.navigationItem.title = NSLocalizedString(@"Set Color", 97 | @"InfColorPicker default nav item title"); 98 | } 99 | 100 | return self; 101 | } 102 | 103 | //------------------------------------------------------------------------------ 104 | 105 | - (void) presentModallyOverViewController: (UIViewController*) controller 106 | { 107 | UINavigationController* nav = [[InfColorPickerNavigationController alloc] initWithRootViewController: self]; 108 | 109 | nav.navigationBar.barStyle = UIBarStyleBlackOpaque; 110 | 111 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemDone 112 | target: self 113 | action: @selector(done:)]; 114 | 115 | [controller presentViewController: nav animated: YES completion: nil]; 116 | } 117 | 118 | //------------------------------------------------------------------------------ 119 | #pragma mark UIViewController methods 120 | //------------------------------------------------------------------------------ 121 | 122 | - (void) viewDidLoad 123 | { 124 | [super viewDidLoad]; 125 | 126 | self.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 127 | 128 | _barPicker.value = _hue; 129 | _squareView.hue = _hue; 130 | _squarePicker.hue = _hue; 131 | _squarePicker.value = CGPointMake(_saturation, _brightness); 132 | 133 | if (_sourceColor) 134 | _sourceColorView.backgroundColor = _sourceColor; 135 | 136 | if (_resultColor) 137 | _resultColorView.backgroundColor = _resultColor; 138 | } 139 | 140 | //------------------------------------------------------------------------------ 141 | 142 | - (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation 143 | { 144 | return UIInterfaceOrientationIsPortrait(interfaceOrientation); 145 | } 146 | 147 | //------------------------------------------------------------------------------ 148 | 149 | - (NSUInteger) supportedInterfaceOrientations 150 | { 151 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 152 | return UIInterfaceOrientationMaskAll; 153 | else 154 | return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; 155 | } 156 | 157 | //------------------------------------------------------------------------------ 158 | 159 | - (UIRectEdge) edgesForExtendedLayout 160 | { 161 | return UIRectEdgeNone; 162 | } 163 | 164 | //------------------------------------------------------------------------------ 165 | #pragma mark IB actions 166 | //------------------------------------------------------------------------------ 167 | 168 | - (IBAction) takeBarValue: (InfColorBarPicker*) sender 169 | { 170 | _hue = sender.value; 171 | 172 | _squareView.hue = _hue; 173 | _squarePicker.hue = _hue; 174 | 175 | [self updateResultColor]; 176 | } 177 | 178 | //------------------------------------------------------------------------------ 179 | 180 | - (IBAction) takeSquareValue: (InfColorSquarePicker*) sender 181 | { 182 | _saturation = sender.value.x; 183 | _brightness = sender.value.y; 184 | 185 | [self updateResultColor]; 186 | } 187 | 188 | //------------------------------------------------------------------------------ 189 | 190 | - (IBAction) takeBackgroundColor: (UIView*) sender 191 | { 192 | self.resultColor = sender.backgroundColor; 193 | } 194 | 195 | //------------------------------------------------------------------------------ 196 | 197 | - (IBAction) done: (id) sender 198 | { 199 | [self.delegate colorPickerControllerDidFinish: self]; 200 | } 201 | 202 | //------------------------------------------------------------------------------ 203 | #pragma mark Properties 204 | //------------------------------------------------------------------------------ 205 | 206 | - (void) informDelegateDidChangeColor 207 | { 208 | if (self.delegate && [(id) self.delegate respondsToSelector: @selector(colorPickerControllerDidChangeColor:)]) 209 | [self.delegate colorPickerControllerDidChangeColor: self]; 210 | } 211 | 212 | //------------------------------------------------------------------------------ 213 | 214 | - (void) updateResultColor 215 | { 216 | // This is used when code internally causes the update. We do this so that 217 | // we don't cause push-back on the HSV values in case there are rounding 218 | // differences or anything. 219 | 220 | [self willChangeValueForKey: @"resultColor"]; 221 | 222 | _resultColor = [UIColor colorWithHue: _hue 223 | saturation: _saturation 224 | brightness: _brightness 225 | alpha: 1.0f]; 226 | 227 | [self didChangeValueForKey: @"resultColor"]; 228 | 229 | _resultColorView.backgroundColor = _resultColor; 230 | 231 | [self informDelegateDidChangeColor]; 232 | } 233 | 234 | //------------------------------------------------------------------------------ 235 | 236 | - (void) setResultColor: (UIColor*) newValue 237 | { 238 | if (![_resultColor isEqual: newValue]) { 239 | _resultColor = newValue; 240 | 241 | float h = _hue; 242 | HSVFromUIColor(newValue, &h, &_saturation, &_brightness); 243 | 244 | if ((h == 0.0 && _hue == 1.0) || (h == 1.0 && _hue == 0.0)) { 245 | // these are equivalent, so do nothing 246 | } 247 | else if (h != _hue) { 248 | _hue = h; 249 | 250 | _barPicker.value = _hue; 251 | _squareView.hue = _hue; 252 | _squarePicker.hue = _hue; 253 | } 254 | 255 | _squarePicker.value = CGPointMake(_saturation, _brightness); 256 | 257 | _resultColorView.backgroundColor = _resultColor; 258 | 259 | [self informDelegateDidChangeColor]; 260 | } 261 | } 262 | 263 | //------------------------------------------------------------------------------ 264 | 265 | - (void) setSourceColor: (UIColor*) newValue 266 | { 267 | if (![_sourceColor isEqual: newValue]) { 268 | _sourceColor = newValue; 269 | 270 | _sourceColorView.backgroundColor = _sourceColor; 271 | 272 | self.resultColor = newValue; 273 | } 274 | } 275 | 276 | //------------------------------------------------------------------------------ 277 | #pragma mark UIViewController(UIPopoverController) methods 278 | //------------------------------------------------------------------------------ 279 | 280 | - (CGSize) contentSizeForViewInPopover 281 | { 282 | return [[self class] idealSizeForViewInPopover]; 283 | } 284 | 285 | //------------------------------------------------------------------------------ 286 | 287 | @end 288 | 289 | //============================================================================== 290 | -------------------------------------------------------------------------------- /PickerSamplePad/PickerSamplePad.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* PickerSamplePadAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* PickerSamplePadAppDelegate.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 /* PickerSamplePadViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* PickerSamplePadViewController.xib */; }; 16 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 17 | 28D7ACF80DDB3853001CB0EB /* PickerSamplePadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* PickerSamplePadViewController.m */; }; 18 | 6913A78B1858D7EF00A5C092 /* InfColorPickerNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6913A78A1858D7EF00A5C092 /* InfColorPickerNavigationController.m */; }; 19 | 6923F3CE13F4725B0051A217 /* InfColorBarPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3C213F4725B0051A217 /* InfColorBarPicker.m */; }; 20 | 6923F3CF13F4725B0051A217 /* InfColorIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3C413F4725B0051A217 /* InfColorIndicatorView.m */; }; 21 | 6923F3D013F4725B0051A217 /* InfColorPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3C613F4725B0051A217 /* InfColorPickerController.m */; }; 22 | 6923F3D113F4725B0051A217 /* InfColorPickerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6923F3C713F4725B0051A217 /* InfColorPickerView.xib */; }; 23 | 6923F3D213F4725B0051A217 /* InfColorSquarePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3C913F4725B0051A217 /* InfColorSquarePicker.m */; }; 24 | 6923F3D313F4725B0051A217 /* InfHSBSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3CB13F4725B0051A217 /* InfHSBSupport.m */; }; 25 | 6923F3D413F4725B0051A217 /* InfSourceColorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3CD13F4725B0051A217 /* InfSourceColorView.m */; }; 26 | 69F47A2D1417FEE800E29503 /* PickerSampleTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69F47A2C1417FEE800E29503 /* PickerSampleTableViewController.m */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 31 | 1D3623240D0F684500981E51 /* PickerSamplePadAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PickerSamplePadAppDelegate.h; sourceTree = ""; }; 32 | 1D3623250D0F684500981E51 /* PickerSamplePadAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PickerSamplePadAppDelegate.m; sourceTree = ""; }; 33 | 1D6058910D05DD3D006BFB54 /* PickerSamplePad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PickerSamplePad.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 35 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 36 | 2899E5210DE3E06400AC0155 /* PickerSamplePadViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PickerSamplePadViewController.xib; sourceTree = ""; }; 37 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 38 | 28D7ACF60DDB3853001CB0EB /* PickerSamplePadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PickerSamplePadViewController.h; sourceTree = ""; }; 39 | 28D7ACF70DDB3853001CB0EB /* PickerSamplePadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PickerSamplePadViewController.m; sourceTree = ""; }; 40 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 32CA4F630368D1EE00C91783 /* PickerSamplePad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PickerSamplePad_Prefix.pch; sourceTree = ""; }; 42 | 6913A7891858D7EF00A5C092 /* InfColorPickerNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfColorPickerNavigationController.h; sourceTree = ""; }; 43 | 6913A78A1858D7EF00A5C092 /* InfColorPickerNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfColorPickerNavigationController.m; sourceTree = ""; }; 44 | 6923F3C113F4725B0051A217 /* InfColorBarPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfColorBarPicker.h; sourceTree = ""; }; 45 | 6923F3C213F4725B0051A217 /* InfColorBarPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfColorBarPicker.m; sourceTree = ""; }; 46 | 6923F3C313F4725B0051A217 /* InfColorIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfColorIndicatorView.h; sourceTree = ""; }; 47 | 6923F3C413F4725B0051A217 /* InfColorIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfColorIndicatorView.m; sourceTree = ""; }; 48 | 6923F3C513F4725B0051A217 /* InfColorPickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfColorPickerController.h; sourceTree = ""; }; 49 | 6923F3C613F4725B0051A217 /* InfColorPickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfColorPickerController.m; sourceTree = ""; }; 50 | 6923F3C713F4725B0051A217 /* InfColorPickerView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InfColorPickerView.xib; sourceTree = ""; }; 51 | 6923F3C813F4725B0051A217 /* InfColorSquarePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfColorSquarePicker.h; sourceTree = ""; }; 52 | 6923F3C913F4725B0051A217 /* InfColorSquarePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfColorSquarePicker.m; sourceTree = ""; }; 53 | 6923F3CA13F4725B0051A217 /* InfHSBSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfHSBSupport.h; sourceTree = ""; }; 54 | 6923F3CB13F4725B0051A217 /* InfHSBSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfHSBSupport.m; sourceTree = ""; }; 55 | 6923F3CC13F4725B0051A217 /* InfSourceColorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfSourceColorView.h; sourceTree = ""; }; 56 | 6923F3CD13F4725B0051A217 /* InfSourceColorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfSourceColorView.m; sourceTree = ""; }; 57 | 69F47A2A1417E6E200E29503 /* InfColorPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfColorPicker.h; sourceTree = ""; }; 58 | 69F47A2B1417FEE800E29503 /* PickerSampleTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PickerSampleTableViewController.h; sourceTree = ""; }; 59 | 69F47A2C1417FEE800E29503 /* PickerSampleTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PickerSampleTableViewController.m; sourceTree = ""; }; 60 | 8D1107310486CEB800E47090 /* PickerSamplePad-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "PickerSamplePad-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 69 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 70 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 080E96DDFE201D6D7F000001 /* Classes */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 1D3623240D0F684500981E51 /* PickerSamplePadAppDelegate.h */, 81 | 1D3623250D0F684500981E51 /* PickerSamplePadAppDelegate.m */, 82 | 28D7ACF60DDB3853001CB0EB /* PickerSamplePadViewController.h */, 83 | 28D7ACF70DDB3853001CB0EB /* PickerSamplePadViewController.m */, 84 | 69F47A2B1417FEE800E29503 /* PickerSampleTableViewController.h */, 85 | 69F47A2C1417FEE800E29503 /* PickerSampleTableViewController.m */, 86 | ); 87 | path = Classes; 88 | sourceTree = ""; 89 | }; 90 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 1D6058910D05DD3D006BFB54 /* PickerSamplePad.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 080E96DDFE201D6D7F000001 /* Classes */, 102 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 103 | 6923F3C013F4725B0051A217 /* InfColorPicker */, 104 | 29B97317FDCFA39411CA2CEA /* Resources */, 105 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 106 | 19C28FACFE9D520D11CA2CBB /* Products */, 107 | ); 108 | name = CustomTemplate; 109 | sourceTree = ""; 110 | }; 111 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 32CA4F630368D1EE00C91783 /* PickerSamplePad_Prefix.pch */, 115 | 29B97316FDCFA39411CA2CEA /* main.m */, 116 | ); 117 | name = "Other Sources"; 118 | sourceTree = ""; 119 | }; 120 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 2899E5210DE3E06400AC0155 /* PickerSamplePadViewController.xib */, 124 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 125 | 8D1107310486CEB800E47090 /* PickerSamplePad-Info.plist */, 126 | ); 127 | name = Resources; 128 | sourceTree = ""; 129 | }; 130 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 134 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 135 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */, 136 | ); 137 | name = Frameworks; 138 | sourceTree = ""; 139 | }; 140 | 6923F3C013F4725B0051A217 /* InfColorPicker */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 6923F3C113F4725B0051A217 /* InfColorBarPicker.h */, 144 | 6923F3C213F4725B0051A217 /* InfColorBarPicker.m */, 145 | 6923F3C313F4725B0051A217 /* InfColorIndicatorView.h */, 146 | 6923F3C413F4725B0051A217 /* InfColorIndicatorView.m */, 147 | 69F47A2A1417E6E200E29503 /* InfColorPicker.h */, 148 | 6923F3C513F4725B0051A217 /* InfColorPickerController.h */, 149 | 6923F3C613F4725B0051A217 /* InfColorPickerController.m */, 150 | 6913A7891858D7EF00A5C092 /* InfColorPickerNavigationController.h */, 151 | 6913A78A1858D7EF00A5C092 /* InfColorPickerNavigationController.m */, 152 | 6923F3C713F4725B0051A217 /* InfColorPickerView.xib */, 153 | 6923F3C813F4725B0051A217 /* InfColorSquarePicker.h */, 154 | 6923F3C913F4725B0051A217 /* InfColorSquarePicker.m */, 155 | 6923F3CA13F4725B0051A217 /* InfHSBSupport.h */, 156 | 6923F3CB13F4725B0051A217 /* InfHSBSupport.m */, 157 | 6923F3CC13F4725B0051A217 /* InfSourceColorView.h */, 158 | 6923F3CD13F4725B0051A217 /* InfSourceColorView.m */, 159 | ); 160 | name = InfColorPicker; 161 | path = ../InfColorPicker; 162 | sourceTree = ""; 163 | }; 164 | /* End PBXGroup section */ 165 | 166 | /* Begin PBXNativeTarget section */ 167 | 1D6058900D05DD3D006BFB54 /* PickerSamplePad */ = { 168 | isa = PBXNativeTarget; 169 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PickerSamplePad" */; 170 | buildPhases = ( 171 | 1D60588D0D05DD3D006BFB54 /* Resources */, 172 | 1D60588E0D05DD3D006BFB54 /* Sources */, 173 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = PickerSamplePad; 180 | productName = PickerSamplePad; 181 | productReference = 1D6058910D05DD3D006BFB54 /* PickerSamplePad.app */; 182 | productType = "com.apple.product-type.application"; 183 | }; 184 | /* End PBXNativeTarget section */ 185 | 186 | /* Begin PBXProject section */ 187 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 188 | isa = PBXProject; 189 | attributes = { 190 | LastUpgradeCheck = 0500; 191 | }; 192 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PickerSamplePad" */; 193 | compatibilityVersion = "Xcode 3.2"; 194 | developmentRegion = English; 195 | hasScannedForEncodings = 1; 196 | knownRegions = ( 197 | English, 198 | Japanese, 199 | French, 200 | German, 201 | ); 202 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 203 | projectDirPath = ""; 204 | projectRoot = ""; 205 | targets = ( 206 | 1D6058900D05DD3D006BFB54 /* PickerSamplePad */, 207 | ); 208 | }; 209 | /* End PBXProject section */ 210 | 211 | /* Begin PBXResourcesBuildPhase section */ 212 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 213 | isa = PBXResourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 217 | 2899E5220DE3E06400AC0155 /* PickerSamplePadViewController.xib in Resources */, 218 | 6923F3D113F4725B0051A217 /* InfColorPickerView.xib in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXResourcesBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 230 | 1D3623260D0F684500981E51 /* PickerSamplePadAppDelegate.m in Sources */, 231 | 28D7ACF80DDB3853001CB0EB /* PickerSamplePadViewController.m in Sources */, 232 | 6923F3CE13F4725B0051A217 /* InfColorBarPicker.m in Sources */, 233 | 6923F3CF13F4725B0051A217 /* InfColorIndicatorView.m in Sources */, 234 | 6923F3D013F4725B0051A217 /* InfColorPickerController.m in Sources */, 235 | 6923F3D213F4725B0051A217 /* InfColorSquarePicker.m in Sources */, 236 | 6923F3D313F4725B0051A217 /* InfHSBSupport.m in Sources */, 237 | 6913A78B1858D7EF00A5C092 /* InfColorPickerNavigationController.m in Sources */, 238 | 6923F3D413F4725B0051A217 /* InfSourceColorView.m in Sources */, 239 | 69F47A2D1417FEE800E29503 /* PickerSampleTableViewController.m in Sources */, 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | /* End PBXSourcesBuildPhase section */ 244 | 245 | /* Begin XCBuildConfiguration section */ 246 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | COPY_PHASE_STRIP = NO; 250 | GCC_DYNAMIC_NO_PIC = NO; 251 | GCC_OPTIMIZATION_LEVEL = 0; 252 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 253 | GCC_PREFIX_HEADER = PickerSamplePad_Prefix.pch; 254 | INFOPLIST_FILE = "PickerSamplePad-Info.plist"; 255 | PRODUCT_NAME = PickerSamplePad; 256 | }; 257 | name = Debug; 258 | }; 259 | 1D6058950D05DD3E006BFB54 /* Release */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | COPY_PHASE_STRIP = YES; 263 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 264 | GCC_PREFIX_HEADER = PickerSamplePad_Prefix.pch; 265 | INFOPLIST_FILE = "PickerSamplePad-Info.plist"; 266 | PRODUCT_NAME = PickerSamplePad; 267 | VALIDATE_PRODUCT = YES; 268 | }; 269 | name = Release; 270 | }; 271 | C01FCF4F08A954540054247B /* Debug */ = { 272 | isa = XCBuildConfiguration; 273 | buildSettings = { 274 | CLANG_ENABLE_OBJC_ARC = YES; 275 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 276 | GCC_C_LANGUAGE_STANDARD = c99; 277 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 278 | GCC_WARN_UNUSED_VARIABLE = YES; 279 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 280 | ONLY_ACTIVE_ARCH = YES; 281 | SDKROOT = iphoneos; 282 | TARGETED_DEVICE_FAMILY = 2; 283 | }; 284 | name = Debug; 285 | }; 286 | C01FCF5008A954540054247B /* Release */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | CLANG_ENABLE_OBJC_ARC = YES; 290 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 291 | GCC_C_LANGUAGE_STANDARD = c99; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 293 | GCC_WARN_UNUSED_VARIABLE = YES; 294 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 295 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 296 | SDKROOT = iphoneos; 297 | TARGETED_DEVICE_FAMILY = 2; 298 | }; 299 | name = Release; 300 | }; 301 | /* End XCBuildConfiguration section */ 302 | 303 | /* Begin XCConfigurationList section */ 304 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PickerSamplePad" */ = { 305 | isa = XCConfigurationList; 306 | buildConfigurations = ( 307 | 1D6058940D05DD3E006BFB54 /* Debug */, 308 | 1D6058950D05DD3E006BFB54 /* Release */, 309 | ); 310 | defaultConfigurationIsVisible = 0; 311 | defaultConfigurationName = Release; 312 | }; 313 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PickerSamplePad" */ = { 314 | isa = XCConfigurationList; 315 | buildConfigurations = ( 316 | C01FCF4F08A954540054247B /* Debug */, 317 | C01FCF5008A954540054247B /* Release */, 318 | ); 319 | defaultConfigurationIsVisible = 0; 320 | defaultConfigurationName = Release; 321 | }; 322 | /* End XCConfigurationList section */ 323 | }; 324 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 325 | } 326 | -------------------------------------------------------------------------------- /PickerSamplePhone/PickerSamplePhoneViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10F569 6 | 804 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 123 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 | 44 | YES 45 | 46 | 47 | 292 48 | {{20, 192}, {280, 37}} 49 | 50 | NO 51 | IBCocoaTouchFramework 52 | 0 53 | 0 54 | 55 | Helvetica-Bold 56 | 15 57 | 16 58 | 59 | 1 60 | Change Background Color 61 | 62 | 3 63 | MQA 64 | 65 | 66 | 1 67 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 68 | 69 | 70 | 3 71 | MC41AA 72 | 73 | 74 | 75 | {320, 460} 76 | 77 | 78 | 3 79 | MC43NQA 80 | 81 | 2 82 | 83 | 84 | NO 85 | 86 | IBCocoaTouchFramework 87 | 88 | 89 | 90 | 91 | YES 92 | 93 | 94 | view 95 | 96 | 97 | 98 | 7 99 | 100 | 101 | 102 | changeBackgroundColor 103 | 104 | 105 | 7 106 | 107 | 9 108 | 109 | 110 | 111 | 112 | YES 113 | 114 | 0 115 | 116 | 117 | 118 | 119 | 120 | -1 121 | 122 | 123 | File's Owner 124 | 125 | 126 | -2 127 | 128 | 129 | 130 | 131 | 6 132 | 133 | 134 | YES 135 | 136 | 137 | 138 | 139 | 140 | 8 141 | 142 | 143 | 144 | 145 | 146 | 147 | YES 148 | 149 | YES 150 | -1.CustomClassName 151 | -2.CustomClassName 152 | 6.IBEditorWindowLastContentRect 153 | 6.IBPluginDependency 154 | 8.IBPluginDependency 155 | 8.IBViewBoundsToFrameTransform 156 | 157 | 158 | YES 159 | PickerSamplePhoneViewController 160 | UIResponder 161 | {{239, 654}, {320, 480}} 162 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 163 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 164 | 165 | P4AAAL+AAABBoAAAwlwAAA 166 | 167 | 168 | 169 | 170 | YES 171 | 172 | 173 | YES 174 | 175 | 176 | 177 | 178 | YES 179 | 180 | 181 | YES 182 | 183 | 184 | 185 | 9 186 | 187 | 188 | 189 | YES 190 | 191 | PickerSamplePhoneViewController 192 | UIViewController 193 | 194 | changeBackgroundColor 195 | id 196 | 197 | 198 | changeBackgroundColor 199 | 200 | changeBackgroundColor 201 | id 202 | 203 | 204 | 205 | IBProjectSource 206 | Classes/PickerSamplePhoneViewController.h 207 | 208 | 209 | 210 | 211 | YES 212 | 213 | NSObject 214 | 215 | IBFrameworkSource 216 | Foundation.framework/Headers/NSError.h 217 | 218 | 219 | 220 | NSObject 221 | 222 | IBFrameworkSource 223 | Foundation.framework/Headers/NSFileManager.h 224 | 225 | 226 | 227 | NSObject 228 | 229 | IBFrameworkSource 230 | Foundation.framework/Headers/NSKeyValueCoding.h 231 | 232 | 233 | 234 | NSObject 235 | 236 | IBFrameworkSource 237 | Foundation.framework/Headers/NSKeyValueObserving.h 238 | 239 | 240 | 241 | NSObject 242 | 243 | IBFrameworkSource 244 | Foundation.framework/Headers/NSKeyedArchiver.h 245 | 246 | 247 | 248 | NSObject 249 | 250 | IBFrameworkSource 251 | Foundation.framework/Headers/NSObject.h 252 | 253 | 254 | 255 | NSObject 256 | 257 | IBFrameworkSource 258 | Foundation.framework/Headers/NSRunLoop.h 259 | 260 | 261 | 262 | NSObject 263 | 264 | IBFrameworkSource 265 | Foundation.framework/Headers/NSThread.h 266 | 267 | 268 | 269 | NSObject 270 | 271 | IBFrameworkSource 272 | Foundation.framework/Headers/NSURL.h 273 | 274 | 275 | 276 | NSObject 277 | 278 | IBFrameworkSource 279 | Foundation.framework/Headers/NSURLConnection.h 280 | 281 | 282 | 283 | NSObject 284 | 285 | IBFrameworkSource 286 | UIKit.framework/Headers/UIAccessibility.h 287 | 288 | 289 | 290 | NSObject 291 | 292 | IBFrameworkSource 293 | UIKit.framework/Headers/UINibLoading.h 294 | 295 | 296 | 297 | NSObject 298 | 299 | IBFrameworkSource 300 | UIKit.framework/Headers/UIResponder.h 301 | 302 | 303 | 304 | UIButton 305 | UIControl 306 | 307 | IBFrameworkSource 308 | UIKit.framework/Headers/UIButton.h 309 | 310 | 311 | 312 | UIControl 313 | UIView 314 | 315 | IBFrameworkSource 316 | UIKit.framework/Headers/UIControl.h 317 | 318 | 319 | 320 | UIResponder 321 | NSObject 322 | 323 | 324 | 325 | UISearchBar 326 | UIView 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UISearchBar.h 330 | 331 | 332 | 333 | UISearchDisplayController 334 | NSObject 335 | 336 | IBFrameworkSource 337 | UIKit.framework/Headers/UISearchDisplayController.h 338 | 339 | 340 | 341 | UIView 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UITextField.h 345 | 346 | 347 | 348 | UIView 349 | UIResponder 350 | 351 | IBFrameworkSource 352 | UIKit.framework/Headers/UIView.h 353 | 354 | 355 | 356 | UIViewController 357 | 358 | IBFrameworkSource 359 | UIKit.framework/Headers/UINavigationController.h 360 | 361 | 362 | 363 | UIViewController 364 | 365 | IBFrameworkSource 366 | UIKit.framework/Headers/UIPopoverController.h 367 | 368 | 369 | 370 | UIViewController 371 | 372 | IBFrameworkSource 373 | UIKit.framework/Headers/UISplitViewController.h 374 | 375 | 376 | 377 | UIViewController 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UITabBarController.h 381 | 382 | 383 | 384 | UIViewController 385 | UIResponder 386 | 387 | IBFrameworkSource 388 | UIKit.framework/Headers/UIViewController.h 389 | 390 | 391 | 392 | 393 | 0 394 | IBCocoaTouchFramework 395 | 396 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 397 | 398 | 399 | 400 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 401 | 402 | 403 | YES 404 | PickerSamplePhone.xcodeproj 405 | 3 406 | 123 407 | 408 | 409 | -------------------------------------------------------------------------------- /PickerSamplePhone/PickerSamplePhone.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D3623260D0F684500981E51 /* PickerSamplePhoneAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* PickerSamplePhoneAppDelegate.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 /* PickerSamplePhoneViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* PickerSamplePhoneViewController.xib */; }; 16 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 17 | 28D7ACF80DDB3853001CB0EB /* PickerSamplePhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* PickerSamplePhoneViewController.m */; }; 18 | 6913A78E1858D80600A5C092 /* InfColorPickerNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6913A78D1858D80600A5C092 /* InfColorPickerNavigationController.m */; }; 19 | 6923F3E613F481720051A217 /* InfColorBarPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3DA13F481720051A217 /* InfColorBarPicker.m */; }; 20 | 6923F3E713F481720051A217 /* InfColorIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3DC13F481720051A217 /* InfColorIndicatorView.m */; }; 21 | 6923F3E813F481720051A217 /* InfColorPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3DE13F481720051A217 /* InfColorPickerController.m */; }; 22 | 6923F3E913F481720051A217 /* InfColorPickerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6923F3DF13F481720051A217 /* InfColorPickerView.xib */; }; 23 | 6923F3EA13F481720051A217 /* InfColorSquarePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3E113F481720051A217 /* InfColorSquarePicker.m */; }; 24 | 6923F3EB13F481720051A217 /* InfHSBSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3E313F481720051A217 /* InfHSBSupport.m */; }; 25 | 6923F3EC13F481720051A217 /* InfSourceColorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6923F3E513F481720051A217 /* InfSourceColorView.m */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 30 | 1D3623240D0F684500981E51 /* PickerSamplePhoneAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = PickerSamplePhoneAppDelegate.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 31 | 1D3623250D0F684500981E51 /* PickerSamplePhoneAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = PickerSamplePhoneAppDelegate.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 32 | 1D6058910D05DD3D006BFB54 /* PickerSamplePhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PickerSamplePhone.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 34 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 35 | 2899E5210DE3E06400AC0155 /* PickerSamplePhoneViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PickerSamplePhoneViewController.xib; sourceTree = ""; }; 36 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; 37 | 28D7ACF60DDB3853001CB0EB /* PickerSamplePhoneViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = PickerSamplePhoneViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 38 | 28D7ACF70DDB3853001CB0EB /* PickerSamplePhoneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = PickerSamplePhoneViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 39 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = main.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 40 | 6913A78C1858D80600A5C092 /* InfColorPickerNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfColorPickerNavigationController.h; sourceTree = ""; }; 41 | 6913A78D1858D80600A5C092 /* InfColorPickerNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfColorPickerNavigationController.m; sourceTree = ""; }; 42 | 6923F3D913F481720051A217 /* InfColorBarPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InfColorBarPicker.h; sourceTree = ""; }; 43 | 6923F3DA13F481720051A217 /* InfColorBarPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = InfColorBarPicker.m; sourceTree = ""; }; 44 | 6923F3DB13F481720051A217 /* InfColorIndicatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InfColorIndicatorView.h; sourceTree = ""; }; 45 | 6923F3DC13F481720051A217 /* InfColorIndicatorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = InfColorIndicatorView.m; sourceTree = ""; }; 46 | 6923F3DD13F481720051A217 /* InfColorPickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InfColorPickerController.h; sourceTree = ""; }; 47 | 6923F3DE13F481720051A217 /* InfColorPickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InfColorPickerController.m; sourceTree = ""; }; 48 | 6923F3DF13F481720051A217 /* InfColorPickerView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = InfColorPickerView.xib; sourceTree = ""; }; 49 | 6923F3E013F481720051A217 /* InfColorSquarePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InfColorSquarePicker.h; sourceTree = ""; }; 50 | 6923F3E113F481720051A217 /* InfColorSquarePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = InfColorSquarePicker.m; sourceTree = ""; }; 51 | 6923F3E213F481720051A217 /* InfHSBSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InfHSBSupport.h; sourceTree = ""; }; 52 | 6923F3E313F481720051A217 /* InfHSBSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = InfHSBSupport.m; sourceTree = ""; }; 53 | 6923F3E413F481720051A217 /* InfSourceColorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InfSourceColorView.h; sourceTree = ""; }; 54 | 6923F3E513F481720051A217 /* InfSourceColorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = InfSourceColorView.m; sourceTree = ""; }; 55 | 69F47A3114181FB700E29503 /* InfColorPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InfColorPicker.h; sourceTree = ""; }; 56 | 8D1107310486CEB800E47090 /* PickerSamplePhone-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "PickerSamplePhone-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; 57 | /* End PBXFileReference section */ 58 | 59 | /* Begin PBXFrameworksBuildPhase section */ 60 | 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 65 | 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 66 | 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | /* End PBXFrameworksBuildPhase section */ 71 | 72 | /* Begin PBXGroup section */ 73 | 080E96DDFE201D6D7F000001 /* Classes */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 1D3623240D0F684500981E51 /* PickerSamplePhoneAppDelegate.h */, 77 | 1D3623250D0F684500981E51 /* PickerSamplePhoneAppDelegate.m */, 78 | 28D7ACF60DDB3853001CB0EB /* PickerSamplePhoneViewController.h */, 79 | 28D7ACF70DDB3853001CB0EB /* PickerSamplePhoneViewController.m */, 80 | ); 81 | path = Classes; 82 | sourceTree = ""; 83 | }; 84 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 1D6058910D05DD3D006BFB54 /* PickerSamplePhone.app */, 88 | ); 89 | name = Products; 90 | sourceTree = ""; 91 | }; 92 | 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 080E96DDFE201D6D7F000001 /* Classes */, 96 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 97 | 6923F3D813F481720051A217 /* InfColorPicker */, 98 | 29B97317FDCFA39411CA2CEA /* Resources */, 99 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 100 | 19C28FACFE9D520D11CA2CBB /* Products */, 101 | ); 102 | name = CustomTemplate; 103 | sourceTree = ""; 104 | }; 105 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 29B97316FDCFA39411CA2CEA /* main.m */, 109 | ); 110 | name = "Other Sources"; 111 | sourceTree = ""; 112 | }; 113 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 2899E5210DE3E06400AC0155 /* PickerSamplePhoneViewController.xib */, 117 | 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 118 | 8D1107310486CEB800E47090 /* PickerSamplePhone-Info.plist */, 119 | ); 120 | name = Resources; 121 | sourceTree = ""; 122 | }; 123 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 127 | 1D30AB110D05D00D00671497 /* Foundation.framework */, 128 | 288765A40DF7441C002DB57D /* CoreGraphics.framework */, 129 | ); 130 | name = Frameworks; 131 | sourceTree = ""; 132 | }; 133 | 6923F3D813F481720051A217 /* InfColorPicker */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 6923F3D913F481720051A217 /* InfColorBarPicker.h */, 137 | 6923F3DA13F481720051A217 /* InfColorBarPicker.m */, 138 | 6923F3DB13F481720051A217 /* InfColorIndicatorView.h */, 139 | 6923F3DC13F481720051A217 /* InfColorIndicatorView.m */, 140 | 69F47A3114181FB700E29503 /* InfColorPicker.h */, 141 | 6923F3DD13F481720051A217 /* InfColorPickerController.h */, 142 | 6923F3DE13F481720051A217 /* InfColorPickerController.m */, 143 | 6913A78C1858D80600A5C092 /* InfColorPickerNavigationController.h */, 144 | 6913A78D1858D80600A5C092 /* InfColorPickerNavigationController.m */, 145 | 6923F3DF13F481720051A217 /* InfColorPickerView.xib */, 146 | 6923F3E013F481720051A217 /* InfColorSquarePicker.h */, 147 | 6923F3E113F481720051A217 /* InfColorSquarePicker.m */, 148 | 6923F3E213F481720051A217 /* InfHSBSupport.h */, 149 | 6923F3E313F481720051A217 /* InfHSBSupport.m */, 150 | 6923F3E413F481720051A217 /* InfSourceColorView.h */, 151 | 6923F3E513F481720051A217 /* InfSourceColorView.m */, 152 | ); 153 | name = InfColorPicker; 154 | path = ../InfColorPicker; 155 | sourceTree = ""; 156 | }; 157 | /* End PBXGroup section */ 158 | 159 | /* Begin PBXNativeTarget section */ 160 | 1D6058900D05DD3D006BFB54 /* PickerSamplePhone */ = { 161 | isa = PBXNativeTarget; 162 | buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PickerSamplePhone" */; 163 | buildPhases = ( 164 | 1D60588D0D05DD3D006BFB54 /* Resources */, 165 | 1D60588E0D05DD3D006BFB54 /* Sources */, 166 | 1D60588F0D05DD3D006BFB54 /* Frameworks */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | ); 172 | name = PickerSamplePhone; 173 | productName = PickerSamplePhone; 174 | productReference = 1D6058910D05DD3D006BFB54 /* PickerSamplePhone.app */; 175 | productType = "com.apple.product-type.application"; 176 | }; 177 | /* End PBXNativeTarget section */ 178 | 179 | /* Begin PBXProject section */ 180 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 181 | isa = PBXProject; 182 | attributes = { 183 | LastUpgradeCheck = 0500; 184 | }; 185 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PickerSamplePhone" */; 186 | compatibilityVersion = "Xcode 3.2"; 187 | developmentRegion = English; 188 | hasScannedForEncodings = 1; 189 | knownRegions = ( 190 | English, 191 | Japanese, 192 | French, 193 | German, 194 | ); 195 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; 196 | projectDirPath = ""; 197 | projectRoot = ""; 198 | targets = ( 199 | 1D6058900D05DD3D006BFB54 /* PickerSamplePhone */, 200 | ); 201 | }; 202 | /* End PBXProject section */ 203 | 204 | /* Begin PBXResourcesBuildPhase section */ 205 | 1D60588D0D05DD3D006BFB54 /* Resources */ = { 206 | isa = PBXResourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, 210 | 2899E5220DE3E06400AC0155 /* PickerSamplePhoneViewController.xib in Resources */, 211 | 6923F3E913F481720051A217 /* InfColorPickerView.xib in Resources */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXResourcesBuildPhase section */ 216 | 217 | /* Begin PBXSourcesBuildPhase section */ 218 | 1D60588E0D05DD3D006BFB54 /* Sources */ = { 219 | isa = PBXSourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 223 | 1D3623260D0F684500981E51 /* PickerSamplePhoneAppDelegate.m in Sources */, 224 | 28D7ACF80DDB3853001CB0EB /* PickerSamplePhoneViewController.m in Sources */, 225 | 6923F3E613F481720051A217 /* InfColorBarPicker.m in Sources */, 226 | 6923F3E713F481720051A217 /* InfColorIndicatorView.m in Sources */, 227 | 6923F3E813F481720051A217 /* InfColorPickerController.m in Sources */, 228 | 6923F3EA13F481720051A217 /* InfColorSquarePicker.m in Sources */, 229 | 6913A78E1858D80600A5C092 /* InfColorPickerNavigationController.m in Sources */, 230 | 6923F3EB13F481720051A217 /* InfHSBSupport.m in Sources */, 231 | 6923F3EC13F481720051A217 /* InfSourceColorView.m in Sources */, 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | /* End PBXSourcesBuildPhase section */ 236 | 237 | /* Begin XCBuildConfiguration section */ 238 | 1D6058940D05DD3E006BFB54 /* Debug */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | COPY_PHASE_STRIP = NO; 244 | GCC_DYNAMIC_NO_PIC = NO; 245 | GCC_OPTIMIZATION_LEVEL = 0; 246 | INFOPLIST_FILE = "PickerSamplePhone-Info.plist"; 247 | PRODUCT_NAME = PickerSamplePhone; 248 | }; 249 | name = Debug; 250 | }; 251 | 1D6058950D05DD3E006BFB54 /* Release */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | ALWAYS_SEARCH_USER_PATHS = NO; 255 | CLANG_ENABLE_OBJC_ARC = YES; 256 | COPY_PHASE_STRIP = YES; 257 | INFOPLIST_FILE = "PickerSamplePhone-Info.plist"; 258 | PRODUCT_NAME = PickerSamplePhone; 259 | VALIDATE_PRODUCT = YES; 260 | }; 261 | name = Release; 262 | }; 263 | C01FCF4F08A954540054247B /* Debug */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | GCC_C_LANGUAGE_STANDARD = c99; 268 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 269 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 271 | GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; 272 | GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; 273 | GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO; 274 | GCC_WARN_PEDANTIC = NO; 275 | GCC_WARN_SHADOW = YES; 276 | GCC_WARN_SIGN_COMPARE = YES; 277 | GCC_WARN_STRICT_SELECTOR_MATCH = YES; 278 | GCC_WARN_UNDECLARED_SELECTOR = YES; 279 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 280 | GCC_WARN_UNKNOWN_PRAGMAS = YES; 281 | GCC_WARN_UNUSED_FUNCTION = YES; 282 | GCC_WARN_UNUSED_LABEL = YES; 283 | GCC_WARN_UNUSED_PARAMETER = NO; 284 | GCC_WARN_UNUSED_VARIABLE = YES; 285 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 286 | ONLY_ACTIVE_ARCH = YES; 287 | SDKROOT = iphoneos; 288 | }; 289 | name = Debug; 290 | }; 291 | C01FCF5008A954540054247B /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 295 | GCC_AUTO_VECTORIZATION = YES; 296 | GCC_C_LANGUAGE_STANDARD = c99; 297 | GCC_FAST_MATH = YES; 298 | GCC_MODEL_TUNING = ""; 299 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 300 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 301 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 302 | GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; 303 | GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; 304 | GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO; 305 | GCC_WARN_PEDANTIC = NO; 306 | GCC_WARN_SHADOW = YES; 307 | GCC_WARN_SIGN_COMPARE = YES; 308 | GCC_WARN_STRICT_SELECTOR_MATCH = YES; 309 | GCC_WARN_UNDECLARED_SELECTOR = YES; 310 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 311 | GCC_WARN_UNKNOWN_PRAGMAS = YES; 312 | GCC_WARN_UNUSED_FUNCTION = YES; 313 | GCC_WARN_UNUSED_LABEL = YES; 314 | GCC_WARN_UNUSED_PARAMETER = NO; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 317 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 318 | SDKROOT = iphoneos; 319 | }; 320 | name = Release; 321 | }; 322 | /* End XCBuildConfiguration section */ 323 | 324 | /* Begin XCConfigurationList section */ 325 | 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "PickerSamplePhone" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | 1D6058940D05DD3E006BFB54 /* Debug */, 329 | 1D6058950D05DD3E006BFB54 /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PickerSamplePhone" */ = { 335 | isa = XCConfigurationList; 336 | buildConfigurations = ( 337 | C01FCF4F08A954540054247B /* Debug */, 338 | C01FCF5008A954540054247B /* Release */, 339 | ); 340 | defaultConfigurationIsVisible = 0; 341 | defaultConfigurationName = Release; 342 | }; 343 | /* End XCConfigurationList section */ 344 | }; 345 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 346 | } 347 | -------------------------------------------------------------------------------- /PickerSamplePad/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 800 5 | 10D540 6 | 760 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 81 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 | 292 43 | {768, 1024} 44 | 45 | 46 | 1 47 | MSAxIDEAA 48 | 49 | NO 50 | NO 51 | 52 | 2 53 | 54 | IBIPadFramework 55 | YES 56 | 57 | 58 | IBIPadFramework 59 | 60 | 61 | PickerSamplePadViewController 62 | 63 | IBIPadFramework 64 | 65 | 66 | 67 | 68 | YES 69 | 70 | 71 | viewController 72 | 73 | 74 | 75 | 8 76 | 77 | 78 | 79 | delegate 80 | 81 | 82 | 83 | 9 84 | 85 | 86 | 87 | window 88 | 89 | 90 | 91 | 10 92 | 93 | 94 | 95 | 96 | YES 97 | 98 | 0 99 | 100 | 101 | 102 | 103 | 104 | -1 105 | 106 | 107 | File's Owner 108 | 109 | 110 | -2 111 | 112 | 113 | 114 | 115 | 2 116 | 117 | 118 | 119 | 120 | 6 121 | 122 | 123 | PickerSamplePad App Delegate 124 | 125 | 126 | 7 127 | 128 | 129 | 130 | 131 | 132 | 133 | YES 134 | 135 | YES 136 | -1.CustomClassName 137 | -2.CustomClassName 138 | 2.IBEditorWindowLastContentRect 139 | 2.IBPluginDependency 140 | 6.CustomClassName 141 | 6.IBPluginDependency 142 | 7.CustomClassName 143 | 7.IBEditorWindowLastContentRect 144 | 7.IBPluginDependency 145 | 146 | 147 | YES 148 | UIApplication 149 | UIResponder 150 | {{200, 57}, {783, 799}} 151 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 152 | PickerSamplePadAppDelegate 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | PickerSamplePadViewController 155 | {{512, 351}, {320, 480}} 156 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 157 | 158 | 159 | 160 | YES 161 | 162 | 163 | YES 164 | 165 | 166 | 167 | 168 | YES 169 | 170 | 171 | YES 172 | 173 | 174 | 175 | 10 176 | 177 | 178 | 179 | YES 180 | 181 | PickerSamplePadAppDelegate 182 | NSObject 183 | 184 | YES 185 | 186 | YES 187 | viewController 188 | window 189 | 190 | 191 | YES 192 | PickerSamplePadViewController 193 | UIWindow 194 | 195 | 196 | 197 | IBProjectSource 198 | Classes/PickerSamplePadAppDelegate.h 199 | 200 | 201 | 202 | PickerSamplePadViewController 203 | UIViewController 204 | 205 | IBProjectSource 206 | Classes/PickerSamplePadViewController.h 207 | 208 | 209 | 210 | 211 | YES 212 | 213 | NSObject 214 | 215 | IBFrameworkSource 216 | Foundation.framework/Headers/NSError.h 217 | 218 | 219 | 220 | NSObject 221 | 222 | IBFrameworkSource 223 | Foundation.framework/Headers/NSFileManager.h 224 | 225 | 226 | 227 | NSObject 228 | 229 | IBFrameworkSource 230 | Foundation.framework/Headers/NSKeyValueCoding.h 231 | 232 | 233 | 234 | NSObject 235 | 236 | IBFrameworkSource 237 | Foundation.framework/Headers/NSKeyValueObserving.h 238 | 239 | 240 | 241 | NSObject 242 | 243 | IBFrameworkSource 244 | Foundation.framework/Headers/NSKeyedArchiver.h 245 | 246 | 247 | 248 | NSObject 249 | 250 | IBFrameworkSource 251 | Foundation.framework/Headers/NSNetServices.h 252 | 253 | 254 | 255 | NSObject 256 | 257 | IBFrameworkSource 258 | Foundation.framework/Headers/NSObject.h 259 | 260 | 261 | 262 | NSObject 263 | 264 | IBFrameworkSource 265 | Foundation.framework/Headers/NSPort.h 266 | 267 | 268 | 269 | NSObject 270 | 271 | IBFrameworkSource 272 | Foundation.framework/Headers/NSRunLoop.h 273 | 274 | 275 | 276 | NSObject 277 | 278 | IBFrameworkSource 279 | Foundation.framework/Headers/NSStream.h 280 | 281 | 282 | 283 | NSObject 284 | 285 | IBFrameworkSource 286 | Foundation.framework/Headers/NSThread.h 287 | 288 | 289 | 290 | NSObject 291 | 292 | IBFrameworkSource 293 | Foundation.framework/Headers/NSURL.h 294 | 295 | 296 | 297 | NSObject 298 | 299 | IBFrameworkSource 300 | Foundation.framework/Headers/NSURLConnection.h 301 | 302 | 303 | 304 | NSObject 305 | 306 | IBFrameworkSource 307 | Foundation.framework/Headers/NSXMLParser.h 308 | 309 | 310 | 311 | NSObject 312 | 313 | IBFrameworkSource 314 | UIKit.framework/Headers/UIAccessibility.h 315 | 316 | 317 | 318 | NSObject 319 | 320 | IBFrameworkSource 321 | UIKit.framework/Headers/UINibLoading.h 322 | 323 | 324 | 325 | NSObject 326 | 327 | IBFrameworkSource 328 | UIKit.framework/Headers/UIResponder.h 329 | 330 | 331 | 332 | UIApplication 333 | UIResponder 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIApplication.h 337 | 338 | 339 | 340 | UIResponder 341 | NSObject 342 | 343 | 344 | 345 | UIResponder 346 | 347 | IBFrameworkSource 348 | UIKit.framework/Headers/UITextInput.h 349 | 350 | 351 | 352 | UISearchBar 353 | UIView 354 | 355 | IBFrameworkSource 356 | UIKit.framework/Headers/UISearchBar.h 357 | 358 | 359 | 360 | UISearchDisplayController 361 | NSObject 362 | 363 | IBFrameworkSource 364 | UIKit.framework/Headers/UISearchDisplayController.h 365 | 366 | 367 | 368 | UIView 369 | 370 | IBFrameworkSource 371 | UIKit.framework/Headers/UITextField.h 372 | 373 | 374 | 375 | UIView 376 | UIResponder 377 | 378 | IBFrameworkSource 379 | UIKit.framework/Headers/UIView.h 380 | 381 | 382 | 383 | UIViewController 384 | 385 | IBFrameworkSource 386 | UIKit.framework/Headers/UINavigationController.h 387 | 388 | 389 | 390 | UIViewController 391 | 392 | IBFrameworkSource 393 | UIKit.framework/Headers/UISplitViewController.h 394 | 395 | 396 | 397 | UIViewController 398 | 399 | IBFrameworkSource 400 | UIKit.framework/Headers/UITabBarController.h 401 | 402 | 403 | 404 | UIViewController 405 | UIResponder 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UIViewController.h 409 | 410 | 411 | 412 | UIWindow 413 | UIView 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIWindow.h 417 | 418 | 419 | 420 | 421 | 0 422 | IBIPadFramework 423 | 424 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 425 | 426 | 427 | 428 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 429 | 430 | 431 | YES 432 | PickerSamplePad.xcodeproj 433 | 3 434 | 81 435 | 436 | 437 | -------------------------------------------------------------------------------- /PickerSamplePhone/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 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 | IBCocoaTouchFramework 42 | 43 | 44 | PickerSamplePhoneViewController 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | PickerSamplePhone App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | PickerSamplePhoneViewController 152 | {{234, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | PickerSamplePhoneAppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | UIWindow 183 | UIView 184 | 185 | IBUserSource 186 | 187 | 188 | 189 | 190 | PickerSamplePhoneAppDelegate 191 | NSObject 192 | 193 | YES 194 | 195 | YES 196 | viewController 197 | window 198 | 199 | 200 | YES 201 | PickerSamplePhoneViewController 202 | UIWindow 203 | 204 | 205 | 206 | YES 207 | 208 | YES 209 | viewController 210 | window 211 | 212 | 213 | YES 214 | 215 | viewController 216 | PickerSamplePhoneViewController 217 | 218 | 219 | window 220 | UIWindow 221 | 222 | 223 | 224 | 225 | IBProjectSource 226 | Classes/PickerSamplePhoneAppDelegate.h 227 | 228 | 229 | 230 | PickerSamplePhoneAppDelegate 231 | NSObject 232 | 233 | IBUserSource 234 | 235 | 236 | 237 | 238 | PickerSamplePhoneViewController 239 | UIViewController 240 | 241 | IBProjectSource 242 | Classes/PickerSamplePhoneViewController.h 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSError.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSFileManager.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSKeyValueCoding.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | Foundation.framework/Headers/NSKeyValueObserving.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSKeyedArchiver.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSObject.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSRunLoop.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSThread.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSURL.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSURLConnection.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | UIKit.framework/Headers/UIAccessibility.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UINibLoading.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIResponder.h 337 | 338 | 339 | 340 | UIApplication 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIApplication.h 345 | 346 | 347 | 348 | UIResponder 349 | NSObject 350 | 351 | 352 | 353 | UISearchBar 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchBar.h 358 | 359 | 360 | 361 | UISearchDisplayController 362 | NSObject 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UISearchDisplayController.h 366 | 367 | 368 | 369 | UIView 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UITextField.h 373 | 374 | 375 | 376 | UIView 377 | UIResponder 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIView.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWindow 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWindow.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | PickerSamplePhone.xcodeproj 441 | 3 442 | 112 443 | 444 | 445 | -------------------------------------------------------------------------------- /PickerSamplePad/PickerSamplePadViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11B2118 6 | 1934 7 | 1138.1 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 931 12 | 13 | 14 | YES 15 | IBUIView 16 | IBUIBarButtonItem 17 | IBProxyObject 18 | IBUIToolbar 19 | IBUISwitch 20 | IBUILabel 21 | IBUIButton 22 | 23 | 24 | YES 25 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 26 | 27 | 28 | PluginDependencyRecalculationVersion 29 | 30 | 31 | 32 | YES 33 | 34 | IBFilesOwner 35 | IBIPadFramework 36 | 37 | 38 | IBFirstResponder 39 | IBIPadFramework 40 | 41 | 42 | 43 | 274 44 | 45 | YES 46 | 47 | 48 | 290 49 | {768, 44} 50 | 51 | 52 | 53 | NO 54 | NO 55 | IBIPadFramework 56 | 57 | YES 58 | 59 | NO 60 | iPad Color Picker Sample 61 | IBIPadFramework 62 | 63 | 64 | 65 | IBIPadFramework 66 | 67 | 5 68 | 69 | 70 | Change Color 71 | IBIPadFramework 72 | 1 73 | 74 | 75 | 76 | 77 | 78 | 79 | 301 80 | {{201, 464}, {366, 37}} 81 | 82 | 83 | 84 | NO 85 | IBIPadFramework 86 | 0 87 | 0 88 | 1 89 | Change Background Color 90 | 91 | 3 92 | MQA 93 | 94 | 95 | 1 96 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 97 | 98 | 99 | 3 100 | MC41AA 101 | 102 | 103 | Helvetica-Bold 104 | Helvetica 105 | 2 106 | 15 107 | 108 | 109 | Helvetica-Bold 110 | 15 111 | 16 112 | 113 | 114 | 115 | 116 | 301 117 | {{201, 528}, {366, 37}} 118 | 119 | 120 | 121 | NO 122 | IBIPadFramework 123 | 0 124 | 0 125 | 1 126 | Select Colors from Table 127 | 128 | 129 | 1 130 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 289 139 | 140 | YES 141 | 142 | 143 | 292 144 | {{134, 20}, {94, 27}} 145 | 146 | 147 | 148 | NO 149 | IBIPadFramework 150 | 0 151 | 0 152 | 153 | 154 | 155 | 292 156 | {{20, 23}, {106, 21}} 157 | 158 | 159 | 160 | NO 161 | YES 162 | 7 163 | NO 164 | IBIPadFramework 165 | Live Updating 166 | 167 | 1 168 | MCAwIDAAA 169 | 170 | 171 | 1 172 | 10 173 | 2 174 | 175 | 1 176 | 17 177 | 178 | 179 | Helvetica 180 | 17 181 | 16 182 | 183 | 184 | 185 | {{473, 44}, {248, 67}} 186 | 187 | 188 | 189 | 190 | 3 191 | MC44MDEwMjA0MDgyAA 192 | 193 | IBIPadFramework 194 | 195 | 196 | {{0, 20}, {768, 1004}} 197 | 198 | 199 | 200 | 201 | 3 202 | MQA 203 | 204 | 2 205 | 206 | 207 | 208 | 2 209 | 210 | IBIPadFramework 211 | 212 | 213 | 214 | 215 | YES 216 | 217 | 218 | view 219 | 220 | 221 | 222 | 3 223 | 224 | 225 | 226 | changeColor: 227 | 228 | 229 | 230 | 10 231 | 232 | 233 | 234 | changeColor: 235 | 236 | 237 | 7 238 | 239 | 11 240 | 241 | 242 | 243 | takeUpdateLive: 244 | 245 | 246 | 13 247 | 248 | 16 249 | 250 | 251 | 252 | showColorTable: 253 | 254 | 255 | 7 256 | 257 | 19 258 | 259 | 260 | 261 | 262 | YES 263 | 264 | 0 265 | 266 | YES 267 | 268 | 269 | 270 | 271 | 272 | -1 273 | 274 | 275 | File's Owner 276 | 277 | 278 | -2 279 | 280 | 281 | 282 | 283 | 2 284 | 285 | 286 | YES 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 4 296 | 297 | 298 | YES 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 5 307 | 308 | 309 | 310 | 311 | 6 312 | 313 | 314 | 315 | 316 | 7 317 | 318 | 319 | 320 | 321 | 14 322 | 323 | 324 | YES 325 | 326 | 327 | 328 | 329 | 330 | 331 | 12 332 | 333 | 334 | 335 | 336 | 13 337 | 338 | 339 | 340 | 341 | 15 342 | 343 | 344 | 345 | 346 | 17 347 | 348 | 349 | 350 | 351 | 352 | 353 | YES 354 | 355 | YES 356 | -1.CustomClassName 357 | -1.IBPluginDependency 358 | -2.CustomClassName 359 | -2.IBPluginDependency 360 | 12.IBPluginDependency 361 | 13.IBPluginDependency 362 | 14.IBPluginDependency 363 | 15.IBPluginDependency 364 | 17.IBPluginDependency 365 | 2.IBPluginDependency 366 | 4.IBPluginDependency 367 | 5.IBPluginDependency 368 | 6.IBPluginDependency 369 | 7.IBPluginDependency 370 | 371 | 372 | YES 373 | PickerSamplePadViewController 374 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 375 | UIResponder 376 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 377 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 378 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 379 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 380 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 381 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 382 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 383 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 384 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 385 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 386 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 387 | 388 | 389 | 390 | YES 391 | 392 | 393 | 394 | 395 | 396 | YES 397 | 398 | 399 | 400 | 401 | 19 402 | 403 | 404 | 405 | YES 406 | 407 | PickerSamplePadViewController 408 | UIViewController 409 | 410 | YES 411 | 412 | YES 413 | changeColor: 414 | showColorTable: 415 | takeUpdateLive: 416 | 417 | 418 | YES 419 | id 420 | id 421 | id 422 | 423 | 424 | 425 | YES 426 | 427 | YES 428 | changeColor: 429 | showColorTable: 430 | takeUpdateLive: 431 | 432 | 433 | YES 434 | 435 | changeColor: 436 | id 437 | 438 | 439 | showColorTable: 440 | id 441 | 442 | 443 | takeUpdateLive: 444 | id 445 | 446 | 447 | 448 | 449 | IBProjectSource 450 | ./Classes/PickerSamplePadViewController.h 451 | 452 | 453 | 454 | 455 | 0 456 | IBIPadFramework 457 | 458 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 459 | 460 | 461 | 462 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 463 | 464 | 465 | YES 466 | 3 467 | 931 468 | 469 | 470 | --------------------------------------------------------------------------------