Skip to content
Browse files

Initial commit of everything.

  • Loading branch information...
1 parent 3a8ed98 commit cfe644bf21cccbbd090ffdc4c8ab1af5ddb4866d @parisba parisba committed Jun 6, 2012
View
23 README.md
@@ -1,4 +1,21 @@
-SLNumberPickerView
-==================
+# SLNumberPickerView
-SLNumberPickerView is a control that presents a 3-digit number picker. It's very customisable, highly themable, and very easy to use.
+SLNumberPickerView is a control that presents a 3-digit number picker. It's very customisable, highly themable, and very easy to use.
+
+To learn what it can be used for, and how to use it, check out the [blog post](http://blog.secretlab.com.au/2012/07/06/slnumberpickerview/ "SLNumberPickerView on Secret Lab's blog").
+
+Please open an issue on GitHub if you'd like to make a request.
+
+You can email us at [lab@secretlab.com.au](mailto:lab@secretlab.com.au)
+
+## License
+
+SLNumberPickerView is licensed under the MIT license.
+
+Copyright (c) 2012 Secret Lab, Pty. Ltd.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
BIN SLNumberPicker/SLNumberPickerTicks.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN SLNumberPicker/SLNumberPickerTicks@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
31 SLNumberPicker/SLNumberPickerView.h
@@ -0,0 +1,31 @@
+//
+// SBLNumberPickerView.h
+// A themed number picker.
+//
+// Created by Jon Manning on 21/04/12.
+// Copyright (c) 2012 Secret Lab. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class SLNumberPickerView;
+
+@protocol SLNumberPickerViewDelegate <NSObject>
+
+- (void) numberPickerViewDidChangeValue:(SLNumberPickerView*)picker;
+
+@end
+
+@interface SLNumberPickerView : UIView <UIScrollViewDelegate>
+
++ (SLNumberPickerView*)numberPickerView;
+
+@property (strong, nonatomic) IBOutlet UIScrollView *number1;
+@property (strong, nonatomic) IBOutlet UIScrollView *number2;
+@property (strong, nonatomic) IBOutlet UIScrollView *number3;
+
+@property (readonly) NSInteger value;
+
+@property (nonatomic, weak) IBOutlet id <SLNumberPickerViewDelegate> delegate;
+
+@end
View
203 SLNumberPicker/SLNumberPickerView.m
@@ -0,0 +1,203 @@
+//
+// SBLNumberPickerView.m
+// A themed number picker.
+//
+// Created by Jon Manning on 21/04/12.
+// Copyright (c) 2012 Secret Lab. All rights reserved.
+//
+
+#import "SLNumberPickerView.h"
+
+@interface SLNumberPickerView () {
+ NSInteger _number1Value;
+ NSInteger _number2Value;
+ NSInteger _number3Value;
+
+ SLNumberPickerView* _internalPickerView;
+ BOOL _isStandIn;
+}
+
+@end
+
+@implementation SLNumberPickerView
+
+// *** v CHANGE THESE METHODS FOR CUSTOM APPEARANCE! v ***
+
+// What font should we use?
++ (UIFont*)numberFont {
+ return [UIFont fontWithName:@"Palatino" size:36];
+}
+
+// What color should the text be?
++ (UIColor*)numberColor {
+ return [UIColor blackColor];
+}
+
+// Which tiled image should we use for each column?
++ (UIImage*)backgroundImage {
+ return [UIImage imageNamed:@"SLNumberPickerTicks"];
+}
+
+// *** ^ CHANGE THESE METHODS FOR CUSTOM APPEARANCE! ^ ***
+
+
+@synthesize number1 = _number1;
+@synthesize number2 = _number2;
+@synthesize number3 = _number3;
+
+@synthesize delegate = _delegate;
+
+// Adapted from a technique from Yang Meyer:
+// https://blog.compeople.eu/apps/?p=142
+- (id) awakeAfterUsingCoder:(NSCoder*)aDecoder {
+
+ // We are a stand-in view if we have zero sub-views.
+ BOOL wasPlaceholder = ([[self subviews] count] == 0);
+
+ if (wasPlaceholder) {
+
+ // Load the real view, and add it as a subview of ourself. Also mark ourself
+ // as a stand-in view, so that we know to forward hit tests and requests for properties.
+ _internalPickerView = [SLNumberPickerView numberPickerView];
+ _internalPickerView.frame = self.bounds;
+ _isStandIn = YES;
+ [self addSubview:_internalPickerView];
+
+ // Set the background to clear, so that at design-time we can use an opaque color to help identify this custom view.
+ self.backgroundColor = [UIColor clearColor];
+ }
+
+ return self;
+}
+
+// Load the nib and return the newly-created picker view.
++ (SLNumberPickerView*)numberPickerView {
+ UINib* nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil];
+ NSArray* objects = [nib instantiateWithOwner:self options:nil];
+ return [objects objectAtIndex:0];
+}
+
+
+// Given a scroll view, fill it with labels from 0 to 9 - one label per "page".
+// Also add the tick marks as a background.
+- (void)prepareScrollView:(UIScrollView*)scrollView {
+
+ // Add 10 labels - 0 to 9.
+ for (int i = 0; i < 10; i++) {
+ UILabel* label = [[UILabel alloc] initWithFrame:scrollView.bounds];
+ label.backgroundColor = [UIColor clearColor];
+ label.textColor = [SLNumberPickerView numberColor];
+ label.font = [SLNumberPickerView numberFont];
+ label.textAlignment = UITextAlignmentCenter;
+
+ label.text = [NSString stringWithFormat:@"%i", i];
+
+ CGRect frame = label.frame;
+ frame.origin.y = frame.size.height * i;
+ frame.size.width -= 11; // allow for side ticks
+ label.frame = frame;
+ [scrollView addSubview:label];
+ scrollView.delegate = self;
+ }
+
+ // This scroll view is 10 pages tall, is paged, and does not clip to bounds.
+ // This is important, since we want to be able to see the numbers above and below the
+ // currently selected one.
+ scrollView.contentSize = CGSizeMake(scrollView.bounds.size.width, scrollView.bounds.size.height*10);
+ scrollView.pagingEnabled = YES;
+ scrollView.clipsToBounds = NO;
+
+ scrollView.showsVerticalScrollIndicator = NO;
+
+ // Add a view behind all of the numbers that is extremely tall and uses a tiled background image.
+ UIView* backgroundView = [[UIView alloc] initWithFrame:CGRectZero];
+ CGRect frame = (CGRect){CGPointMake(0, -scrollView.bounds.size.height*20), CGSizeMake(scrollView.bounds.size.width, scrollView.bounds.size.height*50)};
+ backgroundView.frame = frame;
+ [scrollView insertSubview:backgroundView atIndex:0];
+
+ backgroundView.backgroundColor = [UIColor colorWithPatternImage:[SLNumberPickerView backgroundImage]];
+}
+
+// When scroll views finish moving, we can check their value.
+- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
+ NSInteger page = scrollView.contentOffset.y / scrollView.bounds.size.height;
+
+ if (scrollView == self.number1)
+ _number1Value = page;
+ if (scrollView == self.number2)
+ _number2Value = page;
+ if (scrollView == self.number3)
+ _number3Value = page;
+
+ [self.delegate numberPickerViewDidChangeValue:self];
+
+}
+
+// On awakening, set up the columns if we're not a stand-in.
+- (void)awakeFromNib {
+
+ if (_isStandIn)
+ return;
+
+ [self prepareScrollView:_number1];
+ [self prepareScrollView:_number2];
+ [self prepareScrollView:_number3];
+}
+
+// Figure out the value based on the current number values.
+// If we're a stand-in, forward the request to the "real" number picker.
+- (NSInteger)value {
+
+ if (_isStandIn) {
+ return [_internalPickerView value];
+ }
+
+ return _number1Value * 100 + _number2Value * 10 + _number3Value;
+}
+
+// We want to be able to tap and drag any part of a column to move it, but only the
+// center number will handle touches by default. We fix this by overriding
+// hitTest:withEvent: to treat any touch in the general area of a column as belonging to
+// that column's scroll view.
+
+- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
+
+ if (_isStandIn) {
+ return [_internalPickerView hitTest:point withEvent:event];
+ }
+
+
+ // because all of the views are layed out in column fashion, the x coord of the touch corresponds to the view
+ CGFloat x = point.x;
+
+ if (x >= CGRectGetMinX(self.number1.frame) && x <= CGRectGetMaxX(self.number1.frame))
+ return self.number1;
+
+ if (x >= CGRectGetMinX(self.number2.frame) && x <= CGRectGetMaxX(self.number2.frame))
+ return self.number2;
+
+ if (x >= CGRectGetMinX(self.number3.frame) && x <= CGRectGetMaxX(self.number3.frame))
+ return self.number3;
+
+ if (CGRectContainsPoint(self.frame, point))
+ return self;
+
+
+ return nil;
+}
+
+- (void)setDelegate:(id<SLNumberPickerViewDelegate>)delegate {
+ if (_isStandIn)
+ [_internalPickerView setDelegate:delegate];
+ else
+ _delegate = delegate;
+}
+
+- (id<SLNumberPickerViewDelegate>)delegate {
+ if (_isStandIn)
+ return [_internalPickerView delegate];
+ else
+ return _delegate;
+}
+
+@end
View
314 SLNumberPicker/SLNumberPickerView.xib
@@ -0,0 +1,314 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
+ <data>
+ <int key="IBDocument.SystemTarget">1280</int>
+ <string key="IBDocument.SystemVersion">11D50b</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.32</string>
+ <string key="IBDocument.HIToolboxVersion">568.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">1179</string>
+ </object>
+ <array key="IBDocument.IntegratedClassDependencies">
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ <string>IBUIScrollView</string>
+ </array>
+ <array key="IBDocument.PluginDependencies">
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </array>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBUIView" id="783605762">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">1316</int>
+ <array class="NSMutableArray" key="NSSubviews">
+ <object class="IBUIView" id="67721065">
+ <reference key="NSNextResponder" ref="783605762"/>
+ <int key="NSvFlags">1300</int>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrame">{{1, 0}, {44, 106}}</string>
+ <reference key="NSSuperview" ref="783605762"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="944683776"/>
+ <object class="NSColor" key="IBUIBackgroundColor" id="147904324">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBUIView" id="506860109">
+ <reference key="NSNextResponder" ref="783605762"/>
+ <int key="NSvFlags">1301</int>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrame">{{49, 0}, {44, 106}}</string>
+ <reference key="NSSuperview" ref="783605762"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="656542930"/>
+ <reference key="IBUIBackgroundColor" ref="147904324"/>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBUIView" id="631144850">
+ <reference key="NSNextResponder" ref="783605762"/>
+ <int key="NSvFlags">1297</int>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrame">{{98, 0}, {44, 106}}</string>
+ <reference key="NSSuperview" ref="783605762"/>
+ <reference key="NSWindow"/>
+ <reference key="IBUIBackgroundColor" ref="147904324"/>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBUIScrollView" id="344273501">
+ <reference key="NSNextResponder" ref="783605762"/>
+ <int key="NSvFlags">1324</int>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrame">{{0, 32}, {47, 41}}</string>
+ <reference key="NSSuperview" ref="783605762"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBUIScrollView" id="944683776">
+ <reference key="NSNextResponder" ref="783605762"/>
+ <int key="NSvFlags">1325</int>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrame">{{48, 32}, {47, 41}}</string>
+ <reference key="NSSuperview" ref="783605762"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ <object class="IBUIScrollView" id="656542930">
+ <reference key="NSNextResponder" ref="783605762"/>
+ <int key="NSvFlags">1321</int>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrame">{{96, 32}, {47, 41}}</string>
+ <reference key="NSSuperview" ref="783605762"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <bool key="IBUIMultipleTouchEnabled">YES</bool>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ </array>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrameSize">{143, 105}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView" ref="344273501"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwAA</bytes>
+ </object>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <string key="targetRuntimeIdentifier">IBIPadFramework</string>
+ </object>
+ </array>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <array class="NSMutableArray" key="connectionRecords">
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">number3</string>
+ <reference key="source" ref="783605762"/>
+ <reference key="destination" ref="656542930"/>
+ </object>
+ <int key="connectionID">14</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">number1</string>
+ <reference key="source" ref="783605762"/>
+ <reference key="destination" ref="344273501"/>
+ </object>
+ <int key="connectionID">15</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">number2</string>
+ <reference key="source" ref="783605762"/>
+ <reference key="destination" ref="944683776"/>
+ </object>
+ <int key="connectionID">16</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="944683776"/>
+ <reference key="destination" ref="783605762"/>
+ </object>
+ <int key="connectionID">18</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="656542930"/>
+ <reference key="destination" ref="783605762"/>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="344273501"/>
+ <reference key="destination" ref="783605762"/>
+ </object>
+ <int key="connectionID">13</int>
+ </object>
+ </array>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <array key="orderedObjects">
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <array key="object" id="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="783605762"/>
+ <array class="NSMutableArray" key="children">
+ <reference ref="67721065"/>
+ <reference ref="506860109"/>
+ <reference ref="631144850"/>
+ <reference ref="344273501"/>
+ <reference ref="656542930"/>
+ <reference ref="944683776"/>
+ </array>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">12</int>
+ <reference key="object" ref="67721065"/>
+ <reference key="parent" ref="783605762"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="506860109"/>
+ <reference key="parent" ref="783605762"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="631144850"/>
+ <reference key="parent" ref="783605762"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="344273501"/>
+ <array class="NSMutableArray" key="children"/>
+ <reference key="parent" ref="783605762"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="656542930"/>
+ <reference key="parent" ref="783605762"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7</int>
+ <reference key="object" ref="944683776"/>
+ <reference key="parent" ref="783605762"/>
+ </object>
+ </array>
+ </object>
+ <dictionary class="NSMutableDictionary" key="flattenedProperties">
+ <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="-2.CustomClassName">UIResponder</string>
+ <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <reference key="10.IBUserGuides" ref="0"/>
+ <boolean value="NO" key="10.showNotes"/>
+ <string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <reference key="11.IBUserGuides" ref="0"/>
+ <boolean value="NO" key="11.showNotes"/>
+ <string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <reference key="12.IBUserGuides" ref="0"/>
+ <boolean value="NO" key="12.showNotes"/>
+ <string key="3.CustomClassName">SLNumberPickerView</string>
+ <string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <reference key="3.IBUserGuides" ref="0"/>
+ <boolean value="NO" key="3.showNotes"/>
+ <string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <reference key="7.IBUserGuides" ref="0"/>
+ <boolean value="NO" key="7.showNotes"/>
+ <string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <reference key="8.IBUserGuides" ref="0"/>
+ <boolean value="NO" key="8.showNotes"/>
+ <string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <reference key="9.IBUserGuides" ref="0"/>
+ <boolean value="NO" key="9.showNotes"/>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
+ <nil key="activeLocalization"/>
+ <dictionary class="NSMutableDictionary" key="localizations"/>
+ <nil key="sourceID"/>
+ <int key="maxID">18</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <array class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <object class="IBPartialClassDescription">
+ <string key="className">SLNumberPickerView</string>
+ <string key="superclassName">UIView</string>
+ <dictionary class="NSMutableDictionary" key="outlets">
+ <string key="delegate">id</string>
+ <string key="number1">UIScrollView</string>
+ <string key="number2">UIScrollView</string>
+ <string key="number3">UIScrollView</string>
+ </dictionary>
+ <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <object class="IBToOneOutletInfo" key="delegate">
+ <string key="name">delegate</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="number1">
+ <string key="name">number1</string>
+ <string key="candidateClassName">UIScrollView</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="number2">
+ <string key="name">number2</string>
+ <string key="candidateClassName">UIScrollView</string>
+ </object>
+ <object class="IBToOneOutletInfo" key="number3">
+ <string key="name">number3</string>
+ <string key="candidateClassName">UIScrollView</string>
+ </object>
+ </dictionary>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/SLNumberPickerView.h</string>
+ </object>
+ </object>
+ </array>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">1179</string>
+ </data>
+</archive>
View
310 Sample Project/NumberPicker.xcodeproj/project.pbxproj
@@ -0,0 +1,310 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 6801F803157F69D7003F1A68 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6801F802157F69D7003F1A68 /* UIKit.framework */; };
+ 6801F805157F69D7003F1A68 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6801F804157F69D7003F1A68 /* Foundation.framework */; };
+ 6801F807157F69D7003F1A68 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6801F806157F69D7003F1A68 /* CoreGraphics.framework */; };
+ 6801F80D157F69D7003F1A68 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6801F80B157F69D7003F1A68 /* InfoPlist.strings */; };
+ 6801F80F157F69D7003F1A68 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6801F80E157F69D7003F1A68 /* main.m */; };
+ 6801F813157F69D7003F1A68 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6801F812157F69D7003F1A68 /* AppDelegate.m */; };
+ 6801F816157F69D7003F1A68 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6801F814157F69D7003F1A68 /* MainStoryboard.storyboard */; };
+ 6801F819157F69D7003F1A68 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6801F818157F69D7003F1A68 /* ViewController.m */; };
+ 6801F82A157F6E82003F1A68 /* SLNumberPickerTicks.png in Resources */ = {isa = PBXBuildFile; fileRef = 6801F828157F6E82003F1A68 /* SLNumberPickerTicks.png */; };
+ 6801F82B157F6E82003F1A68 /* SLNumberPickerTicks@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6801F829157F6E82003F1A68 /* SLNumberPickerTicks@2x.png */; };
+ 6801F82C157F7080003F1A68 /* SLNumberPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6801F826157F6D93003F1A68 /* SLNumberPickerView.m */; };
+ 6801F82D157F7092003F1A68 /* SLNumberPickerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6801F827157F6D93003F1A68 /* SLNumberPickerView.xib */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 6801F7FE157F69D7003F1A68 /* NumberPicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NumberPicker.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 6801F802157F69D7003F1A68 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
+ 6801F804157F69D7003F1A68 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 6801F806157F69D7003F1A68 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
+ 6801F80A157F69D7003F1A68 /* NumberPicker-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NumberPicker-Info.plist"; sourceTree = "<group>"; };
+ 6801F80C157F69D7003F1A68 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 6801F80E157F69D7003F1A68 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 6801F810157F69D7003F1A68 /* NumberPicker-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NumberPicker-Prefix.pch"; sourceTree = "<group>"; };
+ 6801F811157F69D7003F1A68 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 6801F812157F69D7003F1A68 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
+ 6801F815157F69D7003F1A68 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
+ 6801F817157F69D7003F1A68 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
+ 6801F818157F69D7003F1A68 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+ 6801F825157F6D93003F1A68 /* SLNumberPickerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SLNumberPickerView.h; sourceTree = "<group>"; };
+ 6801F826157F6D93003F1A68 /* SLNumberPickerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SLNumberPickerView.m; sourceTree = "<group>"; };
+ 6801F827157F6D93003F1A68 /* SLNumberPickerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SLNumberPickerView.xib; sourceTree = "<group>"; };
+ 6801F828157F6E82003F1A68 /* SLNumberPickerTicks.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SLNumberPickerTicks.png; sourceTree = "<group>"; };
+ 6801F829157F6E82003F1A68 /* SLNumberPickerTicks@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SLNumberPickerTicks@2x.png"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 6801F7FB157F69D7003F1A68 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 6801F803157F69D7003F1A68 /* UIKit.framework in Frameworks */,
+ 6801F805157F69D7003F1A68 /* Foundation.framework in Frameworks */,
+ 6801F807157F69D7003F1A68 /* CoreGraphics.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 6801F7F3157F69D6003F1A68 = {
+ isa = PBXGroup;
+ children = (
+ 6801F823157F6D8B003F1A68 /* SLNumberPicker */,
+ 6801F808157F69D7003F1A68 /* NumberPicker */,
+ 6801F801157F69D7003F1A68 /* Frameworks */,
+ 6801F7FF157F69D7003F1A68 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 6801F7FF157F69D7003F1A68 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 6801F7FE157F69D7003F1A68 /* NumberPicker.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 6801F801157F69D7003F1A68 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 6801F802157F69D7003F1A68 /* UIKit.framework */,
+ 6801F804157F69D7003F1A68 /* Foundation.framework */,
+ 6801F806157F69D7003F1A68 /* CoreGraphics.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 6801F808157F69D7003F1A68 /* NumberPicker */ = {
+ isa = PBXGroup;
+ children = (
+ 6801F811157F69D7003F1A68 /* AppDelegate.h */,
+ 6801F812157F69D7003F1A68 /* AppDelegate.m */,
+ 6801F814157F69D7003F1A68 /* MainStoryboard.storyboard */,
+ 6801F817157F69D7003F1A68 /* ViewController.h */,
+ 6801F818157F69D7003F1A68 /* ViewController.m */,
+ 6801F809157F69D7003F1A68 /* Supporting Files */,
+ );
+ path = NumberPicker;
+ sourceTree = "<group>";
+ };
+ 6801F809157F69D7003F1A68 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 6801F80A157F69D7003F1A68 /* NumberPicker-Info.plist */,
+ 6801F80B157F69D7003F1A68 /* InfoPlist.strings */,
+ 6801F80E157F69D7003F1A68 /* main.m */,
+ 6801F810157F69D7003F1A68 /* NumberPicker-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 6801F823157F6D8B003F1A68 /* SLNumberPicker */ = {
+ isa = PBXGroup;
+ children = (
+ 6801F828157F6E82003F1A68 /* SLNumberPickerTicks.png */,
+ 6801F829157F6E82003F1A68 /* SLNumberPickerTicks@2x.png */,
+ 6801F825157F6D93003F1A68 /* SLNumberPickerView.h */,
+ 6801F826157F6D93003F1A68 /* SLNumberPickerView.m */,
+ 6801F827157F6D93003F1A68 /* SLNumberPickerView.xib */,
+ );
+ name = SLNumberPicker;
+ path = ../SLNumberPicker;
+ sourceTree = SOURCE_ROOT;
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 6801F7FD157F69D7003F1A68 /* NumberPicker */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 6801F81C157F69D7003F1A68 /* Build configuration list for PBXNativeTarget "NumberPicker" */;
+ buildPhases = (
+ 6801F7FA157F69D7003F1A68 /* Sources */,
+ 6801F7FB157F69D7003F1A68 /* Frameworks */,
+ 6801F7FC157F69D7003F1A68 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = NumberPicker;
+ productName = NumberPicker;
+ productReference = 6801F7FE157F69D7003F1A68 /* NumberPicker.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 6801F7F5157F69D6003F1A68 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0430;
+ ORGANIZATIONNAME = "Secret Lab";
+ };
+ buildConfigurationList = 6801F7F8157F69D6003F1A68 /* Build configuration list for PBXProject "NumberPicker" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 6801F7F3157F69D6003F1A68;
+ productRefGroup = 6801F7FF157F69D7003F1A68 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 6801F7FD157F69D7003F1A68 /* NumberPicker */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 6801F7FC157F69D7003F1A68 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 6801F80D157F69D7003F1A68 /* InfoPlist.strings in Resources */,
+ 6801F816157F69D7003F1A68 /* MainStoryboard.storyboard in Resources */,
+ 6801F82A157F6E82003F1A68 /* SLNumberPickerTicks.png in Resources */,
+ 6801F82B157F6E82003F1A68 /* SLNumberPickerTicks@2x.png in Resources */,
+ 6801F82D157F7092003F1A68 /* SLNumberPickerView.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 6801F7FA157F69D7003F1A68 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 6801F80F157F69D7003F1A68 /* main.m in Sources */,
+ 6801F813157F69D7003F1A68 /* AppDelegate.m in Sources */,
+ 6801F819157F69D7003F1A68 /* ViewController.m in Sources */,
+ 6801F82C157F7080003F1A68 /* SLNumberPickerView.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 6801F80B157F69D7003F1A68 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 6801F80C157F69D7003F1A68 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 6801F814157F69D7003F1A68 /* MainStoryboard.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 6801F815157F69D7003F1A68 /* en */,
+ );
+ name = MainStoryboard.storyboard;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 6801F81A157F69D7003F1A68 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ SDKROOT = iphoneos;
+ };
+ name = Debug;
+ };
+ 6801F81B157F69D7003F1A68 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
+ SDKROOT = iphoneos;
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 6801F81D157F69D7003F1A68 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "NumberPicker/NumberPicker-Prefix.pch";
+ INFOPLIST_FILE = "NumberPicker/NumberPicker-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ 6801F81E157F69D7003F1A68 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "NumberPicker/NumberPicker-Prefix.pch";
+ INFOPLIST_FILE = "NumberPicker/NumberPicker-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 6801F7F8157F69D6003F1A68 /* Build configuration list for PBXProject "NumberPicker" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 6801F81A157F69D7003F1A68 /* Debug */,
+ 6801F81B157F69D7003F1A68 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 6801F81C157F69D7003F1A68 /* Build configuration list for PBXNativeTarget "NumberPicker" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 6801F81D157F69D7003F1A68 /* Debug */,
+ 6801F81E157F69D7003F1A68 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 6801F7F5157F69D6003F1A68 /* Project object */;
+}
View
15 Sample Project/NumberPicker/AppDelegate.h
@@ -0,0 +1,15 @@
+//
+// AppDelegate.h
+// NumberPicker
+//
+// Created by Jon Manning on 6/06/12.
+// Copyright (c) 2012 Secret Lab. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
View
48 Sample Project/NumberPicker/AppDelegate.m
@@ -0,0 +1,48 @@
+//
+// AppDelegate.m
+// NumberPicker
+//
+// Created by Jon Manning on 6/06/12.
+// Copyright (c) 2012 Secret Lab. All rights reserved.
+//
+
+#import "AppDelegate.h"
+
+@implementation AppDelegate
+
+@synthesize window = _window;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ // Override point for customization after application launch.
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+@end
View
40 Sample Project/NumberPicker/NumberPicker-Info.plist
@@ -0,0 +1,40 @@
+<?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>en</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>co.secretlab.${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>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UIMainStoryboardFile</key>
+ <string>MainStoryboard</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
View
14 Sample Project/NumberPicker/NumberPicker-Prefix.pch
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'NumberPicker' target in the 'NumberPicker' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_5_0
+#warning "This project uses features only available in iOS SDK 5.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
View
16 Sample Project/NumberPicker/ViewController.h
@@ -0,0 +1,16 @@
+//
+// ViewController.h
+// NumberPicker
+//
+// Created by Jon Manning on 6/06/12.
+// Copyright (c) 2012 Secret Lab. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "SLNumberPickerView.h"
+
+@interface ViewController : UIViewController <SLNumberPickerViewDelegate>
+
+@property (strong, nonatomic) IBOutlet UILabel *valueLabel;
+
+@end
View
28 Sample Project/NumberPicker/ViewController.m
@@ -0,0 +1,28 @@
+//
+// ViewController.m
+// NumberPicker
+//
+// Created by Jon Manning on 6/06/12.
+// Copyright (c) 2012 Secret Lab. All rights reserved.
+//
+
+#import "ViewController.h"
+
+@interface ViewController ()
+
+@end
+
+@implementation ViewController
+@synthesize valueLabel;
+
+- (void)numberPickerViewDidChangeValue:(SLNumberPickerView *)picker {
+ NSString* valueString = [NSString stringWithFormat:@"Value: %i", picker.value];
+ valueLabel.text = valueString;
+}
+
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
+ return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
+}
+
+@end
View
2 Sample Project/NumberPicker/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
65 Sample Project/NumberPicker/en.lproj/MainStoryboard.storyboard
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11D50b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="2">
+ <dependencies>
+ <deployment defaultVersion="1296" identifier="iOS"/>
+ <development defaultVersion="4200" identifier="xcode"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1179"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="5">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
+ <viewController id="2" customClass="ViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="3">
+ <rect key="frame" x="0.0" y="20" width="320" height="460"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <view contentMode="scaleToFill" id="FFs-ld-uUz" customClass="SLNumberPickerView">
+ <rect key="frame" x="89" y="35" width="143" height="140"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
+ <connections>
+ <outlet property="delegate" destination="2" id="YEQ-QL-2kM"/>
+ </connections>
+ </view>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Value: 0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="Vr1-fZ-6kf">
+ <rect key="frame" x="112" y="195" width="96" height="21"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <connections>
+ <outlet property="valueLabel" destination="Vr1-fZ-6kf" id="ZZu-hb-UAF"/>
+ </connections>
+ </viewController>
+ </objects>
+ </scene>
+ </scenes>
+ <classes>
+ <class className="SLNumberPickerView" superclassName="UIView">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/SLNumberPickerView.h"/>
+ <relationships>
+ <relationship kind="outlet" name="delegate"/>
+ <relationship kind="outlet" name="number1" candidateClass="UIScrollView"/>
+ <relationship kind="outlet" name="number2" candidateClass="UIScrollView"/>
+ <relationship kind="outlet" name="number3" candidateClass="UIScrollView"/>
+ </relationships>
+ </class>
+ <class className="ViewController" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/ViewController.h"/>
+ <relationships>
+ <relationship kind="outlet" name="valueLabel" candidateClass="UILabel"/>
+ </relationships>
+ </class>
+ </classes>
+ <simulatedMetricsContainer key="defaultSimulatedMetrics">
+ <simulatedStatusBarMetrics key="statusBar"/>
+ <simulatedOrientationMetrics key="orientation"/>
+ <simulatedScreenMetrics key="destination"/>
+ </simulatedMetricsContainer>
+</document>
View
18 Sample Project/NumberPicker/main.m
@@ -0,0 +1,18 @@
+//
+// main.m
+// NumberPicker
+//
+// Created by Jon Manning on 6/06/12.
+// Copyright (c) 2012 Secret Lab. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "AppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+ @autoreleasepool {
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}

0 comments on commit cfe644b

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