Permalink
Browse files

first commit

  • Loading branch information...
funkyboy committed Feb 23, 2012
0 parents commit 392c29f0de3f987da166b603bc483f89314e459d
Showing with 1,228 additions and 0 deletions.
  1. BIN .DS_Store
  2. +6 −0 README
  3. +347 −0 RotaryWheelProject.xcodeproj/project.pbxproj
  4. +7 −0 RotaryWheelProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  5. BIN ....xcodeproj/project.xcworkspace/xcuserdata/cesarerocchi.xcuserdatad/UserInterfaceState.xcuserstate
  6. +5 −0 RotaryWheelProject.xcodeproj/xcuserdata/cesarerocchi.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  7. +84 −0 ...yWheelProject.xcodeproj/xcuserdata/cesarerocchi.xcuserdatad/xcschemes/RotaryWheelProject.xcscheme
  8. +22 −0 RotaryWheelProject.xcodeproj/xcuserdata/cesarerocchi.xcuserdatad/xcschemes/xcschememanagement.plist
  9. +40 −0 RotaryWheelProject/RotaryWheelProject-Info.plist
  10. +14 −0 RotaryWheelProject/RotaryWheelProject-Prefix.pch
  11. +18 −0 RotaryWheelProject/SMAppDelegate.h
  12. +66 −0 RotaryWheelProject/SMAppDelegate.m
  13. +17 −0 RotaryWheelProject/SMClove.h
  14. +20 −0 RotaryWheelProject/SMClove.m
  15. +14 −0 RotaryWheelProject/SMRotaryProtocol.h
  16. +32 −0 RotaryWheelProject/SMRotaryWheel.h
  17. +341 −0 RotaryWheelProject/SMRotaryWheel.m
  18. +16 −0 RotaryWheelProject/SMViewController.h
  19. +40 −0 RotaryWheelProject/SMViewController.m
  20. BIN RotaryWheelProject/bg.png
  21. BIN RotaryWheelProject/centerButton.png
  22. +2 −0 RotaryWheelProject/en.lproj/InfoPlist.strings
  23. +119 −0 RotaryWheelProject/en.lproj/SMViewController.xib
  24. BIN RotaryWheelProject/icon0.png
  25. BIN RotaryWheelProject/icon1.png
  26. BIN RotaryWheelProject/icon2.png
  27. BIN RotaryWheelProject/icon3.png
  28. BIN RotaryWheelProject/icon4.png
  29. BIN RotaryWheelProject/icon5.png
  30. BIN RotaryWheelProject/icon6.png
  31. BIN RotaryWheelProject/icon7.png
  32. +18 −0 RotaryWheelProject/main.m
  33. BIN RotaryWheelProject/segment.png
BIN .DS_Store
Binary file not shown.
6 README
@@ -0,0 +1,6 @@
+In case you want to use this code in your projects, you can.
+Just check out the license.txt file for attribution.
+
+This project extends a UIView.
+A version extending UIComponent is available at:
+https://github.com/funkyboy/How-To-Create-a-Rotating-Wheel-Control-with-UIKit

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+ type = "1"
+ version = "1.0">
+</Bucket>
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BDF4384D14E55A0D00A27135"
+ BuildableName = "RotaryWheelProject.app"
+ BlueprintName = "RotaryWheelProject"
+ ReferencedContainer = "container:RotaryWheelProject.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BDF4384D14E55A0D00A27135"
+ BuildableName = "RotaryWheelProject.app"
+ BlueprintName = "RotaryWheelProject"
+ ReferencedContainer = "container:RotaryWheelProject.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BDF4384D14E55A0D00A27135"
+ BuildableName = "RotaryWheelProject.app"
+ BlueprintName = "RotaryWheelProject"
+ ReferencedContainer = "container:RotaryWheelProject.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "BDF4384D14E55A0D00A27135"
+ BuildableName = "RotaryWheelProject.app"
+ BlueprintName = "RotaryWheelProject"
+ ReferencedContainer = "container:RotaryWheelProject.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
@@ -0,0 +1,22 @@
+<?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>SchemeUserState</key>
+ <dict>
+ <key>RotaryWheelProject.xcscheme</key>
+ <dict>
+ <key>orderHint</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>SuppressBuildableAutocreation</key>
+ <dict>
+ <key>BDF4384D14E55A0D00A27135</key>
+ <dict>
+ <key>primary</key>
+ <true/>
+ </dict>
+ </dict>
+</dict>
+</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>CFBundleIconFiles</key>
+ <array/>
+ <key>CFBundleIdentifier</key>
+ <string>com.studiomagnolia.${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>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
@@ -0,0 +1,14 @@
+//
+// Prefix header for all source files of the 'RotaryWheelProject' target in the 'RotaryWheelProject' project
+//
+
+#import <Availability.h>
+
+#ifndef __IPHONE_4_0
+#warning "This project uses features only available in iOS SDK 4.0 and later."
+#endif
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+ #import <Foundation/Foundation.h>
+#endif
@@ -0,0 +1,18 @@
+//
+// SMRotaryWheel.m
+// RotaryWheelProject
+//
+// Created by cesarerocchi on 2/10/12.
+// Copyright (c) 2012 studiomagnolia.com. All rights reserved.
+
+#import <UIKit/UIKit.h>
+
+@class SMViewController;
+
+@interface SMAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@property (strong, nonatomic) SMViewController *viewController;
+
+@end
@@ -0,0 +1,66 @@
+//
+// SMRotaryWheel.m
+// RotaryWheelProject
+//
+// Created by cesarerocchi on 2/10/12.
+// Copyright (c) 2012 studiomagnolia.com. All rights reserved.
+
+#import "SMAppDelegate.h"
+
+#import "SMViewController.h"
+
+@implementation SMAppDelegate
+
+@synthesize window = _window;
+@synthesize viewController = _viewController;
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ // Override point for customization after application launch.
+ self.viewController = [[SMViewController alloc] initWithNibName:@"SMViewController" bundle:nil];
+ self.window.rootViewController = self.viewController;
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, 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
@@ -0,0 +1,17 @@
+//
+// SMRotaryWheel.m
+// RotaryWheelProject
+//
+// Created by cesarerocchi on 2/10/12.
+// Copyright (c) 2012 studiomagnolia.com. All rights reserved.
+
+#import <Foundation/Foundation.h>
+
+@interface SMClove : NSObject
+
+@property float minValue;
+@property float maxValue;
+@property float midValue;
+@property int value;
+
+@end
@@ -0,0 +1,20 @@
+//
+// SMRotaryWheel.m
+// RotaryWheelProject
+//
+// Created by cesarerocchi on 2/10/12.
+// Copyright (c) 2012 studiomagnolia.com. All rights reserved.
+
+#import "SMClove.h"
+
+@implementation SMClove
+
+@synthesize minValue, maxValue, midValue, value;
+
+- (NSString *) description {
+
+ return [NSString stringWithFormat:@"%i | %f, %f, %f", self.value, self.minValue, self.midValue, self.maxValue];
+
+}
+
+@end
@@ -0,0 +1,14 @@
+//
+// SMRotaryWheel.m
+// RotaryWheelProject
+//
+// Created by cesarerocchi on 2/10/12.
+// Copyright (c) 2012 studiomagnolia.com. All rights reserved.
+
+#import <Foundation/Foundation.h>
+
+@protocol SMRotaryProtocol <NSObject>
+
+- (void) didChangeValue:(NSString *)newValue;
+
+@end
@@ -0,0 +1,32 @@
+//
+// SMRotaryWheel.m
+// RotaryWheelProject
+//
+// Created by cesarerocchi on 2/10/12.
+// Copyright (c) 2012 studiomagnolia.com. All rights reserved.
+
+#import <UIKit/UIKit.h>
+#import "SMRotaryProtocol.h"
+#import "SMClove.h"
+
+@interface SMRotaryWheel : UIView
+
+@property (weak) id <SMRotaryProtocol> delegate;
+@property (nonatomic, strong) UIView *container;
+@property (nonatomic, strong) NSMutableArray *cloves;
+@property CGAffineTransform startTransform;
+@property int currentValue;
+@property int numberOfSections;
+@property CGPoint wheelCenter;
+@property (nonatomic, strong) NSMutableDictionary *cloveNames;
+
+- (id) initWithFrame:(CGRect)frame andDelegate:(id)del withSections:(int)sectionsNumber;
+- (void) initWheel;
+- (void) buildClovesEven;
+- (void) buildClovesOdd;
+- (float) calculateDistanceFromCenter:(CGPoint)point;
+- (UILabel *) getLabelByValue:(int)value;
+- (NSString *) getCloveName:(int)position;
+
+
+@end
Oops, something went wrong.

0 comments on commit 392c29f

Please sign in to comment.