Skip to content
Browse files

Added SwipeWheel Class

  • Loading branch information...
0 parents commit 7075a7da44864785eac0b03de0a1e538950fbb25 @AliSoftware committed Sep 25, 2010
16 README
@@ -0,0 +1,16 @@
+This class allows you to display an horizontal wheel to pick a value from a list.
+
+It can be used for the same features as a UIPickerView for example, choosing a value from a list,
+but contrary to the UIPickerView, it can have the size you need and scrolls horizontally.
+
+To use it, you simply have to set the texts property to an NSArray of NSStrings.
+You can then connect the ValueChanged event of the SwipeWheel to whatever IBAction you want, to
+implement any action needed each time the user changes the current value of the SwipeWheel.
+
+You can also configure its properties like of course the array of texts it displays, but also the
+text font and color, the colors of the gradient at the borders, the width of the borders�
+You also have access to the selectionIndicator layer which allows you to customize its
+borderColor, backgroundColor, of hide it ('hidden' property of the CALayer)
+
+
+See the "SwipeWheel Example" project for a basic usage example.
23 SwipeWheel Example/Classes/SwipeWheel_ExampleAppDelegate.h
@@ -0,0 +1,23 @@
+//
+// SwipeWheel_ExampleAppDelegate.h
+// SwipeWheel Example
+//
+// Created by Olivier on 25/09/10.
+// Copyright 2010 AliSoftware. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "SwipeWheel.h"
+
+@interface SwipeWheel_ExampleAppDelegate : NSObject <UIApplicationDelegate> {
+ UIWindow* window;
+
+ IBOutlet SwipeWheel* colorWheel;
+ IBOutlet SwipeWheel* sizeWheel;
+ IBOutlet UILabel* exampleLabel;
+}
+@property (nonatomic, retain) IBOutlet UIWindow* window;
+-(IBAction)colorWheelChanged;
+-(IBAction)sizeWheelChanged;
+@end
+
56 SwipeWheel Example/Classes/SwipeWheel_ExampleAppDelegate.m
@@ -0,0 +1,56 @@
+//
+// SwipeWheel_ExampleAppDelegate.m
+// SwipeWheel Example
+//
+// Created by Olivier on 25/09/10.
+// Copyright 2010 AliSoftware. All rights reserved.
+//
+
+#import "SwipeWheel_ExampleAppDelegate.h"
+
+@implementation SwipeWheel_ExampleAppDelegate
+
+@synthesize window;
+
+
+#pragma mark -
+#pragma mark Application lifecycle
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+ // Override point for customization after application launch.
+ colorWheel.texts = [NSArray arrayWithObjects:@"Noir",@"Rouge",@"Vert",@"Bleu",@"Orange",@"Violet",nil];
+ colorWheel.selectionIndicatorLayer.hidden = YES;
+ colorWheel.itemsTextColor = [UIColor blackColor];
+
+ sizeWheel.texts = [NSArray arrayWithObjects:@"9",@"10",@"12",@"14",@"18",@"24",@"36",nil];
+ sizeWheel.itemsFont = [UIFont systemFontOfSize:18];
+ sizeWheel.itemsTextColor = [UIColor blueColor];
+ sizeWheel.currentPage = 2; // 12pt
+ sizeWheel.selectionIndicatorLayer.borderWidth = 2;
+ sizeWheel.selectionIndicatorLayer.borderColor = [UIColor blueColor].CGColor;
+ sizeWheel.fadingColor = [UIColor grayColor];
+
+ [window makeKeyAndVisible];
+ return YES;
+}
+
+-(IBAction)colorWheelChanged {
+ UIColor* colors[] = {[UIColor blackColor],[UIColor redColor],[UIColor greenColor],[UIColor blueColor],[UIColor orangeColor],[UIColor purpleColor]};
+ UIColor* color = colors[colorWheel.currentPage];
+ exampleLabel.textColor = color;
+}
+-(IBAction)sizeWheelChanged {
+ CGFloat sizes[] = {9,10,12,14,18,24,36};
+ CGFloat sz = sizes[sizeWheel.currentPage];
+ exampleLabel.font = [UIFont systemFontOfSize:sz];
+}
+
+
+
+- (void)dealloc {
+ [window release];
+ [super dealloc];
+}
+
+@end
753 SwipeWheel Example/MainWindow.xib
@@ -0,0 +1,753 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1024</int>
+ <string key="IBDocument.SystemVersion">10F569</string>
+ <string key="IBDocument.InterfaceBuilderVersion">804</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">123</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="2"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="841351856">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="427554174">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUICustomObject" id="664661524">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIWindow" id="380026005">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">1316</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIView" id="822998190">
+ <reference key="NSNextResponder" ref="380026005"/>
+ <int key="NSvFlags">1316</int>
+ <string key="NSFrame">{{165, 132}, {135, 45}}</string>
+ <reference key="NSSuperview" ref="380026005"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC45NTI5NzAyOTcAA</bytes>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="226437394">
+ <reference key="NSNextResponder" ref="380026005"/>
+ <int key="NSvFlags">1316</int>
+ <string key="NSFrame">{{165, 195}, {94, 60}}</string>
+ <reference key="NSSuperview" ref="380026005"/>
+ <object class="NSColor" key="IBUIBackgroundColor" id="422081646">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUILabel" id="638077356">
+ <reference key="NSNextResponder" ref="380026005"/>
+ <int key="NSvFlags">1316</int>
+ <string key="NSFrame">{{20, 357}, {280, 62}}</string>
+ <reference key="NSSuperview" ref="380026005"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Exemple</string>
+ <object class="NSColor" key="IBUITextColor" id="533611575">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <reference key="IBUIHighlightedColor" ref="422081646"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ </object>
+ <object class="IBUILabel" id="805750159">
+ <reference key="NSNextResponder" ref="380026005"/>
+ <int key="NSvFlags">1316</int>
+ <string key="NSFrame">{{20, 40}, {280, 41}}</string>
+ <reference key="NSSuperview" ref="380026005"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC41OTg2MzAxMzAzIDAuNjU3MzAzMjczNyAwLjc4ODA5NzczOTIAA</bytes>
+ </object>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">SwipeWheel Example</string>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica</string>
+ <double key="NSSize">24</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="IBUITextColor" ref="533611575"/>
+ <reference key="IBUIHighlightedColor" ref="422081646"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ <int key="IBUITextAlignment">1</int>
+ </object>
+ <object class="IBUILabel" id="116264069">
+ <reference key="NSNextResponder" ref="380026005"/>
+ <int key="NSvFlags">1316</int>
+ <string key="NSFrame">{{20, 144}, {68, 21}}</string>
+ <reference key="NSSuperview" ref="380026005"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Couleur</string>
+ <reference key="IBUITextColor" ref="533611575"/>
+ <reference key="IBUIHighlightedColor" ref="422081646"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ <object class="IBUILabel" id="405845083">
+ <reference key="NSNextResponder" ref="380026005"/>
+ <int key="NSvFlags">1316</int>
+ <string key="NSFrame">{{20, 214}, {68, 21}}</string>
+ <reference key="NSSuperview" ref="380026005"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Taille</string>
+ <reference key="IBUITextColor" ref="533611575"/>
+ <reference key="IBUIHighlightedColor" ref="422081646"/>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ </object>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrameSize">{320, 480}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MSAxIDEAA</bytes>
+ </object>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIResizesToFullScreen">YES</bool>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="841351856"/>
+ <reference key="destination" ref="664661524"/>
+ </object>
+ <int key="connectionID">4</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="380026005"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">colorWheel</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="822998190"/>
+ </object>
+ <int key="connectionID">19</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">sizeWheel</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="226437394"/>
+ </object>
+ <int key="connectionID">20</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">exampleLabel</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="638077356"/>
+ </object>
+ <int key="connectionID">21</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">colorWheelChanged</string>
+ <reference key="source" ref="822998190"/>
+ <reference key="destination" ref="664661524"/>
+ <int key="IBEventType">13</int>
+ </object>
+ <int key="connectionID">22</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">sizeWheelChanged</string>
+ <reference key="source" ref="226437394"/>
+ <reference key="destination" ref="664661524"/>
+ <int key="IBEventType">13</int>
+ </object>
+ <int key="connectionID">23</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="380026005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="822998190"/>
+ <reference ref="805750159"/>
+ <reference ref="116264069"/>
+ <reference ref="226437394"/>
+ <reference ref="405845083"/>
+ <reference ref="638077356"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="841351856"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="664661524"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="427554174"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="822998190"/>
+ <reference key="parent" ref="380026005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">13</int>
+ <reference key="object" ref="226437394"/>
+ <reference key="parent" ref="380026005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">15</int>
+ <reference key="object" ref="638077356"/>
+ <reference key="parent" ref="380026005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">16</int>
+ <reference key="object" ref="805750159"/>
+ <reference key="parent" ref="380026005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">17</int>
+ <reference key="object" ref="116264069"/>
+ <reference key="parent" ref="380026005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">18</int>
+ <reference key="object" ref="405845083"/>
+ <reference key="parent" ref="380026005"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>10.CustomClassName</string>
+ <string>10.IBPluginDependency</string>
+ <string>10.IBViewBoundsToFrameTransform</string>
+ <string>13.CustomClassName</string>
+ <string>13.IBPluginDependency</string>
+ <string>13.IBViewBoundsToFrameTransform</string>
+ <string>15.IBPluginDependency</string>
+ <string>15.IBViewBoundsToFrameTransform</string>
+ <string>16.IBPluginDependency</string>
+ <string>17.IBPluginDependency</string>
+ <string>17.IBViewBoundsToFrameTransform</string>
+ <string>18.IBPluginDependency</string>
+ <string>18.IBViewBoundsToFrameTransform</string>
+ <string>2.IBAttributePlaceholdersKey</string>
+ <string>2.IBEditorWindowLastContentRect</string>
+ <string>2.IBPluginDependency</string>
+ <string>3.CustomClassName</string>
+ <string>3.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UIApplication</string>
+ <string>UIResponder</string>
+ <string>SwipeWheel</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">AUMlAABDBAAAA</bytes>
+ </object>
+ <string>SwipeWheel</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABDJQAAw6gAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw9iAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">AUGgAABDEAAAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABBoAAAw54AAA</bytes>
+ </object>
+ <object class="NSMutableDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <string>{{198, 376}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>SwipeWheel_ExampleAppDelegate</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">23</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">SwipeWheel</string>
+ <string key="superclassName">UIControl</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>nextPage</string>
+ <string>previousPage</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>nextPage</string>
+ <string>previousPage</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">nextPage</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">previousPage</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">../SwipeWheel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">SwipeWheel</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">SwipeWheel_ExampleAppDelegate</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>colorWheelChanged</string>
+ <string>sizeWheelChanged</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>colorWheelChanged</string>
+ <string>sizeWheelChanged</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">colorWheelChanged</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">sizeWheelChanged</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>colorWheel</string>
+ <string>exampleLabel</string>
+ <string>sizeWheel</string>
+ <string>window</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>SwipeWheel</string>
+ <string>UILabel</string>
+ <string>SwipeWheel</string>
+ <string>UIWindow</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>colorWheel</string>
+ <string>exampleLabel</string>
+ <string>sizeWheel</string>
+ <string>window</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">colorWheel</string>
+ <string key="candidateClassName">SwipeWheel</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">exampleLabel</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">sizeWheel</string>
+ <string key="candidateClassName">SwipeWheel</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">window</string>
+ <string key="candidateClassName">UIWindow</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/SwipeWheel_ExampleAppDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">SwipeWheel_ExampleAppDelegate</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="427245348">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIApplication</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIControl</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UILabel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="427245348"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIWindow</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIWindow.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <integer value="1024" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3100" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">SwipeWheel Example.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">123</string>
+ </data>
+</archive>
258 SwipeWheel Example/SwipeWheel Example.xcodeproj/project.pbxproj
@@ -0,0 +1,258 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 093DB744124E70E5007AA9A8 /* SwipeWheel.m in Sources */ = {isa = PBXBuildFile; fileRef = 093DB743124E70E5007AA9A8 /* SwipeWheel.m */; };
+ 093DB756124E7372007AA9A8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 093DB755124E7372007AA9A8 /* QuartzCore.framework */; };
+ 1D3623260D0F684500981E51 /* SwipeWheel_ExampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* SwipeWheel_ExampleAppDelegate.m */; };
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
+ 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
+ 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 093DB742124E70E5007AA9A8 /* SwipeWheel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwipeWheel.h; path = ../SwipeWheel.h; sourceTree = SOURCE_ROOT; };
+ 093DB743124E70E5007AA9A8 /* SwipeWheel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SwipeWheel.m; path = ../SwipeWheel.m; sourceTree = SOURCE_ROOT; };
+ 093DB755124E7372007AA9A8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
+ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 1D3623240D0F684500981E51 /* SwipeWheel_ExampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwipeWheel_ExampleAppDelegate.h; sourceTree = "<group>"; };
+ 1D3623250D0F684500981E51 /* SwipeWheel_ExampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SwipeWheel_ExampleAppDelegate.m; sourceTree = "<group>"; };
+ 1D6058910D05DD3D006BFB54 /* SwipeWheel Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SwipeWheel Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
+ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 32CA4F630368D1EE00C91783 /* SwipeWheel_Example_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwipeWheel_Example_Prefix.pch; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* SwipeWheel_Example-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SwipeWheel_Example-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,
+ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,
+ 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */,
+ 093DB756124E7372007AA9A8 /* QuartzCore.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 1D3623240D0F684500981E51 /* SwipeWheel_ExampleAppDelegate.h */,
+ 1D3623250D0F684500981E51 /* SwipeWheel_ExampleAppDelegate.m */,
+ 093DB742124E70E5007AA9A8 /* SwipeWheel.h */,
+ 093DB743124E70E5007AA9A8 /* SwipeWheel.m */,
+ );
+ path = Classes;
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 1D6058910D05DD3D006BFB54 /* SwipeWheel Example.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = CustomTemplate;
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* SwipeWheel_Example_Prefix.pch */,
+ 29B97316FDCFA39411CA2CEA /* main.m */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 28AD733E0D9D9553002E5188 /* MainWindow.xib */,
+ 8D1107310486CEB800E47090 /* SwipeWheel_Example-Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
+ 1D30AB110D05D00D00671497 /* Foundation.framework */,
+ 288765FC0DF74451002DB57D /* CoreGraphics.framework */,
+ 093DB755124E7372007AA9A8 /* QuartzCore.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 1D6058900D05DD3D006BFB54 /* SwipeWheel Example */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SwipeWheel Example" */;
+ buildPhases = (
+ 1D60588D0D05DD3D006BFB54 /* Resources */,
+ 1D60588E0D05DD3D006BFB54 /* Sources */,
+ 1D60588F0D05DD3D006BFB54 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "SwipeWheel Example";
+ productName = "SwipeWheel Example";
+ productReference = 1D6058910D05DD3D006BFB54 /* SwipeWheel Example.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SwipeWheel Example" */;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 1D6058900D05DD3D006BFB54 /* SwipeWheel Example */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 1D60588D0D05DD3D006BFB54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 1D60588E0D05DD3D006BFB54 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 1D60589B0D05DD56006BFB54 /* main.m in Sources */,
+ 1D3623260D0F684500981E51 /* SwipeWheel_ExampleAppDelegate.m in Sources */,
+ 093DB744124E70E5007AA9A8 /* SwipeWheel.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1D6058940D05DD3E006BFB54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = SwipeWheel_Example_Prefix.pch;
+ INFOPLIST_FILE = "SwipeWheel_Example-Info.plist";
+ PRODUCT_NAME = "SwipeWheel Example";
+ };
+ name = Debug;
+ };
+ 1D6058950D05DD3E006BFB54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = SwipeWheel_Example_Prefix.pch;
+ INFOPLIST_FILE = "SwipeWheel_Example-Info.plist";
+ PRODUCT_NAME = "SwipeWheel Example";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ SDKROOT = iphoneos4.1;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ PREBINDING = NO;
+ SDKROOT = iphoneos4.1;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "SwipeWheel Example" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1D6058940D05DD3E006BFB54 /* Debug */,
+ 1D6058950D05DD3E006BFB54 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SwipeWheel Example" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
30 SwipeWheel Example/SwipeWheel_Example-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>NSMainNibFile</key>
+ <string>MainWindow</string>
+</dict>
+</plist>
8 SwipeWheel Example/SwipeWheel_Example_Prefix.pch
@@ -0,0 +1,8 @@
+//
+// Prefix header for all source files of the 'SwipeWheel Example' target in the 'SwipeWheel Example' project
+//
+
+#ifdef __OBJC__
+ #import <Foundation/Foundation.h>
+ #import <UIKit/UIKit.h>
+#endif
17 SwipeWheel Example/main.m
@@ -0,0 +1,17 @@
+//
+// main.m
+// SwipeWheel Example
+//
+// Created by Olivier on 25/09/10.
+// Copyright 2010 AliSoftware. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+int main(int argc, char *argv[]) {
+
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ int retVal = UIApplicationMain(argc, argv, nil, nil);
+ [pool release];
+ return retVal;
+}
33 SwipeWheel.h
@@ -0,0 +1,33 @@
+//
+// SwipeWheel.h
+// Test-SandBox
+//
+// Created by Olivier on 24/09/10.
+// Copyright 2010 AliSoftware. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <QuartzCore/QuartzCore.h>
+
+@interface SwipeWheel : UIControl<UIScrollViewDelegate> {
+ UIScrollView* _scrollView;
+ CAGradientLayer* _leftGradient;
+ CAGradientLayer* _rightGradient;
+}
+
+@property(nonatomic, retain) NSArray* texts;
+@property(nonatomic, retain) UIFont* itemsFont;
+@property(nonatomic, retain) UIColor* itemsTextColor;
+@property(nonatomic, retain) UIColor* itemsBorderColor;
+@property(nonatomic, assign) CGFloat itemsBorderWidth;
+
+@property(nonatomic, assign) CGFloat margins;
+@property(nonatomic, assign) BOOL activeMargins; //!< If true, tapping in the margins change the current page
+@property(nonatomic, retain) UIColor* fadingColor; //!< For the gradient in the margins to fade previous and next items
+@property(nonatomic, retain) CALayer* selectionIndicatorLayer; //!< For customisation, or showing/hiding it, etc.
+
+@property(nonatomic, assign) NSInteger currentPage; //!< The index of the active page
+-(IBAction)previousPage;
+-(IBAction)nextPage;
+@end
+
261 SwipeWheel.m
@@ -0,0 +1,261 @@
+//
+// SwipeWheel.m
+// Test-SandBox
+//
+// Created by Olivier on 24/09/10.
+// Copyright 2010 AliSoftware. All rights reserved.
+//
+
+#import "SwipeWheel.h"
+
+@interface SwipeWheel()
+-(void)configureView;
+@end
+
+
+@implementation SwipeWheel
+
+-(void)configureView {
+ // ScrollView
+ _scrollView = [[UIScrollView alloc] initWithFrame:CGRectZero];
+ _scrollView.pagingEnabled = YES;
+ _scrollView.showsVerticalScrollIndicator = NO;
+ _scrollView.showsHorizontalScrollIndicator = NO;
+ _scrollView.bounces = YES;
+ _scrollView.alwaysBounceHorizontal = YES;
+ _scrollView.clipsToBounds = NO;
+ _scrollView.delegate = self;
+ self.clipsToBounds = YES;
+ [self addSubview:_scrollView];
+
+
+ // Margin Gradients & Layers
+ NSArray* colors = [NSArray arrayWithObjects:(id)self.fadingColor.CGColor, (id)[UIColor clearColor].CGColor, nil];
+ _leftGradient = [[CAGradientLayer layer] retain];
+ _leftGradient.colors = colors;
+ _leftGradient.startPoint = CGPointMake(0.f, 0.5f);
+ _leftGradient.endPoint = CGPointMake(1.f, 0.5f);
+ [self.layer addSublayer:_leftGradient];
+
+ _rightGradient = [[CAGradientLayer layer] retain];
+ _rightGradient.colors = colors;
+ _rightGradient.startPoint = CGPointMake(1.f, 0.5f);
+ _rightGradient.endPoint = CGPointMake(0.f, 0.5f);
+ [self.layer addSublayer:_rightGradient];
+
+ self.selectionIndicatorLayer = [CALayer layer];
+ [self.layer addSublayer:self.selectionIndicatorLayer];
+
+ // Default values
+ self.currentPage = 0;
+ self.margins = 20;
+ self.selectionIndicatorLayer.borderColor = [UIColor grayColor].CGColor;
+ self.selectionIndicatorLayer.borderWidth = 1.f;
+ self.selectionIndicatorLayer.backgroundColor = [UIColor colorWithRed:0.7f green:0.7f blue:1.f alpha:0.3f].CGColor;
+ self.fadingColor = [UIColor blackColor];
+ self.layer.borderColor = [UIColor blackColor].CGColor;
+ self.layer.borderWidth = 1.f;
+ self.itemsFont = [UIFont systemFontOfSize:14];
+ self.itemsTextColor = [UIColor whiteColor];
+}
+
+-(id)initWithCoder:(NSCoder *)aDecoder {
+ if (nil != (self = [super initWithCoder:aDecoder])) {
+ [self configureView];
+ }
+ return self;
+}
+-(id)initWithFrame:(CGRect)frame {
+ if (nil != (self = [super initWithFrame:frame])) {
+ [self configureView];
+ }
+ return self;
+}
+
+-(void)layoutSubviews {
+ [super layoutSubviews];
+ CGRect newFrame = CGRectInset(self.bounds, self.margins, 0.f);
+ if (!CGRectEqualToRect(newFrame, _scrollView.frame)) {
+ // must do this check for bouncing to still work
+ _scrollView.frame = newFrame;
+ _scrollView.contentOffset = CGPointMake(self.currentPage*_scrollView.bounds.size.width, 0);
+ }
+
+ CGSize sz = _scrollView.bounds.size;
+ NSInteger idx = 0;
+ for(UIView* v in [_scrollView subviews]) {
+ v.frame = CGRectInset( CGRectMake(sz.width*idx, 0, sz.width, sz.height) , 3,3);
+ ++idx;
+ }
+ _scrollView.contentSize = CGSizeMake(sz.width*[[_scrollView subviews] count], sz.height);
+
+ _leftGradient.frame = CGRectMake(0, 0, self.margins, self.bounds.size.height);
+ _rightGradient.frame = CGRectMake(self.bounds.size.width-self.margins, 0, self.margins, self.bounds.size.height);
+ self.selectionIndicatorLayer.frame = _scrollView.frame;
+}
+
+-(void)dealloc {
+ [_scrollView release];
+ [_leftGradient release];
+ [_rightGradient release];
+
+ self.texts = nil;
+ self.itemsFont = nil;
+ self.itemsTextColor = nil;
+ self.itemsBorderColor = nil;
+ self.fadingColor = nil;
+ self.selectionIndicatorLayer = nil;
+
+ [super dealloc];
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+// MARK: -
+// MARK: Accessors
+/////////////////////////////////////////////////////////////////////////////
+
+@synthesize itemsFont = _itemsFont;
+-(void)setItemsFont:(UIFont *)newFont {
+ if (_itemsFont == newFont) return;
+ [_itemsFont release];
+ _itemsFont = [newFont retain];
+ for(UILabel* lbl in [_scrollView subviews]) {
+ lbl.font = newFont;
+ }
+}
+@synthesize itemsTextColor = _itemsTextColor;
+-(void)setItemsTextColor:(UIColor *)newColor {
+ if (_itemsTextColor == newColor) return;
+ [_itemsTextColor release];
+ _itemsTextColor = [newColor retain];
+ for(UILabel* lbl in [_scrollView subviews]) {
+ lbl.textColor = newColor;
+ }
+}
+
+
+@synthesize texts = _texts;
+-(void)setTexts:(NSArray *)newTexts {
+ if (_texts == newTexts) return;
+
+ [self willChangeValueForKey:@"texts"];
+ [_texts release];
+ _texts = [newTexts retain];
+
+ while ([[_scrollView subviews] count]>0)
+ [[[_scrollView subviews] objectAtIndex:0] removeFromSuperview];
+
+ int nbPages = [newTexts count];
+ for(int i=0;i<nbPages;i++) {
+ UILabel* lbl = [[UILabel alloc] initWithFrame:CGRectZero];
+ lbl.text = [_texts objectAtIndex:i];
+ lbl.font = self.itemsFont;
+ lbl.textColor = self.itemsTextColor;
+ lbl.numberOfLines = 10;
+ lbl.textAlignment = UITextAlignmentCenter;
+ lbl.backgroundColor = [UIColor clearColor];
+ lbl.layer.borderColor = self.itemsBorderColor.CGColor;
+ lbl.layer.borderWidth = self.itemsBorderWidth;
+
+ [_scrollView addSubview:lbl];
+
+ [lbl release];
+ }
+ CGSize sz = _scrollView.bounds.size;
+ _scrollView.contentSize = CGSizeMake(sz.width*[_texts count], sz.height);
+ [self didChangeValueForKey:@"texts"];
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+@synthesize currentPage = _currentPage;
+-(void)setCurrentPage:(NSInteger)newPage {
+ if (newPage>=[_texts count]) newPage = ([_texts count]>0)?[_texts count]-1:0;
+ if (newPage<0) newPage = 0;
+
+ if (newPage == _currentPage) return;
+
+ [self willChangeValueForKey:@"currentPage"];
+ _currentPage = newPage;
+ [_scrollView setContentOffset:CGPointMake(newPage*_scrollView.bounds.size.width, 0) animated:YES];
+ [self sendActionsForControlEvents:UIControlEventValueChanged];
+ [self didChangeValueForKey:@"currentPage"];
+}
+-(IBAction)previousPage {
+ if (self.currentPage>0)
+ [self setCurrentPage:self.currentPage-1];
+}
+-(IBAction)nextPage {
+ [self setCurrentPage:self.currentPage+1];
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+@synthesize margins = _margins;
+-(void)setMargins:(CGFloat)newMargins {
+ _margins = newMargins;
+ [self setNeedsLayout];
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+@synthesize selectionIndicatorLayer;
+
+@synthesize itemsBorderColor = _itemsBorderColor;
+-(void)setItemsBorderColor:(UIColor *)clr {
+ if (_itemsBorderColor == clr) return;
+ [_itemsBorderColor release];
+ _itemsBorderColor = [clr retain];
+ for(UIView* v in [_scrollView subviews]) {
+ v.layer.borderColor = clr.CGColor;
+ }
+}
+@synthesize itemsBorderWidth = _itemsBorderWidth;
+-(void)setItemsBorderWidth:(CGFloat)w {
+ _itemsBorderWidth = w;
+ for(UIView* v in [_scrollView subviews]) {
+ v.layer.borderWidth = w;
+ }
+}
+
+@synthesize fadingColor = _fadingColor;
+-(void)setFadingColor:(UIColor *)clr {
+ if (_fadingColor == clr) return;
+ [_fadingColor release];
+ _fadingColor = [clr retain];
+ _leftGradient.colors = [NSArray arrayWithObjects:(id)clr.CGColor,(id)[UIColor clearColor].CGColor,nil];
+ _rightGradient.colors = [NSArray arrayWithObjects:(id)clr.CGColor,(id)[UIColor clearColor].CGColor,nil];
+ [self setNeedsDisplay];
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+// MARK: -
+// MARK: Touches to change page
+/////////////////////////////////////////////////////////////////////////////
+
+
+- (void)scrollViewDidEndDecelerating:(UIScrollView *)aScrollView {
+ CGFloat w = _scrollView.bounds.size.width;
+ [self willChangeValueForKey:@"currentPage"];
+ _currentPage = roundf(_scrollView.contentOffset.x / w);
+ [self sendActionsForControlEvents:UIControlEventValueChanged];
+ [self didChangeValueForKey:@"currentPage"];
+}
+
+@synthesize activeMargins;
+-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ if (!self.activeMargins) return;
+ UITouch* touch = [touches anyObject];
+ CGPoint loc = [touch locationInView:self];
+ if (loc.x<self.bounds.size.width/2) {
+ [self previousPage];
+ } else if (loc.x>self.bounds.size.height-_margins) {
+ [self nextPage];
+ }
+}
+
+@end

0 comments on commit 7075a7d

Please sign in to comment.
Something went wrong with that request. Please try again.