├── 2016-03-26 15_24_30.gif ├── DBSlideButtonControl ├── .DS_Store ├── IMG_0186.jpg ├── IMG_0187.jpg ├── DBSlideButtonControl │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── background.imageset │ │ │ ├── background.png │ │ │ └── Contents.json │ │ ├── sliderWifiOn.imageset │ │ │ ├── sliderWifiOn.png │ │ │ └── Contents.json │ │ ├── sliderWifiOff.imageset │ │ │ ├── sliderWifiOff.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── .DS_Store │ ├── SEFilterKnob.h │ ├── AppDelegate.h │ ├── main.m │ ├── ViewController.h │ ├── SEFilterControl.h │ ├── Info.plist │ ├── SEFilterKnob.m │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── ViewController.m │ ├── AppDelegate.m │ └── SEFilterControl.m └── DBSlideButtonControl.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── jdb.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ ├── xcuserdata │ └── jdb.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── DBSlideButtonControl.xcscheme │ └── project.pbxproj └── README.md /2016-03-26 15_24_30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/2016-03-26 15_24_30.gif -------------------------------------------------------------------------------- /DBSlideButtonControl/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/.DS_Store -------------------------------------------------------------------------------- /DBSlideButtonControl/IMG_0186.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/IMG_0186.jpg -------------------------------------------------------------------------------- /DBSlideButtonControl/IMG_0187.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/IMG_0187.jpg -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/DBSlideButtonControl/.DS_Store -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/background.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/background.imageset/background.png -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/sliderWifiOn.imageset/sliderWifiOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/sliderWifiOn.imageset/sliderWifiOn.png -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/sliderWifiOff.imageset/sliderWifiOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/sliderWifiOff.imageset/sliderWifiOff.png -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl.xcodeproj/project.xcworkspace/xcuserdata/jdb.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdb156158/DBSliderButtonControlView/HEAD/DBSlideButtonControl/DBSlideButtonControl.xcodeproj/project.xcworkspace/xcuserdata/jdb.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/SEFilterKnob.h: -------------------------------------------------------------------------------- 1 | // 2 | // SEFilterKnob.h 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SEFilterKnob : UIButton 12 | @property(nonatomic, strong) UIColor *handlerColor; 13 | @end 14 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "background.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/sliderWifiOn.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "sliderWifiOn.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/sliderWifiOff.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "sliderWifiOff.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SEFilterControl.h" 11 | @interface ViewController : UIViewController 12 | @property (weak, nonatomic) IBOutlet UILabel *showLabel; 13 | 14 | @property (weak, nonatomic) IBOutlet UIView *Button_UIView; 15 | @property(nonatomic,strong) SEFilterControl *filter; 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl.xcodeproj/xcuserdata/jdb.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DBSlideButtonControl.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 6DFCD2611CA63A2200F29583 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/SEFilterControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // SEFilterControl.h 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import 10 | //#import "SEFilterKnob.h" 11 | @interface SEFilterControl : UIControl 12 | -(id) initWithFrame:(CGRect) frame Titles:(NSArray *) titles; 13 | -(void) setSelectedIndex:(int)index; 14 | -(void) setTitlesFont:(UIFont *)font; 15 | 16 | @property(nonatomic, strong) UIButton *handler; 17 | @property(nonatomic, strong) UIColor *progressColor; 18 | @property(nonatomic, strong) UIColor *TopTitlesColor; 19 | @property(nonatomic, readonly) int SelectedIndex; 20 | @end 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DBSliderButtonControlView 2 | 3 | 优步下边进行滑动或点击选择车型,感觉挺爽的。 4 | 代码参照了http://code.cocoachina.com/view/124056这位兄弟的,在他上边改动了部分实现了优步下滑菜单的效果。 当前工程为arc版本,后边会在出一个mrc的。 5 | 6 | 用法: 7 | 8 | _filter = [[SEFilterControl alloc]initWithFrame:CGRectMake(25, 5, self.view.frame.size.width-50, 15) Titles:[NSArray arrayWithObjects:@"人民轿车", @"高级轿车", @"豪华轿车", @"优步专车", nil]]; 9 | 10 | [_filter addTarget:self action:@selector(filterValueChanged:) forControlEvents:UIControlEventTouchUpInside]; 11 | 12 | [_filter setProgressColor:[UIColor groupTableViewBackgroundColor]];//设置滑杆的颜色 13 | 14 | [_filter setTopTitlesColor:[UIColor orangeColor]];//设置滑块上方字体颜色 15 | 16 | [_filter setSelectedIndex:0];//初始设置当前选中 17 | 18 | #效果图 19 | ![](https://github.com/Jdb156158/DBSliderButtonControlView/blob/master/2016-03-26%2015_24_30.gif) -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/SEFilterKnob.m: -------------------------------------------------------------------------------- 1 | // 2 | // SEFilterKnob.m 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import "SEFilterKnob.h" 10 | 11 | @implementation SEFilterKnob 12 | 13 | /* 14 | // Only override drawRect: if you perform custom drawing. 15 | // An empty implementation adversely affects performance during animation. 16 | - (void)drawRect:(CGRect)rect { 17 | // Drawing code 18 | } 19 | */ 20 | @synthesize handlerColor; 21 | 22 | - (id)initWithFrame:(CGRect)frame 23 | { 24 | self = [super initWithFrame:frame]; 25 | if (self) { 26 | // Initialization code 27 | [self setHandlerColor:[UIColor colorWithRed:230/255.f green:230/255.f blue:230/255.f alpha:0]]; 28 | } 29 | return self; 30 | } 31 | 32 | -(void) setHandlerColor:(UIColor *)hc{ 33 | handlerColor = nil; 34 | 35 | [self setNeedsDisplay]; 36 | 37 | UIImage *image1 = [UIImage imageNamed:@"sliderWifiOff.png"]; 38 | UIImage *image2 = [UIImage imageNamed:@"sliderWifiOn.png"]; 39 | 40 | CGFloat top = 0; // 顶端盖高度 41 | 42 | CGFloat bottom = 0 ; // 底端盖高度 43 | 44 | CGFloat left = 0; // 左端盖宽度 45 | 46 | CGFloat right = 0; // 右端盖宽度 47 | 48 | UIEdgeInsets insets = UIEdgeInsetsMake(top, left, bottom, right); 49 | 50 | image1 = [image1 resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch]; 51 | image2 = [image2 resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch]; 52 | [self setBackgroundImage:image1 forState:UIControlStateNormal]; 53 | [self setBackgroundImage:image2 forState:UIControlStateSelected]; 54 | } 55 | @end 56 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 17 | { 18 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 19 | if (self) { 20 | // Custom initialization 21 | } 22 | return self; 23 | } 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | 27 | // Do any additional setup after loading the view, typically from a nib. 28 | _filter = [[SEFilterControl alloc]initWithFrame:CGRectMake(25, 5, self.view.frame.size.width-50, 15) Titles:[NSArray arrayWithObjects:@"人民轿车", @"高级轿车", @"豪华轿车", @"优步专车", nil]]; 29 | [_filter addTarget:self action:@selector(filterValueChanged:) forControlEvents:UIControlEventTouchUpInside]; 30 | [_filter setProgressColor:[UIColor groupTableViewBackgroundColor]];//设置滑杆的颜色 31 | [_filter setTopTitlesColor:[UIColor orangeColor]];//设置滑块上方字体颜色 32 | [_filter setSelectedIndex:0];//设置当前选中 33 | _filter.backgroundColor = [UIColor greenColor]; 34 | [_Button_UIView addSubview:_filter]; 35 | 36 | _showLabel.text = @"当前选中的是:人民轿车"; 37 | } 38 | 39 | #pragma mark -- 点击底部按钮响应事件 40 | -(void)filterValueChanged:(SEFilterControl *)sender 41 | { 42 | NSLog(@"当前滑块位置%d",sender.SelectedIndex); 43 | switch (sender.SelectedIndex) { 44 | case 0: 45 | _showLabel.text = @"当前选中的是:人民轿车"; 46 | break; 47 | case 1: 48 | _showLabel.text = @"当前选中的是:高级轿车"; 49 | break; 50 | case 2: 51 | _showLabel.text = @"当前选中的是:豪华轿车"; 52 | break; 53 | case 3: 54 | _showLabel.text = @"当前选中的是:优步专车"; 55 | break; 56 | default: 57 | break; 58 | } 59 | } 60 | - (void)didReceiveMemoryWarning { 61 | [super didReceiveMemoryWarning]; 62 | // Dispose of any resources that can be recreated. 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl.xcodeproj/xcuserdata/jdb.xcuserdatad/xcschemes/DBSlideButtonControl.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl/SEFilterControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // SEFilterControl.m 3 | // DBSlideButtonControl 4 | // 5 | // Created by Jdb on 16/3/26. 6 | // Copyright © 2016年 uimbank. All rights reserved. 7 | // 8 | 9 | #import "SEFilterControl.h" 10 | 11 | #define LEFT_OFFSET 20 12 | #define RIGHT_OFFSET 20 13 | #define TITLE_SELECTED_DISTANCE 9 14 | #define TITLE_FADE_ALPHA 0.5f 15 | //#define TITLE_FONT [UIFont fontWithName:@"Optima" size:10]//源码 16 | #define TITLE_FONT [UIFont systemFontOfSize:10] 17 | #define TITLE_SHADOW_COLOR [UIColor lightGrayColor] 18 | #define TITLE_COLOR [UIColor blackColor] 19 | 20 | @interface SEFilterControl (){ 21 | CGPoint diffPoint; 22 | NSArray *titlesArr; 23 | float oneSlotSize; 24 | } 25 | 26 | @end 27 | 28 | @implementation SEFilterControl 29 | @synthesize SelectedIndex, progressColor,TopTitlesColor; 30 | 31 | -(CGPoint)getCenterPointForIndex:(int) i{ 32 | return CGPointMake((i/(float)(titlesArr.count-1)) * (self.frame.size.width-RIGHT_OFFSET-LEFT_OFFSET) + LEFT_OFFSET, i==0?self.frame.size.height-55-TITLE_SELECTED_DISTANCE:self.frame.size.height-55); 33 | } 34 | 35 | -(CGPoint)fixFinalPoint:(CGPoint)pnt{ 36 | if (pnt.x < LEFT_OFFSET-(_handler.frame.size.width/2.f)) { 37 | pnt.x = LEFT_OFFSET-(_handler.frame.size.width/2.f); 38 | }else if (pnt.x+(_handler.frame.size.width/2.f) > self.frame.size.width-RIGHT_OFFSET){ 39 | pnt.x = self.frame.size.width-RIGHT_OFFSET- (_handler.frame.size.width/2.f); 40 | 41 | } 42 | return pnt; 43 | } 44 | 45 | -(id) initWithFrame:(CGRect) frame Titles:(NSArray *) titles{ 46 | if (self = [super initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, 70)]) { 47 | [self setBackgroundColor:[UIColor clearColor]]; 48 | titlesArr = [[NSArray alloc] initWithArray:titles]; 49 | 50 | [self setProgressColor:[UIColor colorWithRed:103/255.f green:173/255.f blue:202/255.f alpha:1]]; 51 | [self setTopTitlesColor:[UIColor colorWithRed:103/255.f green:173/255.f blue:202/255.f alpha:1]]; 52 | 53 | UITapGestureRecognizer *gest = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(ItemSelected:)]; 54 | [self addGestureRecognizer:gest]; 55 | 56 | _handler = [UIButton buttonWithType:UIButtonTypeCustom]; 57 | [_handler setFrame:CGRectMake(LEFT_OFFSET, 8, 45, 45)]; 58 | [_handler setAdjustsImageWhenHighlighted:NO]; 59 | [_handler setSelected:YES]; 60 | [_handler setCenter:CGPointMake(_handler.center.x-(_handler.frame.size.width/2.f), self.frame.size.height-29.5f)]; 61 | [_handler addTarget:self action:@selector(TouchDown:withEvent:) forControlEvents:UIControlEventTouchDown]; 62 | [_handler addTarget:self action:@selector(TouchUp:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside]; 63 | [_handler addTarget:self action:@selector(TouchMove:withEvent:) forControlEvents: UIControlEventTouchDragOutside | UIControlEventTouchDragInside]; 64 | 65 | UIImage *image1 = [UIImage imageNamed:@"sliderWifiOff.png"]; 66 | UIImage *image2 = [UIImage imageNamed:@"sliderWifiOn.png"]; 67 | 68 | CGFloat top = 0; // 顶端盖高度 69 | 70 | CGFloat bottom = 0 ; // 底端盖高度 71 | 72 | CGFloat left = 0; // 左端盖宽度 73 | 74 | CGFloat right = 0; // 右端盖宽度 75 | 76 | UIEdgeInsets insets = UIEdgeInsetsMake(top, left, bottom, right); 77 | 78 | image1 = [image1 resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch]; 79 | image2 = [image2 resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeStretch]; 80 | [_handler setBackgroundImage:image1 forState:UIControlStateNormal]; 81 | [_handler setBackgroundImage:image2 forState:UIControlStateSelected]; 82 | 83 | [self addSubview:_handler]; 84 | 85 | int i; 86 | NSString *title; 87 | UILabel *lbl; 88 | 89 | oneSlotSize = 1.f*(self.frame.size.width-LEFT_OFFSET-RIGHT_OFFSET-1)/(titlesArr.count-1); 90 | for (i = 0; i < titlesArr.count; i++) { 91 | title = [titlesArr objectAtIndex:i]; 92 | lbl = [[UILabel alloc]initWithFrame:CGRectMake(0, 3, oneSlotSize, 10)]; 93 | [lbl setText:title]; 94 | [lbl setFont:TITLE_FONT]; 95 | [lbl setTextColor:TITLE_COLOR]; 96 | [lbl setLineBreakMode:NSLineBreakByTruncatingMiddle]; 97 | [lbl setAdjustsFontSizeToFitWidth:YES]; 98 | [lbl setTextAlignment:NSTextAlignmentCenter]; 99 | [lbl setShadowOffset:CGSizeMake(0, 1)]; 100 | [lbl setTag:i+50]; 101 | 102 | if (i) { 103 | [lbl setAlpha:TITLE_FADE_ALPHA]; 104 | } 105 | 106 | [lbl setCenter:[self getCenterPointForIndex:i]]; 107 | [self addSubview:lbl]; 108 | } 109 | } 110 | return self; 111 | } 112 | 113 | -(void)drawRect:(CGRect)rect{ 114 | CGContextRef context = UIGraphicsGetCurrentContext(); 115 | 116 | CGColorRef shadowColor = [UIColor colorWithRed:0 green:0 117 | blue:0 alpha:.9f].CGColor; 118 | 119 | 120 | //Fill Main Path 121 | 122 | //原代码CGContextSetFillColorWithColor(context, self.progressColor.CGColor); 123 | //CGContextSetFillColorWithColor(context, [UIColor grayColor].CGColor); 124 | CGContextSetFillColorWithColor(context, self.progressColor.CGColor); 125 | 126 | //源码为(context, CGRectMake(LEFT_OFFSET, rect.size.height-35, rect.size.width-RIGHT_OFFSET-LEFT_OFFSET, 10)) 127 | CGContextFillRect(context, CGRectMake(LEFT_OFFSET, rect.size.height-32.5, rect.size.width-RIGHT_OFFSET-LEFT_OFFSET, 5)); 128 | 129 | CGContextSaveGState(context); 130 | 131 | //Draw Black Top Shadow 132 | 133 | CGContextSetShadowWithColor(context, CGSizeMake(0, 1.f), 2.f, shadowColor); 134 | 135 | CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0 green:0 136 | blue:0 alpha:.2f].CGColor); 137 | CGContextSetLineWidth(context, .4f); 138 | CGContextBeginPath(context); 139 | CGContextMoveToPoint(context, LEFT_OFFSET, rect.size.height-32.5); 140 | CGContextAddLineToPoint(context, rect.size.width-RIGHT_OFFSET, rect.size.height-32.5); 141 | CGContextStrokePath(context); 142 | 143 | CGContextRestoreGState(context); 144 | 145 | CGContextSaveGState(context); 146 | 147 | //Draw White Bottom Shadow 148 | 149 | CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0 green:0 150 | blue:0 alpha:.2f].CGColor); 151 | CGContextSetLineWidth(context, .4f); 152 | CGContextBeginPath(context); 153 | CGContextMoveToPoint(context, LEFT_OFFSET, rect.size.height-27.5); 154 | CGContextAddLineToPoint(context, rect.size.width-RIGHT_OFFSET, rect.size.height-27.5); 155 | CGContextStrokePath(context); 156 | 157 | CGContextRestoreGState(context); 158 | 159 | 160 | CGPoint centerPoint; 161 | int i; 162 | for (i = 0; i < titlesArr.count; i++) { 163 | centerPoint = [self getCenterPointForIndex:i]; 164 | 165 | //Draw Selection Circles 小圆圈 166 | 167 | //源代码CGContextSetFillColorWithColor(context, self.progressColor.CGColor); 168 | //CGContextSetFillColorWithColor(context, [UIColor grayColor].CGColor); 169 | CGContextSetFillColorWithColor(context, self.progressColor.CGColor); 170 | 171 | CGContextFillEllipseInRect(context, CGRectMake(centerPoint.x-10, rect.size.height-38.0f, 15, 15)); 172 | 173 | //Draw top Gradient 174 | 175 | // CGFloat colors[12] = {0, 0, 0, 1, 176 | // 0, 0, 0, 0, 177 | // 0, 0, 0, 0}; 178 | // CGColorSpaceRef baseSpace = CGColorSpaceCreateDeviceRGB(); 179 | // CGGradientRef gradient = CGGradientCreateWithColorComponents(baseSpace, colors, NULL, 3); 180 | // 181 | // CGContextSaveGState(context); 182 | // CGContextAddEllipseInRect(context, CGRectMake(centerPoint.x-15, rect.size.height-42.5f, 25, 25)); 183 | // CGContextClip(context); 184 | // CGContextDrawLinearGradient (context, gradient, CGPointMake(0, 0), CGPointMake(0,rect.size.height), 0); 185 | // CGContextRestoreGState(context); 186 | 187 | //Draw White Bottom Shadow 小圆圈的上半部分圆弧 188 | 189 | CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0 green:0 190 | blue:0 alpha:.2f].CGColor); 191 | CGContextSetLineWidth(context, .4f); 192 | CGContextAddArc(context,centerPoint.x-2.0,rect.size.height-30.5f,7.0f,18*M_PI/180,165*M_PI/180,0); 193 | CGContextDrawPath(context,kCGPathStroke); 194 | 195 | //Draw Black Top Shadow 小圆圈的下半部分圆弧 196 | 197 | CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0 green:0 198 | blue:0 alpha:.2f].CGColor); 199 | 200 | CGContextAddArc(context,centerPoint.x-2.0,rect.size.height-30.5f,7.0f,(i==titlesArr.count-1?18:-14)*M_PI/180,(i==0?-198:-170)*M_PI/180,1); 201 | CGContextSetLineWidth(context, .4f); 202 | CGContextDrawPath(context,kCGPathStroke); 203 | 204 | } 205 | } 206 | 207 | 208 | - (void) TouchDown: (UIButton *) btn withEvent: (UIEvent *) ev{ 209 | CGPoint currPoint = [[[ev allTouches] anyObject] locationInView:self]; 210 | diffPoint = CGPointMake(currPoint.x - btn.frame.origin.x, currPoint.y - btn.frame.origin.y); 211 | [self sendActionsForControlEvents:UIControlEventTouchDown]; 212 | } 213 | 214 | 215 | -(void) setTitlesFont:(UIFont *)font{ 216 | int i; 217 | UILabel *lbl; 218 | for (i = 0; i < titlesArr.count; i++) { 219 | lbl = (UILabel *)[self viewWithTag:i+50]; 220 | [lbl setFont:font]; 221 | } 222 | } 223 | 224 | -(void) animateTitlesToIndex:(int) index{ 225 | int i; 226 | UILabel *lbl; 227 | for (i = 0; i < titlesArr.count; i++) { 228 | lbl = (UILabel *)[self viewWithTag:i+50]; 229 | [UIView beginAnimations:nil context:nil]; 230 | [UIView setAnimationBeginsFromCurrentState:YES]; 231 | if (i == index) { 232 | //选中时label颜色 233 | [lbl setCenter:CGPointMake(lbl.center.x, self.frame.size.height-55-TITLE_SELECTED_DISTANCE)]; 234 | [lbl setTextColor: self.TopTitlesColor]; 235 | [lbl setAlpha:1]; 236 | }else{ 237 | //未选中时label颜色 238 | [lbl setCenter:CGPointMake(lbl.center.x, self.frame.size.height-55)]; 239 | [lbl setTextColor:TITLE_COLOR]; 240 | [lbl setAlpha:1]; 241 | } 242 | [UIView commitAnimations]; 243 | } 244 | } 245 | 246 | -(void) animateHandlerToIndex:(int) index{ 247 | CGPoint toPoint = [self getCenterPointForIndex:index]; 248 | toPoint = CGPointMake(toPoint.x-(_handler.frame.size.width/2.f), _handler.frame.origin.y); 249 | toPoint = [self fixFinalPoint:toPoint]; 250 | 251 | [UIView beginAnimations:nil context:nil]; 252 | [_handler setFrame:CGRectMake(toPoint.x, toPoint.y, _handler.frame.size.width, _handler.frame.size.height)]; 253 | [UIView commitAnimations]; 254 | } 255 | 256 | -(void) setSelectedIndex:(int)index{ 257 | SelectedIndex = index; 258 | [self animateTitlesToIndex:index]; 259 | [self animateHandlerToIndex:index]; 260 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 261 | } 262 | 263 | -(int)getSelectedTitleInPoint:(CGPoint)pnt{ 264 | return round((pnt.x-LEFT_OFFSET)/oneSlotSize); 265 | } 266 | 267 | -(void) ItemSelected: (UITapGestureRecognizer *) tap { 268 | SelectedIndex = [self getSelectedTitleInPoint:[tap locationInView:self]]; 269 | [self setSelectedIndex:SelectedIndex]; 270 | 271 | [self sendActionsForControlEvents:UIControlEventTouchUpInside]; 272 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 273 | } 274 | 275 | -(void) TouchUp: (UIButton*) btn{ 276 | btn.selected = YES; 277 | SelectedIndex = [self getSelectedTitleInPoint:btn.center]; 278 | [self animateHandlerToIndex:SelectedIndex]; 279 | [self sendActionsForControlEvents:UIControlEventTouchUpInside]; 280 | [self sendActionsForControlEvents:UIControlEventValueChanged]; 281 | } 282 | 283 | - (void) TouchMove: (UIButton *) btn withEvent: (UIEvent *) ev { 284 | btn.selected = NO; 285 | CGPoint currPoint = [[[ev allTouches] anyObject] locationInView:self]; 286 | 287 | CGPoint toPoint = CGPointMake(currPoint.x-diffPoint.x, _handler.frame.origin.y); 288 | 289 | toPoint = [self fixFinalPoint:toPoint]; 290 | 291 | [_handler setFrame:CGRectMake(toPoint.x, toPoint.y, _handler.frame.size.width, _handler.frame.size.height)]; 292 | 293 | int selected = [self getSelectedTitleInPoint:btn.center]; 294 | 295 | [self animateTitlesToIndex:selected]; 296 | 297 | [self sendActionsForControlEvents:UIControlEventTouchDragInside]; 298 | } 299 | @end 300 | -------------------------------------------------------------------------------- /DBSlideButtonControl/DBSlideButtonControl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6DFCD2671CA63A2200F29583 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DFCD2661CA63A2200F29583 /* main.m */; }; 11 | 6DFCD26A1CA63A2200F29583 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DFCD2691CA63A2200F29583 /* AppDelegate.m */; }; 12 | 6DFCD26D1CA63A2200F29583 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DFCD26C1CA63A2200F29583 /* ViewController.m */; }; 13 | 6DFCD2701CA63A2200F29583 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6DFCD26E1CA63A2200F29583 /* Main.storyboard */; }; 14 | 6DFCD2721CA63A2200F29583 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6DFCD2711CA63A2200F29583 /* Assets.xcassets */; }; 15 | 6DFCD2751CA63A2200F29583 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6DFCD2731CA63A2200F29583 /* LaunchScreen.storyboard */; }; 16 | 6DFCD27F1CA63AC300F29583 /* SEFilterControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DFCD27E1CA63AC300F29583 /* SEFilterControl.m */; }; 17 | 6DFCD2821CA63AE600F29583 /* SEFilterKnob.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DFCD2811CA63AE600F29583 /* SEFilterKnob.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 6DFCD2621CA63A2200F29583 /* DBSlideButtonControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DBSlideButtonControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 6DFCD2661CA63A2200F29583 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 23 | 6DFCD2681CA63A2200F29583 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 24 | 6DFCD2691CA63A2200F29583 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 25 | 6DFCD26B1CA63A2200F29583 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 26 | 6DFCD26C1CA63A2200F29583 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 27 | 6DFCD26F1CA63A2200F29583 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | 6DFCD2711CA63A2200F29583 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | 6DFCD2741CA63A2200F29583 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 6DFCD2761CA63A2200F29583 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 6DFCD27D1CA63AC300F29583 /* SEFilterControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SEFilterControl.h; sourceTree = ""; }; 32 | 6DFCD27E1CA63AC300F29583 /* SEFilterControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SEFilterControl.m; sourceTree = ""; }; 33 | 6DFCD2801CA63AE600F29583 /* SEFilterKnob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SEFilterKnob.h; sourceTree = ""; }; 34 | 6DFCD2811CA63AE600F29583 /* SEFilterKnob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SEFilterKnob.m; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 6DFCD25F1CA63A2200F29583 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 6DFCD2591CA63A2200F29583 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 6DFCD2641CA63A2200F29583 /* DBSlideButtonControl */, 52 | 6DFCD2631CA63A2200F29583 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 6DFCD2631CA63A2200F29583 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 6DFCD2621CA63A2200F29583 /* DBSlideButtonControl.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 6DFCD2641CA63A2200F29583 /* DBSlideButtonControl */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 6DFCD27C1CA63A4900F29583 /* DBSlideButtonView */, 68 | 6DFCD2681CA63A2200F29583 /* AppDelegate.h */, 69 | 6DFCD2691CA63A2200F29583 /* AppDelegate.m */, 70 | 6DFCD26B1CA63A2200F29583 /* ViewController.h */, 71 | 6DFCD26C1CA63A2200F29583 /* ViewController.m */, 72 | 6DFCD26E1CA63A2200F29583 /* Main.storyboard */, 73 | 6DFCD2711CA63A2200F29583 /* Assets.xcassets */, 74 | 6DFCD2731CA63A2200F29583 /* LaunchScreen.storyboard */, 75 | 6DFCD2761CA63A2200F29583 /* Info.plist */, 76 | 6DFCD2651CA63A2200F29583 /* Supporting Files */, 77 | ); 78 | path = DBSlideButtonControl; 79 | sourceTree = ""; 80 | }; 81 | 6DFCD2651CA63A2200F29583 /* Supporting Files */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 6DFCD2661CA63A2200F29583 /* main.m */, 85 | ); 86 | name = "Supporting Files"; 87 | sourceTree = ""; 88 | }; 89 | 6DFCD27C1CA63A4900F29583 /* DBSlideButtonView */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 6DFCD27D1CA63AC300F29583 /* SEFilterControl.h */, 93 | 6DFCD27E1CA63AC300F29583 /* SEFilterControl.m */, 94 | 6DFCD2801CA63AE600F29583 /* SEFilterKnob.h */, 95 | 6DFCD2811CA63AE600F29583 /* SEFilterKnob.m */, 96 | ); 97 | name = DBSlideButtonView; 98 | sourceTree = ""; 99 | }; 100 | /* End PBXGroup section */ 101 | 102 | /* Begin PBXNativeTarget section */ 103 | 6DFCD2611CA63A2200F29583 /* DBSlideButtonControl */ = { 104 | isa = PBXNativeTarget; 105 | buildConfigurationList = 6DFCD2791CA63A2200F29583 /* Build configuration list for PBXNativeTarget "DBSlideButtonControl" */; 106 | buildPhases = ( 107 | 6DFCD25E1CA63A2200F29583 /* Sources */, 108 | 6DFCD25F1CA63A2200F29583 /* Frameworks */, 109 | 6DFCD2601CA63A2200F29583 /* Resources */, 110 | ); 111 | buildRules = ( 112 | ); 113 | dependencies = ( 114 | ); 115 | name = DBSlideButtonControl; 116 | productName = DBSlideButtonControl; 117 | productReference = 6DFCD2621CA63A2200F29583 /* DBSlideButtonControl.app */; 118 | productType = "com.apple.product-type.application"; 119 | }; 120 | /* End PBXNativeTarget section */ 121 | 122 | /* Begin PBXProject section */ 123 | 6DFCD25A1CA63A2200F29583 /* Project object */ = { 124 | isa = PBXProject; 125 | attributes = { 126 | LastUpgradeCheck = 0730; 127 | ORGANIZATIONNAME = uimbank; 128 | TargetAttributes = { 129 | 6DFCD2611CA63A2200F29583 = { 130 | CreatedOnToolsVersion = 7.3; 131 | }; 132 | }; 133 | }; 134 | buildConfigurationList = 6DFCD25D1CA63A2200F29583 /* Build configuration list for PBXProject "DBSlideButtonControl" */; 135 | compatibilityVersion = "Xcode 3.2"; 136 | developmentRegion = English; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | Base, 141 | ); 142 | mainGroup = 6DFCD2591CA63A2200F29583; 143 | productRefGroup = 6DFCD2631CA63A2200F29583 /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | 6DFCD2611CA63A2200F29583 /* DBSlideButtonControl */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | 6DFCD2601CA63A2200F29583 /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 6DFCD2751CA63A2200F29583 /* LaunchScreen.storyboard in Resources */, 158 | 6DFCD2721CA63A2200F29583 /* Assets.xcassets in Resources */, 159 | 6DFCD2701CA63A2200F29583 /* Main.storyboard in Resources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXResourcesBuildPhase section */ 164 | 165 | /* Begin PBXSourcesBuildPhase section */ 166 | 6DFCD25E1CA63A2200F29583 /* Sources */ = { 167 | isa = PBXSourcesBuildPhase; 168 | buildActionMask = 2147483647; 169 | files = ( 170 | 6DFCD2821CA63AE600F29583 /* SEFilterKnob.m in Sources */, 171 | 6DFCD26D1CA63A2200F29583 /* ViewController.m in Sources */, 172 | 6DFCD26A1CA63A2200F29583 /* AppDelegate.m in Sources */, 173 | 6DFCD2671CA63A2200F29583 /* main.m in Sources */, 174 | 6DFCD27F1CA63AC300F29583 /* SEFilterControl.m in Sources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXSourcesBuildPhase section */ 179 | 180 | /* Begin PBXVariantGroup section */ 181 | 6DFCD26E1CA63A2200F29583 /* Main.storyboard */ = { 182 | isa = PBXVariantGroup; 183 | children = ( 184 | 6DFCD26F1CA63A2200F29583 /* Base */, 185 | ); 186 | name = Main.storyboard; 187 | sourceTree = ""; 188 | }; 189 | 6DFCD2731CA63A2200F29583 /* LaunchScreen.storyboard */ = { 190 | isa = PBXVariantGroup; 191 | children = ( 192 | 6DFCD2741CA63A2200F29583 /* Base */, 193 | ); 194 | name = LaunchScreen.storyboard; 195 | sourceTree = ""; 196 | }; 197 | /* End PBXVariantGroup section */ 198 | 199 | /* Begin XCBuildConfiguration section */ 200 | 6DFCD2771CA63A2200F29583 /* Debug */ = { 201 | isa = XCBuildConfiguration; 202 | buildSettings = { 203 | ALWAYS_SEARCH_USER_PATHS = NO; 204 | CLANG_ANALYZER_NONNULL = YES; 205 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 206 | CLANG_CXX_LIBRARY = "libc++"; 207 | CLANG_ENABLE_MODULES = YES; 208 | CLANG_ENABLE_OBJC_ARC = YES; 209 | CLANG_WARN_BOOL_CONVERSION = YES; 210 | CLANG_WARN_CONSTANT_CONVERSION = YES; 211 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 212 | CLANG_WARN_EMPTY_BODY = YES; 213 | CLANG_WARN_ENUM_CONVERSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 216 | CLANG_WARN_UNREACHABLE_CODE = YES; 217 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 218 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 219 | COPY_PHASE_STRIP = NO; 220 | DEBUG_INFORMATION_FORMAT = dwarf; 221 | ENABLE_STRICT_OBJC_MSGSEND = YES; 222 | ENABLE_TESTABILITY = YES; 223 | GCC_C_LANGUAGE_STANDARD = gnu99; 224 | GCC_DYNAMIC_NO_PIC = NO; 225 | GCC_NO_COMMON_BLOCKS = YES; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PREPROCESSOR_DEFINITIONS = ( 228 | "DEBUG=1", 229 | "$(inherited)", 230 | ); 231 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 232 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 233 | GCC_WARN_UNDECLARED_SELECTOR = YES; 234 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 235 | GCC_WARN_UNUSED_FUNCTION = YES; 236 | GCC_WARN_UNUSED_VARIABLE = YES; 237 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 238 | MTL_ENABLE_DEBUG_INFO = YES; 239 | ONLY_ACTIVE_ARCH = YES; 240 | SDKROOT = iphoneos; 241 | }; 242 | name = Debug; 243 | }; 244 | 6DFCD2781CA63A2200F29583 /* Release */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | ALWAYS_SEARCH_USER_PATHS = NO; 248 | CLANG_ANALYZER_NONNULL = YES; 249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 250 | CLANG_CXX_LIBRARY = "libc++"; 251 | CLANG_ENABLE_MODULES = YES; 252 | CLANG_ENABLE_OBJC_ARC = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_CONSTANT_CONVERSION = YES; 255 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 256 | CLANG_WARN_EMPTY_BODY = YES; 257 | CLANG_WARN_ENUM_CONVERSION = YES; 258 | CLANG_WARN_INT_CONVERSION = YES; 259 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | VALIDATE_PRODUCT = YES; 279 | }; 280 | name = Release; 281 | }; 282 | 6DFCD27A1CA63A2200F29583 /* Debug */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 286 | INFOPLIST_FILE = DBSlideButtonControl/Info.plist; 287 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 288 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 289 | PRODUCT_BUNDLE_IDENTIFIER = com.uimbank.DBSlideButtonControl; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | }; 292 | name = Debug; 293 | }; 294 | 6DFCD27B1CA63A2200F29583 /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | INFOPLIST_FILE = DBSlideButtonControl/Info.plist; 299 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 301 | PRODUCT_BUNDLE_IDENTIFIER = com.uimbank.DBSlideButtonControl; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | }; 304 | name = Release; 305 | }; 306 | /* End XCBuildConfiguration section */ 307 | 308 | /* Begin XCConfigurationList section */ 309 | 6DFCD25D1CA63A2200F29583 /* Build configuration list for PBXProject "DBSlideButtonControl" */ = { 310 | isa = XCConfigurationList; 311 | buildConfigurations = ( 312 | 6DFCD2771CA63A2200F29583 /* Debug */, 313 | 6DFCD2781CA63A2200F29583 /* Release */, 314 | ); 315 | defaultConfigurationIsVisible = 0; 316 | defaultConfigurationName = Release; 317 | }; 318 | 6DFCD2791CA63A2200F29583 /* Build configuration list for PBXNativeTarget "DBSlideButtonControl" */ = { 319 | isa = XCConfigurationList; 320 | buildConfigurations = ( 321 | 6DFCD27A1CA63A2200F29583 /* Debug */, 322 | 6DFCD27B1CA63A2200F29583 /* Release */, 323 | ); 324 | defaultConfigurationIsVisible = 0; 325 | defaultConfigurationName = Release; 326 | }; 327 | /* End XCConfigurationList section */ 328 | }; 329 | rootObject = 6DFCD25A1CA63A2200F29583 /* Project object */; 330 | } 331 | --------------------------------------------------------------------------------