Permalink
Browse files

Revert "add all controls"

This reverts commit af9111b.
  • Loading branch information...
1 parent af9111b commit af4e0db1b494016a4cd60396a2fd2489c0f2858d @leontiy leontiy committed Jun 3, 2012
@@ -1,13 +0,0 @@
-//
-// ActionSheetController.h
-// PickerOverlaySample
-//
-// Created by Aleksandr Nikiforov on 5/10/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface ActionSheetController : UIViewController
-- (IBAction)showActionSheet:(id)sender;
-@end
@@ -1,41 +0,0 @@
-//
-// ActionSheetController.m
-// PickerOverlaySample
-//
-// Created by Aleksandr Nikiforov on 5/10/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import "ActionSheetController.h"
-#import "IXActionSheetController.h"
-
-@interface ActionSheetController ()
-@end
-
-@implementation ActionSheetController
-
-- (void)viewDidAppear:(BOOL)animated
-{
- [super viewDidAppear:animated];
-
- [self showActionSheet:nil];
-}
-
-- (IBAction)showActionSheet:(id)sender {
- IXActionSheetController *asc = [[IXActionSheetController alloc] init];
- [asc addButtonWithTitle:@"Share on Facebook" andAction:^{
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Shared on Facebook" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
- [alert show];
- }];
-
- [asc setCancelButtonTitle:@"Cancel" andAction:nil];
-
- [asc setDestructiveButtonTitle:@"rm -rf /" andAction:^{
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success!" message:nil delegate:nil cancelButtonTitle:@"Gosh!" otherButtonTitles:nil];
- [alert show];
- }];
-
- [asc.actionSheet showInView:self.view];
-}
-
-@end
@@ -1,15 +0,0 @@
-//
-// BrightnessSliderView.h
-// PickerOverlaySample
-//
-// Created by Aleksandr Nikiforov on 5/10/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import "IXColorPickerView.h"
-
-@interface BrightnessSliderView : UIView
-@property (weak, nonatomic) IBOutlet IXColorPickerView *colorCircle;
-@property (nonatomic) CGSize insetGradient;
-@end
@@ -1,90 +0,0 @@
-//
-// BrightnessSliderView.m
-// PickerOverlaySample
-//
-// Created by Aleksandr Nikiforov on 5/10/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import "BrightnessSliderView.h"
-#import <QuartzCore/QuartzCore.h>
-
-@implementation BrightnessSliderView{
- UIView* back;
- UIImageView* slider;
- UIButton* brightnessButton;
- CAGradientLayer *layer;
-}
-@synthesize colorCircle;
-@synthesize insetGradient = _insetGradient;
-
-- (void)doInit {
- self.backgroundColor = [UIColor clearColor];
- _insetGradient.width = 0;
- _insetGradient.height = 0;
-
-
- UIImage *sliderImage = [UIImage imageNamed:@"brightnessSlider"];
- slider = [[UIImageView alloc]initWithImage:sliderImage];
- layer = [[CAGradientLayer alloc]init];
- layer.frame = self.bounds;
- layer.colors = [NSArray arrayWithObjects:
- (id)[UIColor clearColor].CGColor,
- (id)[UIColor blackColor].CGColor,
- nil];
-
- back = [[UIView alloc]initWithFrame:layer.frame];
- back.backgroundColor = [UIColor whiteColor];
- [self addSubview:back];
- [self.layer addSublayer:layer];
- [self addSubview:slider];
-
-
- brightnessButton = [[UIButton alloc]initWithFrame:self.bounds];
- [brightnessButton addTarget:self action:@selector(changeBrightness:forEvent:) forControlEvents:UIControlEventTouchDown];
- [brightnessButton addTarget:self action:@selector(changeBrightness:forEvent:) forControlEvents:UIControlEventTouchDragInside];
- [brightnessButton addTarget:self action:@selector(changeBrightness:forEvent:) forControlEvents:UIControlEventTouchDragOutside];
- [self addSubview:brightnessButton];
-}
-
-- (id)initWithFrame:(CGRect)frame
-{
- self = [super initWithFrame:frame];
- if (self) {
- [self doInit];
- }
- return self;
-}
-
-- (id)initWithCoder:(NSCoder *)aDecoder {
- self = [super initWithCoder:aDecoder];
- if (self) {
- [self doInit];
- }
- return self;
-}
-
--(void)colorPickerDidChangeSelection:(IXColorPickerView*)colorPicker {
- CGPoint center = slider.center;
- center.y = back.bounds.origin.y + (1 - colorPicker.brightness) * back.bounds.size.height+_insetGradient.height;
- slider.center = center;
- back.backgroundColor = [colorPicker colorAtPoint:colorPicker.selectedPoint withBrightness:1];
-
-}
-- (IBAction)changeBrightness:(UIView*)sender forEvent:(UIEvent*)event {
- UITouch* touch = [event touchesForView:sender].anyObject;
- CGPoint loc = [touch locationInView:back];
- CGFloat brightness = 1 - (loc.y / back.bounds.size.height);
- brightness = MIN(brightness, 1);
- brightness = MAX(brightness, 0);
- [self.colorCircle setBrightness:brightness];
-}
-- (void)setInsetGradient:(CGSize)insetGradient {
-
- _insetGradient = insetGradient;
- CGRect rect = CGRectMake(self.bounds.origin.x+_insetGradient.width, self.bounds.origin.y+_insetGradient.height, self.bounds.size.width-2*_insetGradient.width,self.bounds.size.height-2*_insetGradient.height);
- layer.frame = rect;
- back.frame = rect;
-}
-
-@end
@@ -1,16 +0,0 @@
-//
-// ColorPickerControllerViewController.h
-// PickerOverlaySample
-//
-// Created by Aleksandr Nikiforov on 5/10/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import "BrightnessSliderView.h"
-
-@interface ColorPickerControllerViewController : UIViewController
-@property (weak, nonatomic) IBOutlet BrightnessSliderView *slider;
-
-
-@end
@@ -1,50 +0,0 @@
-//
-// ColorPickerControllerViewController.m
-// PickerOverlaySample
-//
-// Created by Aleksandr Nikiforov on 5/10/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-#import "ColorPickerControllerViewController.h"
-
-
-
-@interface ColorPickerControllerViewController ()
-
-@end
-
-@implementation ColorPickerControllerViewController
-@synthesize slider;
-
-
-- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self) {
- // Custom initialization
- }
- return self;
-}
-
-- (void)viewDidLoad
-{
- [super viewDidLoad];
- slider.insetGradient = CGSizeMake(2, 8);
- // Do any additional setup after loading the view.
-}
-
-- (void)viewDidUnload
-{
- [self setSlider:nil];
- [super viewDidUnload];
- // Release any retained subviews of the main view.
-}
-
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
-{
- return (interfaceOrientation == UIInterfaceOrientationPortrait);
-}
-
-
-@end
Oops, something went wrong.

0 comments on commit af4e0db

Please sign in to comment.