10 |
11 | @interface DYScrollSegmentDemoUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation DYScrollSegmentDemoUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo/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 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | DYSegmentDemo
3 | =
4 | 喜欢的朋友可以下载下来,如果代码对你有所帮助,还请给个Star,非常感谢你的支持!
5 | =
6 | * 选择滑动控件
7 | * 实现功能:滑动切换,点击切换,字体颜色渐变,标题选中和未选中时的逐渐形变。
8 |
9 | * 效果图
10 |
11 | 
12 |
13 |
14 | * 对应文件
15 | * DYSegmentView : 自定义滑动控件实现类
16 |
17 | * 具体使用
18 |
19 | -(DYSegmentView *)dySegment{
20 | if (!_dySegment) {
21 | _dySegment = [[DYSegmentView alloc]initWithFrame:CGRectMake(ScreenWidth/2-120, 25, 240, 44)];
22 | _dySegment.delegate = self;
23 | _dySegment.backgroundColor = [UIColor clearColor];
24 | _dySegment.titleNormalColor = UIColorFromRGB(0xffffff, 0.5);
25 | _dySegment.titleSelectColor = UIColorFromRGB(0xffffff, 0.9);
26 | _dySegment.titleFont = [UIFont systemFontOfSize:15];
27 | _dySegment.titleArray = @[@"在线",@"附近"];
28 | }
29 | return _dySegment;
30 | }
31 | self.navigationItem.titleView = self.dySegment;
32 |
33 |
34 | * 实现相对应的代理方法
35 |
36 | #pragma mark - UIScrollDelegate
37 | -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
38 | [_dySegment dyDidScrollChangeTheTitleColorWithContentOfSet:scrollView.contentOffset.x];
39 | }
40 | #pragma mark - DYSegmentDelegate
41 | -(void)dySegment:(DYSegmentView *)segment didSelectIndex:(NSInteger)index{
42 | NSString *notiStr;
43 | if (index == 1) {
44 | notiStr = @"1";
45 | }else{
46 | notiStr = @"2";
47 | }
48 | self.scrollView.contentOffset = CGPointMake(ScreenWidth*(index-1), 0);
49 | [[NSNotificationCenter defaultCenter] postNotificationName:@"MainViewScrollDidScroll" object:notiStr];
50 | }
51 |
52 |
53 | - 使用过程中有问题请加QQ或发邮件:584379066 备注:Git SegmentView
54 |
55 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo/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 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // DYScrollSegmentDemo
4 | //
5 | // Created by Daniel Yao on 17/4/10.
6 | // Copyright © 2017年 Daniel Yao. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "ViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | // Override point for customization after application launch.
21 | self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
22 |
23 | ViewController *vc = [[ViewController alloc]init];
24 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
25 | self.window.rootViewController = nav;
26 |
27 | [self.window makeKeyAndVisible];
28 | return YES;
29 | }
30 |
31 |
32 | - (void)applicationWillResignActive:(UIApplication *)application {
33 | // 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.
34 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
35 | }
36 |
37 |
38 | - (void)applicationDidEnterBackground:(UIApplication *)application {
39 | // 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.
40 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
41 | }
42 |
43 |
44 | - (void)applicationWillEnterForeground:(UIApplication *)application {
45 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
46 | }
47 |
48 |
49 | - (void)applicationDidBecomeActive:(UIApplication *)application {
50 | // 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.
51 | }
52 |
53 |
54 | - (void)applicationWillTerminate:(UIApplication *)application {
55 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
56 | }
57 |
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // DYScrollSegmentDemo
4 | //
5 | // Created by Daniel Yao on 17/4/10.
6 | // Copyright © 2017年 Daniel Yao. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "DYSegmentView.h"
11 | #import "DYVCSegmentOne.h"
12 | #import "DYVCSegmentTwo.h"
13 |
14 | @interface ViewController ()
15 |
16 | @property(nonatomic,strong)DYSegmentView *dySegment;
17 |
18 | @property(nonatomic,strong)UIScrollView *scrollView;
19 |
20 | @property(nonatomic,strong)DYVCSegmentOne *vcOne;
21 |
22 | @property(nonatomic,strong)DYVCSegmentTwo *vcTwo;
23 |
24 | @end
25 |
26 | @implementation ViewController
27 | -(DYSegmentView *)dySegment{
28 | if (!_dySegment) {
29 | _dySegment = [[DYSegmentView alloc]initWithFrame:CGRectMake(ScreenWidth/2-120, 25, 240, 44)];
30 | _dySegment.delegate = self;
31 | _dySegment.backgroundColor = [UIColor clearColor];
32 | _dySegment.titleNormalColor = UIColorFromRGB(0xffffff, 0.5);
33 | _dySegment.titleSelectColor = UIColorFromRGB(0xffffff, 0.9);
34 | _dySegment.titleFont = [UIFont systemFontOfSize:15];
35 | _dySegment.titleArray = @[@"在线",@"附近"];
36 | }
37 | return _dySegment;
38 | }
39 | -(UIScrollView *)scrollView{
40 | if (!_scrollView) {
41 | _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
42 | _scrollView.delegate = self;
43 | _scrollView.showsHorizontalScrollIndicator = NO;
44 | _scrollView.showsVerticalScrollIndicator = NO;
45 | _scrollView.contentSize = CGSizeMake(ScreenWidth * 2, ScreenHeight);
46 | _scrollView.pagingEnabled = YES;
47 | _scrollView.bounces = NO;
48 |
49 | }
50 | return _scrollView;
51 | }
52 | -(DYVCSegmentOne *)vcOne{
53 | if (!_vcOne) {
54 | _vcOne = [[DYVCSegmentOne alloc]init];
55 | _vcOne.view.backgroundColor = UIColorFromRGB(0xffffff, 0.3);
56 | }
57 | return _vcOne;
58 | }
59 | -(DYVCSegmentTwo *)vcTwo{
60 | if (!_vcTwo) {
61 | _vcTwo = [[DYVCSegmentTwo alloc]init];
62 | _vcTwo.view.backgroundColor = UIColorFromRGB(0xffffff, 0.7);
63 | }
64 | return _vcTwo;
65 | }
66 | - (void)viewDidLoad {
67 | [super viewDidLoad];
68 | // Do any additional setup after loading the view, typically from a nib.
69 |
70 | [self configNavigationBar];
71 | [self initWithScrollView];
72 | }
73 | - (void)configNavigationBar
74 | {
75 | self.navigationController.navigationBar.shadowImage=[UIImage new];
76 | [ self.navigationController.navigationBar setBarTintColor:UIColorFromRGB(0x000000, 1.0)];//纯粹为了界面好看
77 |
78 | self.navigationItem.titleView = self.dySegment;
79 | }
80 | -(void)initWithScrollView{
81 | [self.view addSubview:self.scrollView];
82 | [self addChildViewController:self.vcOne];
83 | [self addChildViewController:self.vcTwo];
84 |
85 | self.vcOne.view.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
86 | self.vcTwo.view.frame = CGRectMake(ScreenWidth, 0, ScreenWidth, ScreenHeight);
87 | [self.scrollView addSubview:self.vcOne.view];
88 | [self.scrollView addSubview:self.vcTwo.view];
89 | }
90 |
91 | #pragma mark - UIScrollDelegate
92 | -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
93 | [_dySegment dyDidScrollChangeTheTitleColorWithContentOfSet:scrollView.contentOffset.x];
94 | }
95 | #pragma mark - DYSegmentDelegate
96 | -(void)dySegment:(DYSegmentView *)segment didSelectIndex:(NSInteger)index{
97 | NSString *notiStr;
98 | if (index == 1) {
99 | notiStr = @"1";
100 | }else{
101 | notiStr = @"2";
102 | }
103 | self.scrollView.contentOffset = CGPointMake(ScreenWidth*(index-1), 0);
104 | [[NSNotificationCenter defaultCenter] postNotificationName:@"MainViewScrollDidScroll" object:notiStr];
105 | }
106 | - (void)didReceiveMemoryWarning {
107 | [super didReceiveMemoryWarning];
108 | // Dispose of any resources that can be recreated.
109 | }
110 |
111 |
112 | @end
113 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo.xcodeproj/xcuserdata/DanielYao.xcuserdatad/xcschemes/DYScrollSegmentDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo/DYSegmentView.m:
--------------------------------------------------------------------------------
1 | //
2 | // DYSegmentView.m
3 | // DYScrollSegmentDemo
4 | //
5 | // Created by Daniel Yao on 17/4/10.
6 | // Copyright © 2017年 Daniel Yao. All rights reserved.
7 | //
8 |
9 | #define BTN_WIDTH 50
10 | #define BTN_BASE_SCALE 0.2
11 | #define BOTTOM_LINE_WIDTH 10
12 |
13 | #import "DYSegmentView.h"
14 |
15 | @interface DYSegmentView()
16 |
17 | @property(nonatomic,assign)CGFloat segmentHeight;
18 |
19 | @property(nonatomic,assign)CGFloat segmentWidth;
20 |
21 | @property(nonatomic,assign)CGFloat btnWidth;
22 |
23 | @property(nonatomic,strong)NSMutableArray *btnArray;
24 |
25 | @property(nonatomic,strong)UIScrollView *bgScrollView;
26 |
27 | @property(nonatomic,strong)UIView *bottomLine;
28 |
29 | @property(nonatomic,strong)UIButton *selectBtn;
30 | @end
31 |
32 | @implementation DYSegmentView
33 |
34 | /*
35 | // Only override drawRect: if you perform custom drawing.
36 | // An empty implementation adversely affects performance during animation.
37 | - (void)drawRect:(CGRect)rect {
38 | // Drawing code
39 | }
40 | */
41 | -(instancetype)initWithFrame:(CGRect)frame{
42 | self = [super initWithFrame:frame];
43 | if (self) {
44 | self.segmentHeight = frame.size.height;
45 | self.segmentWidth = frame.size.width;
46 | self.titleFont = [UIFont systemFontOfSize:15];
47 | self.btnArray = [[NSMutableArray alloc]init];
48 | self.titleNormalColor = [UIColor whiteColor];
49 | self.defaultSelectIndex = 1;
50 |
51 | [self addSubview:self.bgScrollView];
52 | [self registerKVOPaths];
53 |
54 | //检测滚动
55 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mainViewScrollDidScroll:) name:@"MainViewScrollDidScroll" object:nil];
56 | }
57 | return self;
58 | }
59 | -(void)mainViewScrollDidScroll:(NSNotification *)noti
60 | {
61 | UIButton *button = [self viewWithTag:[noti.object intValue]];
62 | if (button.tag == self.defaultSelectIndex)
63 | {
64 | return;
65 | }else
66 | {
67 | self.selectBtn.selected = NO;
68 | button.selected = YES;
69 | self.selectBtn = button;
70 | self.defaultSelectIndex = button.tag;
71 | }
72 | }
73 |
74 | -(UIScrollView *)bgScrollView{
75 | if (!_bgScrollView){
76 | _bgScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.segmentWidth, self.frame.size.height)];
77 | _bgScrollView.showsHorizontalScrollIndicator = NO;
78 | }
79 | return _bgScrollView;
80 | }
81 | -(void)registerKVOPaths{
82 | for (NSString *keyPath in [self observeKeyPaths]) {
83 | [self addObserver:self forKeyPath:keyPath options:NSKeyValueObservingOptionNew context:NULL];
84 | }
85 | }
86 | -(NSArray *)observeKeyPaths{
87 | NSArray *pathArr = [NSArray arrayWithObjects:@"titleNormalColor",@"titleSelectColor",@"titleFont",@"defaultSelectIndex", nil];
88 | return pathArr;
89 | }
90 | -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
91 | [self updateUIWithNewValueOfKeypath:keyPath];
92 | }
93 | -(void)updateUIWithNewValueOfKeypath:(NSString *)keyPath{
94 | if ([keyPath isEqualToString:@"titleNormalColor"]) {
95 | [self updateSegmentViewUI:^(UIButton *btn) {
96 | [btn setTitleColor:self.titleNormalColor forState:UIControlStateNormal];
97 | }];
98 | }else if ([keyPath isEqualToString:@"titleSelectColor"]){
99 | [self updateSegmentViewUI:^(UIButton *btn) {
100 | [btn setTitleColor:self.titleSelectColor forState:UIControlStateSelected];
101 | }];
102 | }else if([keyPath isEqualToString:@"titleFont"]){
103 | [self updateSegmentViewUI:^(UIButton *btn) {
104 | btn.titleLabel.font = self.titleFont;
105 | }];
106 | }else if([keyPath isEqualToString:@"defaultSelectIndex"]){
107 | [self updateSegmentViewUI:^(UIButton *btn) {
108 | if (btn.tag == self.defaultSelectIndex) {
109 | btn.selected = YES;
110 | }else{
111 | btn.selected = NO;
112 | }
113 | }];
114 | }
115 |
116 | [self setNeedsLayout];//标记需要刷新
117 | [self layoutIfNeeded];//刷新界面
118 | }
119 | -(void)updateSegmentViewUI:(void(^)(UIButton *btn))complete{
120 | for (UIButton *btn in self.btnArray) {
121 | [btn setTitleColor:self.titleNormalColor forState:UIControlStateNormal];
122 | [btn setTitleColor:self.titleSelectColor forState:UIControlStateSelected];
123 | btn.titleLabel.font = self.titleFont;
124 | if (complete) {
125 | complete(btn);
126 | }
127 | }
128 | }
129 |
130 | -(void)setTitleArray:(NSArray *)titleArray{
131 | if (!titleArray) {
132 | return;
133 | }
134 | _titleArray = titleArray;
135 | self.bottomLine = [[UIView alloc]initWithFrame:CGRectMake(self.segmentWidth/4.0-BOTTOM_LINE_WIDTH/2.0, self.segmentHeight-4, BOTTOM_LINE_WIDTH, 2)];
136 | self.bottomLine.backgroundColor = [UIColor redColor];
137 | [self.bgScrollView addSubview:self.bottomLine];
138 |
139 | self.bgScrollView.contentSize = CGSizeMake(BTN_WIDTH*_titleArray.count, self.segmentHeight);
140 |
141 | for (int i = 0; i<_titleArray.count; i++) {
142 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
143 | btn.frame = CGRectMake(self.segmentWidth/4.0-BTN_WIDTH/2.0+self.segmentWidth/2.0*i, 0, BTN_WIDTH, self.segmentHeight-2);
144 | btn.tag = i+1;
145 | [btn setTitle:_titleArray[i] forState:UIControlStateNormal];
146 | [btn setTitleColor:_titleNormalColor forState:UIControlStateNormal];
147 | [btn setTitleColor:_titleSelectColor forState:UIControlStateSelected];
148 | [btn addTarget:self action:@selector(btnIndexClick:) forControlEvents:UIControlEventTouchUpInside];
149 | btn.backgroundColor = [UIColor clearColor];
150 | btn.titleLabel.font = self.titleFont;
151 | [self.bgScrollView addSubview:btn];
152 |
153 | [self.btnArray addObject:btn];
154 | if (self.defaultSelectIndex - 1 == i) {
155 | self.selectBtn = btn;
156 | btn.selected = YES;
157 | btn.transform = CGAffineTransformMakeScale(1*BTN_BASE_SCALE+1, 1*BTN_BASE_SCALE+1);
158 | }
159 | }
160 | }
161 | //segment 点击按钮事件
162 | -(void)btnIndexClick:(id)sender{
163 | UIButton *btn = (UIButton *)sender;
164 |
165 | if (self.delegate && [self.delegate respondsToSelector:@selector(dySegment:didSelectIndex:)]) {
166 | [self.delegate dySegment:self didSelectIndex:btn.tag];
167 | }
168 |
169 | if (btn.tag == self.defaultSelectIndex) {
170 | return;
171 | }else{
172 | self.selectBtn.selected = NO;
173 | btn.selected = YES;
174 | self.selectBtn = btn;
175 | self.defaultSelectIndex = btn.tag;
176 | }
177 | }
178 | //滑动了,根据偏移的量还改变字体颜色
179 | -(void)dyDidScrollChangeTheTitleColorWithContentOfSet:(CGFloat)width{
180 | NSInteger leftIndex = width/ScreenWidth -1;
181 | if (leftIndex < 0) {
182 | leftIndex = 0;
183 | }
184 | NSInteger rightIndex = leftIndex + 1;
185 |
186 | //获取左边按钮
187 | UIButton *leftBtn = self.btnArray[leftIndex];
188 | UIButton *rightBtn;
189 | NSInteger count = self.btnArray.count;
190 | if (rightIndex < count) {
191 | rightBtn = self.btnArray[rightIndex];
192 | }
193 |
194 | //计算右边按钮的偏移比 相对比
195 | CGFloat rightScale = width/ScreenWidth;
196 | rightScale = rightScale-leftIndex;
197 |
198 | //左边按钮的偏移比
199 | CGFloat leftScale = 1-rightScale;
200 |
201 | //按钮发生相对应的形变
202 | leftBtn.transform = CGAffineTransformMakeScale(leftScale*BTN_BASE_SCALE+1, leftScale*BTN_BASE_SCALE+1);
203 | rightBtn.transform = CGAffineTransformMakeScale(rightScale*BTN_BASE_SCALE+1, rightScale*BTN_BASE_SCALE+1);
204 |
205 | //按钮文字颜色渐变
206 | CGFloat normalRed,normalGreen,normalBlue,normalAlpha;
207 | CGFloat selectRed,selectGreen,selectBlue,selectAlpha;
208 |
209 | //获取正常设置颜色
210 | [self.titleNormalColor getRed:&normalRed green:&normalGreen blue:&normalBlue alpha:&normalAlpha];
211 | [self.titleSelectColor getRed:&selectRed green:&selectGreen blue:&selectBlue alpha:&selectAlpha];
212 |
213 | //选中和未选中的色差
214 | CGFloat redDif = selectRed - normalRed;
215 | CGFloat greenDif = selectGreen - normalGreen;
216 | CGFloat blueDif = selectBlue - normalBlue;
217 | CGFloat alphaDif = selectAlpha - normalAlpha;
218 |
219 | leftBtn.titleLabel.textColor = [UIColor colorWithRed:leftScale * redDif + normalRed green:leftScale * greenDif + normalGreen blue:leftScale * blueDif + normalBlue alpha:leftScale * alphaDif+normalAlpha];
220 | rightBtn.titleLabel.textColor = [UIColor colorWithRed:rightScale * redDif + normalRed green:rightScale * greenDif + normalGreen blue:rightScale * blueDif + normalBlue alpha:rightScale * alphaDif+normalAlpha];
221 |
222 | //底部线的偏移
223 | CGRect frame = self.bottomLine.frame;
224 | CGFloat lineDif = rightBtn.frame.origin.x-leftBtn.frame.origin.x;
225 |
226 | frame.origin.x = rightScale*lineDif+leftBtn.frame.origin.x+leftBtn.frame.size.width/2.0-BOTTOM_LINE_WIDTH/2.0;
227 | self.bottomLine.frame = frame;
228 | }
229 |
230 | -(void)dealloc{
231 | for (NSString *keyPath in [self observeKeyPaths]) {
232 | [self removeObserver:self forKeyPath:keyPath];
233 | }
234 | [[NSNotificationCenter defaultCenter]removeObserver:self];
235 | }
236 |
237 | @end
238 |
--------------------------------------------------------------------------------
/DYScrollSegmentDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 6D553D971E9B3CAF009595E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553D961E9B3CAF009595E6 /* main.m */; };
11 | 6D553D9A1E9B3CAF009595E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553D991E9B3CAF009595E6 /* AppDelegate.m */; };
12 | 6D553D9D1E9B3CAF009595E6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553D9C1E9B3CAF009595E6 /* ViewController.m */; };
13 | 6D553DA01E9B3CAF009595E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D553D9E1E9B3CAF009595E6 /* Main.storyboard */; };
14 | 6D553DA21E9B3CAF009595E6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D553DA11E9B3CAF009595E6 /* Assets.xcassets */; };
15 | 6D553DA51E9B3CAF009595E6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D553DA31E9B3CAF009595E6 /* LaunchScreen.storyboard */; };
16 | 6D553DB01E9B3CAF009595E6 /* DYScrollSegmentDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553DAF1E9B3CAF009595E6 /* DYScrollSegmentDemoTests.m */; };
17 | 6D553DBB1E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553DBA1E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.m */; };
18 | 6D553DCB1E9B3D6A009595E6 /* DYVCSegmentOne.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553DCA1E9B3D6A009595E6 /* DYVCSegmentOne.m */; };
19 | 6D553DCE1E9B3D79009595E6 /* DYVCSegmentTwo.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553DCD1E9B3D79009595E6 /* DYVCSegmentTwo.m */; };
20 | 6D553DD11E9B3E9C009595E6 /* DYSegmentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D553DD01E9B3E9C009595E6 /* DYSegmentView.m */; };
21 | 6D8655291E9F6D4700C39836 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6D86552B1E9F6D4700C39836 /* InfoPlist.strings */; };
22 | /* End PBXBuildFile section */
23 |
24 | /* Begin PBXContainerItemProxy section */
25 | 6D553DAC1E9B3CAF009595E6 /* PBXContainerItemProxy */ = {
26 | isa = PBXContainerItemProxy;
27 | containerPortal = 6D553D8A1E9B3CAF009595E6 /* Project object */;
28 | proxyType = 1;
29 | remoteGlobalIDString = 6D553D911E9B3CAF009595E6;
30 | remoteInfo = DYScrollSegmentDemo;
31 | };
32 | 6D553DB71E9B3CAF009595E6 /* PBXContainerItemProxy */ = {
33 | isa = PBXContainerItemProxy;
34 | containerPortal = 6D553D8A1E9B3CAF009595E6 /* Project object */;
35 | proxyType = 1;
36 | remoteGlobalIDString = 6D553D911E9B3CAF009595E6;
37 | remoteInfo = DYScrollSegmentDemo;
38 | };
39 | /* End PBXContainerItemProxy section */
40 |
41 | /* Begin PBXFileReference section */
42 | 6D553D921E9B3CAF009595E6 /* DYScrollSegmentDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DYScrollSegmentDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 6D553D961E9B3CAF009595E6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
44 | 6D553D981E9B3CAF009595E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
45 | 6D553D991E9B3CAF009595E6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
46 | 6D553D9B1E9B3CAF009595E6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
47 | 6D553D9C1E9B3CAF009595E6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
48 | 6D553D9F1E9B3CAF009595E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
49 | 6D553DA11E9B3CAF009595E6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
50 | 6D553DA41E9B3CAF009595E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
51 | 6D553DA61E9B3CAF009595E6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | 6D553DAB1E9B3CAF009595E6 /* DYScrollSegmentDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DYScrollSegmentDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 6D553DAF1E9B3CAF009595E6 /* DYScrollSegmentDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DYScrollSegmentDemoTests.m; sourceTree = ""; };
54 | 6D553DB11E9B3CAF009595E6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | 6D553DB61E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DYScrollSegmentDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
56 | 6D553DBA1E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DYScrollSegmentDemoUITests.m; sourceTree = ""; };
57 | 6D553DBC1E9B3CAF009595E6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | 6D553DC91E9B3D6A009595E6 /* DYVCSegmentOne.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DYVCSegmentOne.h; sourceTree = ""; };
59 | 6D553DCA1E9B3D6A009595E6 /* DYVCSegmentOne.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DYVCSegmentOne.m; sourceTree = ""; };
60 | 6D553DCC1E9B3D79009595E6 /* DYVCSegmentTwo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DYVCSegmentTwo.h; sourceTree = ""; };
61 | 6D553DCD1E9B3D79009595E6 /* DYVCSegmentTwo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DYVCSegmentTwo.m; sourceTree = ""; };
62 | 6D553DCF1E9B3E9C009595E6 /* DYSegmentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DYSegmentView.h; sourceTree = ""; };
63 | 6D553DD01E9B3E9C009595E6 /* DYSegmentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DYSegmentView.m; sourceTree = ""; };
64 | 6D86552A1E9F6D4700C39836 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/InfoPlist.strings; sourceTree = ""; };
65 | 6D86552C1E9F6D5200C39836 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = ""; };
66 | 6D86552D1E9F6D5200C39836 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/LaunchScreen.strings; sourceTree = ""; };
67 | 6D86552E1E9F6D5200C39836 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; };
68 | 6D86552F1E9F6D5800C39836 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = ""; };
69 | 6D8655301E9F6D5800C39836 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = ""; };
70 | 6D8655311E9F6D5800C39836 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = ""; };
71 | 6D8655321E9F6D5C00C39836 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Main.strings"; sourceTree = ""; };
72 | 6D8655331E9F6D5C00C39836 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/LaunchScreen.strings"; sourceTree = ""; };
73 | 6D8655341E9F6D5C00C39836 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = ""; };
74 | /* End PBXFileReference section */
75 |
76 | /* Begin PBXFrameworksBuildPhase section */
77 | 6D553D8F1E9B3CAF009595E6 /* Frameworks */ = {
78 | isa = PBXFrameworksBuildPhase;
79 | buildActionMask = 2147483647;
80 | files = (
81 | );
82 | runOnlyForDeploymentPostprocessing = 0;
83 | };
84 | 6D553DA81E9B3CAF009595E6 /* Frameworks */ = {
85 | isa = PBXFrameworksBuildPhase;
86 | buildActionMask = 2147483647;
87 | files = (
88 | );
89 | runOnlyForDeploymentPostprocessing = 0;
90 | };
91 | 6D553DB31E9B3CAF009595E6 /* Frameworks */ = {
92 | isa = PBXFrameworksBuildPhase;
93 | buildActionMask = 2147483647;
94 | files = (
95 | );
96 | runOnlyForDeploymentPostprocessing = 0;
97 | };
98 | /* End PBXFrameworksBuildPhase section */
99 |
100 | /* Begin PBXGroup section */
101 | 6D553D891E9B3CAF009595E6 = {
102 | isa = PBXGroup;
103 | children = (
104 | 6D553D941E9B3CAF009595E6 /* DYScrollSegmentDemo */,
105 | 6D553DAE1E9B3CAF009595E6 /* DYScrollSegmentDemoTests */,
106 | 6D553DB91E9B3CAF009595E6 /* DYScrollSegmentDemoUITests */,
107 | 6D553D931E9B3CAF009595E6 /* Products */,
108 | );
109 | sourceTree = "";
110 | };
111 | 6D553D931E9B3CAF009595E6 /* Products */ = {
112 | isa = PBXGroup;
113 | children = (
114 | 6D553D921E9B3CAF009595E6 /* DYScrollSegmentDemo.app */,
115 | 6D553DAB1E9B3CAF009595E6 /* DYScrollSegmentDemoTests.xctest */,
116 | 6D553DB61E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.xctest */,
117 | );
118 | name = Products;
119 | sourceTree = "";
120 | };
121 | 6D553D941E9B3CAF009595E6 /* DYScrollSegmentDemo */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 6D553D981E9B3CAF009595E6 /* AppDelegate.h */,
125 | 6D553D991E9B3CAF009595E6 /* AppDelegate.m */,
126 | 6D553D9B1E9B3CAF009595E6 /* ViewController.h */,
127 | 6D553D9C1E9B3CAF009595E6 /* ViewController.m */,
128 | 6D553DCF1E9B3E9C009595E6 /* DYSegmentView.h */,
129 | 6D553DD01E9B3E9C009595E6 /* DYSegmentView.m */,
130 | 6D553DC91E9B3D6A009595E6 /* DYVCSegmentOne.h */,
131 | 6D553DCA1E9B3D6A009595E6 /* DYVCSegmentOne.m */,
132 | 6D553DCC1E9B3D79009595E6 /* DYVCSegmentTwo.h */,
133 | 6D553DCD1E9B3D79009595E6 /* DYVCSegmentTwo.m */,
134 | 6D553D9E1E9B3CAF009595E6 /* Main.storyboard */,
135 | 6D553DA11E9B3CAF009595E6 /* Assets.xcassets */,
136 | 6D553DA31E9B3CAF009595E6 /* LaunchScreen.storyboard */,
137 | 6D553DA61E9B3CAF009595E6 /* Info.plist */,
138 | 6D86552B1E9F6D4700C39836 /* InfoPlist.strings */,
139 | 6D553D951E9B3CAF009595E6 /* Supporting Files */,
140 | );
141 | path = DYScrollSegmentDemo;
142 | sourceTree = "";
143 | };
144 | 6D553D951E9B3CAF009595E6 /* Supporting Files */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 6D553D961E9B3CAF009595E6 /* main.m */,
148 | );
149 | name = "Supporting Files";
150 | sourceTree = "";
151 | };
152 | 6D553DAE1E9B3CAF009595E6 /* DYScrollSegmentDemoTests */ = {
153 | isa = PBXGroup;
154 | children = (
155 | 6D553DAF1E9B3CAF009595E6 /* DYScrollSegmentDemoTests.m */,
156 | 6D553DB11E9B3CAF009595E6 /* Info.plist */,
157 | );
158 | path = DYScrollSegmentDemoTests;
159 | sourceTree = "";
160 | };
161 | 6D553DB91E9B3CAF009595E6 /* DYScrollSegmentDemoUITests */ = {
162 | isa = PBXGroup;
163 | children = (
164 | 6D553DBA1E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.m */,
165 | 6D553DBC1E9B3CAF009595E6 /* Info.plist */,
166 | );
167 | path = DYScrollSegmentDemoUITests;
168 | sourceTree = "";
169 | };
170 | /* End PBXGroup section */
171 |
172 | /* Begin PBXNativeTarget section */
173 | 6D553D911E9B3CAF009595E6 /* DYScrollSegmentDemo */ = {
174 | isa = PBXNativeTarget;
175 | buildConfigurationList = 6D553DBF1E9B3CAF009595E6 /* Build configuration list for PBXNativeTarget "DYScrollSegmentDemo" */;
176 | buildPhases = (
177 | 6D553D8E1E9B3CAF009595E6 /* Sources */,
178 | 6D553D8F1E9B3CAF009595E6 /* Frameworks */,
179 | 6D553D901E9B3CAF009595E6 /* Resources */,
180 | );
181 | buildRules = (
182 | );
183 | dependencies = (
184 | );
185 | name = DYScrollSegmentDemo;
186 | productName = DYScrollSegmentDemo;
187 | productReference = 6D553D921E9B3CAF009595E6 /* DYScrollSegmentDemo.app */;
188 | productType = "com.apple.product-type.application";
189 | };
190 | 6D553DAA1E9B3CAF009595E6 /* DYScrollSegmentDemoTests */ = {
191 | isa = PBXNativeTarget;
192 | buildConfigurationList = 6D553DC21E9B3CAF009595E6 /* Build configuration list for PBXNativeTarget "DYScrollSegmentDemoTests" */;
193 | buildPhases = (
194 | 6D553DA71E9B3CAF009595E6 /* Sources */,
195 | 6D553DA81E9B3CAF009595E6 /* Frameworks */,
196 | 6D553DA91E9B3CAF009595E6 /* Resources */,
197 | );
198 | buildRules = (
199 | );
200 | dependencies = (
201 | 6D553DAD1E9B3CAF009595E6 /* PBXTargetDependency */,
202 | );
203 | name = DYScrollSegmentDemoTests;
204 | productName = DYScrollSegmentDemoTests;
205 | productReference = 6D553DAB1E9B3CAF009595E6 /* DYScrollSegmentDemoTests.xctest */;
206 | productType = "com.apple.product-type.bundle.unit-test";
207 | };
208 | 6D553DB51E9B3CAF009595E6 /* DYScrollSegmentDemoUITests */ = {
209 | isa = PBXNativeTarget;
210 | buildConfigurationList = 6D553DC51E9B3CAF009595E6 /* Build configuration list for PBXNativeTarget "DYScrollSegmentDemoUITests" */;
211 | buildPhases = (
212 | 6D553DB21E9B3CAF009595E6 /* Sources */,
213 | 6D553DB31E9B3CAF009595E6 /* Frameworks */,
214 | 6D553DB41E9B3CAF009595E6 /* Resources */,
215 | );
216 | buildRules = (
217 | );
218 | dependencies = (
219 | 6D553DB81E9B3CAF009595E6 /* PBXTargetDependency */,
220 | );
221 | name = DYScrollSegmentDemoUITests;
222 | productName = DYScrollSegmentDemoUITests;
223 | productReference = 6D553DB61E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.xctest */;
224 | productType = "com.apple.product-type.bundle.ui-testing";
225 | };
226 | /* End PBXNativeTarget section */
227 |
228 | /* Begin PBXProject section */
229 | 6D553D8A1E9B3CAF009595E6 /* Project object */ = {
230 | isa = PBXProject;
231 | attributes = {
232 | LastUpgradeCheck = 0820;
233 | ORGANIZATIONNAME = "Daniel Yao";
234 | TargetAttributes = {
235 | 6D553D911E9B3CAF009595E6 = {
236 | CreatedOnToolsVersion = 8.2.1;
237 | DevelopmentTeam = C79HGK3MHM;
238 | ProvisioningStyle = Automatic;
239 | };
240 | 6D553DAA1E9B3CAF009595E6 = {
241 | CreatedOnToolsVersion = 8.2.1;
242 | DevelopmentTeam = C79HGK3MHM;
243 | ProvisioningStyle = Automatic;
244 | TestTargetID = 6D553D911E9B3CAF009595E6;
245 | };
246 | 6D553DB51E9B3CAF009595E6 = {
247 | CreatedOnToolsVersion = 8.2.1;
248 | DevelopmentTeam = C79HGK3MHM;
249 | ProvisioningStyle = Automatic;
250 | TestTargetID = 6D553D911E9B3CAF009595E6;
251 | };
252 | };
253 | };
254 | buildConfigurationList = 6D553D8D1E9B3CAF009595E6 /* Build configuration list for PBXProject "DYScrollSegmentDemo" */;
255 | compatibilityVersion = "Xcode 3.2";
256 | developmentRegion = English;
257 | hasScannedForEncodings = 0;
258 | knownRegions = (
259 | Base,
260 | en,
261 | "zh-Hans",
262 | "zh-Hant",
263 | );
264 | mainGroup = 6D553D891E9B3CAF009595E6;
265 | productRefGroup = 6D553D931E9B3CAF009595E6 /* Products */;
266 | projectDirPath = "";
267 | projectRoot = "";
268 | targets = (
269 | 6D553D911E9B3CAF009595E6 /* DYScrollSegmentDemo */,
270 | 6D553DAA1E9B3CAF009595E6 /* DYScrollSegmentDemoTests */,
271 | 6D553DB51E9B3CAF009595E6 /* DYScrollSegmentDemoUITests */,
272 | );
273 | };
274 | /* End PBXProject section */
275 |
276 | /* Begin PBXResourcesBuildPhase section */
277 | 6D553D901E9B3CAF009595E6 /* Resources */ = {
278 | isa = PBXResourcesBuildPhase;
279 | buildActionMask = 2147483647;
280 | files = (
281 | 6D553DA51E9B3CAF009595E6 /* LaunchScreen.storyboard in Resources */,
282 | 6D8655291E9F6D4700C39836 /* InfoPlist.strings in Resources */,
283 | 6D553DA21E9B3CAF009595E6 /* Assets.xcassets in Resources */,
284 | 6D553DA01E9B3CAF009595E6 /* Main.storyboard in Resources */,
285 | );
286 | runOnlyForDeploymentPostprocessing = 0;
287 | };
288 | 6D553DA91E9B3CAF009595E6 /* Resources */ = {
289 | isa = PBXResourcesBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | );
293 | runOnlyForDeploymentPostprocessing = 0;
294 | };
295 | 6D553DB41E9B3CAF009595E6 /* Resources */ = {
296 | isa = PBXResourcesBuildPhase;
297 | buildActionMask = 2147483647;
298 | files = (
299 | );
300 | runOnlyForDeploymentPostprocessing = 0;
301 | };
302 | /* End PBXResourcesBuildPhase section */
303 |
304 | /* Begin PBXSourcesBuildPhase section */
305 | 6D553D8E1E9B3CAF009595E6 /* Sources */ = {
306 | isa = PBXSourcesBuildPhase;
307 | buildActionMask = 2147483647;
308 | files = (
309 | 6D553D9D1E9B3CAF009595E6 /* ViewController.m in Sources */,
310 | 6D553DD11E9B3E9C009595E6 /* DYSegmentView.m in Sources */,
311 | 6D553D9A1E9B3CAF009595E6 /* AppDelegate.m in Sources */,
312 | 6D553DCB1E9B3D6A009595E6 /* DYVCSegmentOne.m in Sources */,
313 | 6D553DCE1E9B3D79009595E6 /* DYVCSegmentTwo.m in Sources */,
314 | 6D553D971E9B3CAF009595E6 /* main.m in Sources */,
315 | );
316 | runOnlyForDeploymentPostprocessing = 0;
317 | };
318 | 6D553DA71E9B3CAF009595E6 /* Sources */ = {
319 | isa = PBXSourcesBuildPhase;
320 | buildActionMask = 2147483647;
321 | files = (
322 | 6D553DB01E9B3CAF009595E6 /* DYScrollSegmentDemoTests.m in Sources */,
323 | );
324 | runOnlyForDeploymentPostprocessing = 0;
325 | };
326 | 6D553DB21E9B3CAF009595E6 /* Sources */ = {
327 | isa = PBXSourcesBuildPhase;
328 | buildActionMask = 2147483647;
329 | files = (
330 | 6D553DBB1E9B3CAF009595E6 /* DYScrollSegmentDemoUITests.m in Sources */,
331 | );
332 | runOnlyForDeploymentPostprocessing = 0;
333 | };
334 | /* End PBXSourcesBuildPhase section */
335 |
336 | /* Begin PBXTargetDependency section */
337 | 6D553DAD1E9B3CAF009595E6 /* PBXTargetDependency */ = {
338 | isa = PBXTargetDependency;
339 | target = 6D553D911E9B3CAF009595E6 /* DYScrollSegmentDemo */;
340 | targetProxy = 6D553DAC1E9B3CAF009595E6 /* PBXContainerItemProxy */;
341 | };
342 | 6D553DB81E9B3CAF009595E6 /* PBXTargetDependency */ = {
343 | isa = PBXTargetDependency;
344 | target = 6D553D911E9B3CAF009595E6 /* DYScrollSegmentDemo */;
345 | targetProxy = 6D553DB71E9B3CAF009595E6 /* PBXContainerItemProxy */;
346 | };
347 | /* End PBXTargetDependency section */
348 |
349 | /* Begin PBXVariantGroup section */
350 | 6D553D9E1E9B3CAF009595E6 /* Main.storyboard */ = {
351 | isa = PBXVariantGroup;
352 | children = (
353 | 6D553D9F1E9B3CAF009595E6 /* Base */,
354 | 6D86552C1E9F6D5200C39836 /* en */,
355 | 6D86552F1E9F6D5800C39836 /* zh-Hans */,
356 | 6D8655321E9F6D5C00C39836 /* zh-Hant */,
357 | );
358 | name = Main.storyboard;
359 | sourceTree = "";
360 | };
361 | 6D553DA31E9B3CAF009595E6 /* LaunchScreen.storyboard */ = {
362 | isa = PBXVariantGroup;
363 | children = (
364 | 6D553DA41E9B3CAF009595E6 /* Base */,
365 | 6D86552D1E9F6D5200C39836 /* en */,
366 | 6D8655301E9F6D5800C39836 /* zh-Hans */,
367 | 6D8655331E9F6D5C00C39836 /* zh-Hant */,
368 | );
369 | name = LaunchScreen.storyboard;
370 | sourceTree = "";
371 | };
372 | 6D86552B1E9F6D4700C39836 /* InfoPlist.strings */ = {
373 | isa = PBXVariantGroup;
374 | children = (
375 | 6D86552A1E9F6D4700C39836 /* Base */,
376 | 6D86552E1E9F6D5200C39836 /* en */,
377 | 6D8655311E9F6D5800C39836 /* zh-Hans */,
378 | 6D8655341E9F6D5C00C39836 /* zh-Hant */,
379 | );
380 | name = InfoPlist.strings;
381 | sourceTree = "";
382 | };
383 | /* End PBXVariantGroup section */
384 |
385 | /* Begin XCBuildConfiguration section */
386 | 6D553DBD1E9B3CAF009595E6 /* Debug */ = {
387 | isa = XCBuildConfiguration;
388 | buildSettings = {
389 | ALWAYS_SEARCH_USER_PATHS = NO;
390 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
391 | CLANG_ANALYZER_NONNULL = YES;
392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
393 | CLANG_CXX_LIBRARY = "libc++";
394 | CLANG_ENABLE_MODULES = YES;
395 | CLANG_ENABLE_OBJC_ARC = YES;
396 | CLANG_WARN_BOOL_CONVERSION = YES;
397 | CLANG_WARN_CONSTANT_CONVERSION = YES;
398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
399 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
400 | CLANG_WARN_EMPTY_BODY = YES;
401 | CLANG_WARN_ENUM_CONVERSION = YES;
402 | CLANG_WARN_INFINITE_RECURSION = YES;
403 | CLANG_WARN_INT_CONVERSION = YES;
404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
405 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
406 | CLANG_WARN_UNREACHABLE_CODE = YES;
407 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
408 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
409 | COPY_PHASE_STRIP = NO;
410 | DEBUG_INFORMATION_FORMAT = dwarf;
411 | ENABLE_STRICT_OBJC_MSGSEND = YES;
412 | ENABLE_TESTABILITY = YES;
413 | GCC_C_LANGUAGE_STANDARD = gnu99;
414 | GCC_DYNAMIC_NO_PIC = NO;
415 | GCC_NO_COMMON_BLOCKS = YES;
416 | GCC_OPTIMIZATION_LEVEL = 0;
417 | GCC_PREPROCESSOR_DEFINITIONS = (
418 | "DEBUG=1",
419 | "$(inherited)",
420 | );
421 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
422 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
423 | GCC_WARN_UNDECLARED_SELECTOR = YES;
424 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
425 | GCC_WARN_UNUSED_FUNCTION = YES;
426 | GCC_WARN_UNUSED_VARIABLE = YES;
427 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
428 | MTL_ENABLE_DEBUG_INFO = YES;
429 | ONLY_ACTIVE_ARCH = YES;
430 | SDKROOT = iphoneos;
431 | TARGETED_DEVICE_FAMILY = "1,2";
432 | };
433 | name = Debug;
434 | };
435 | 6D553DBE1E9B3CAF009595E6 /* Release */ = {
436 | isa = XCBuildConfiguration;
437 | buildSettings = {
438 | ALWAYS_SEARCH_USER_PATHS = NO;
439 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
440 | CLANG_ANALYZER_NONNULL = YES;
441 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
442 | CLANG_CXX_LIBRARY = "libc++";
443 | CLANG_ENABLE_MODULES = YES;
444 | CLANG_ENABLE_OBJC_ARC = YES;
445 | CLANG_WARN_BOOL_CONVERSION = YES;
446 | CLANG_WARN_CONSTANT_CONVERSION = YES;
447 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
448 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
449 | CLANG_WARN_EMPTY_BODY = YES;
450 | CLANG_WARN_ENUM_CONVERSION = YES;
451 | CLANG_WARN_INFINITE_RECURSION = YES;
452 | CLANG_WARN_INT_CONVERSION = YES;
453 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
454 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
455 | CLANG_WARN_UNREACHABLE_CODE = YES;
456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
458 | COPY_PHASE_STRIP = NO;
459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
460 | ENABLE_NS_ASSERTIONS = NO;
461 | ENABLE_STRICT_OBJC_MSGSEND = YES;
462 | GCC_C_LANGUAGE_STANDARD = gnu99;
463 | GCC_NO_COMMON_BLOCKS = YES;
464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
466 | GCC_WARN_UNDECLARED_SELECTOR = YES;
467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
468 | GCC_WARN_UNUSED_FUNCTION = YES;
469 | GCC_WARN_UNUSED_VARIABLE = YES;
470 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
471 | MTL_ENABLE_DEBUG_INFO = NO;
472 | SDKROOT = iphoneos;
473 | TARGETED_DEVICE_FAMILY = "1,2";
474 | VALIDATE_PRODUCT = YES;
475 | };
476 | name = Release;
477 | };
478 | 6D553DC01E9B3CAF009595E6 /* Debug */ = {
479 | isa = XCBuildConfiguration;
480 | buildSettings = {
481 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
482 | DEVELOPMENT_TEAM = C79HGK3MHM;
483 | INFOPLIST_FILE = DYScrollSegmentDemo/Info.plist;
484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
485 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.DYScrollSegmentDemo;
486 | PRODUCT_NAME = "$(TARGET_NAME)";
487 | };
488 | name = Debug;
489 | };
490 | 6D553DC11E9B3CAF009595E6 /* Release */ = {
491 | isa = XCBuildConfiguration;
492 | buildSettings = {
493 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
494 | DEVELOPMENT_TEAM = C79HGK3MHM;
495 | INFOPLIST_FILE = DYScrollSegmentDemo/Info.plist;
496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
497 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.DYScrollSegmentDemo;
498 | PRODUCT_NAME = "$(TARGET_NAME)";
499 | };
500 | name = Release;
501 | };
502 | 6D553DC31E9B3CAF009595E6 /* Debug */ = {
503 | isa = XCBuildConfiguration;
504 | buildSettings = {
505 | BUNDLE_LOADER = "$(TEST_HOST)";
506 | DEVELOPMENT_TEAM = C79HGK3MHM;
507 | INFOPLIST_FILE = DYScrollSegmentDemoTests/Info.plist;
508 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
509 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.DYScrollSegmentDemoTests;
510 | PRODUCT_NAME = "$(TARGET_NAME)";
511 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DYScrollSegmentDemo.app/DYScrollSegmentDemo";
512 | };
513 | name = Debug;
514 | };
515 | 6D553DC41E9B3CAF009595E6 /* Release */ = {
516 | isa = XCBuildConfiguration;
517 | buildSettings = {
518 | BUNDLE_LOADER = "$(TEST_HOST)";
519 | DEVELOPMENT_TEAM = C79HGK3MHM;
520 | INFOPLIST_FILE = DYScrollSegmentDemoTests/Info.plist;
521 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
522 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.DYScrollSegmentDemoTests;
523 | PRODUCT_NAME = "$(TARGET_NAME)";
524 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DYScrollSegmentDemo.app/DYScrollSegmentDemo";
525 | };
526 | name = Release;
527 | };
528 | 6D553DC61E9B3CAF009595E6 /* Debug */ = {
529 | isa = XCBuildConfiguration;
530 | buildSettings = {
531 | DEVELOPMENT_TEAM = C79HGK3MHM;
532 | INFOPLIST_FILE = DYScrollSegmentDemoUITests/Info.plist;
533 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
534 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.DYScrollSegmentDemoUITests;
535 | PRODUCT_NAME = "$(TARGET_NAME)";
536 | TEST_TARGET_NAME = DYScrollSegmentDemo;
537 | };
538 | name = Debug;
539 | };
540 | 6D553DC71E9B3CAF009595E6 /* Release */ = {
541 | isa = XCBuildConfiguration;
542 | buildSettings = {
543 | DEVELOPMENT_TEAM = C79HGK3MHM;
544 | INFOPLIST_FILE = DYScrollSegmentDemoUITests/Info.plist;
545 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
546 | PRODUCT_BUNDLE_IDENTIFIER = com.yk.DYScrollSegmentDemoUITests;
547 | PRODUCT_NAME = "$(TARGET_NAME)";
548 | TEST_TARGET_NAME = DYScrollSegmentDemo;
549 | };
550 | name = Release;
551 | };
552 | /* End XCBuildConfiguration section */
553 |
554 | /* Begin XCConfigurationList section */
555 | 6D553D8D1E9B3CAF009595E6 /* Build configuration list for PBXProject "DYScrollSegmentDemo" */ = {
556 | isa = XCConfigurationList;
557 | buildConfigurations = (
558 | 6D553DBD1E9B3CAF009595E6 /* Debug */,
559 | 6D553DBE1E9B3CAF009595E6 /* Release */,
560 | );
561 | defaultConfigurationIsVisible = 0;
562 | defaultConfigurationName = Release;
563 | };
564 | 6D553DBF1E9B3CAF009595E6 /* Build configuration list for PBXNativeTarget "DYScrollSegmentDemo" */ = {
565 | isa = XCConfigurationList;
566 | buildConfigurations = (
567 | 6D553DC01E9B3CAF009595E6 /* Debug */,
568 | 6D553DC11E9B3CAF009595E6 /* Release */,
569 | );
570 | defaultConfigurationIsVisible = 0;
571 | defaultConfigurationName = Release;
572 | };
573 | 6D553DC21E9B3CAF009595E6 /* Build configuration list for PBXNativeTarget "DYScrollSegmentDemoTests" */ = {
574 | isa = XCConfigurationList;
575 | buildConfigurations = (
576 | 6D553DC31E9B3CAF009595E6 /* Debug */,
577 | 6D553DC41E9B3CAF009595E6 /* Release */,
578 | );
579 | defaultConfigurationIsVisible = 0;
580 | defaultConfigurationName = Release;
581 | };
582 | 6D553DC51E9B3CAF009595E6 /* Build configuration list for PBXNativeTarget "DYScrollSegmentDemoUITests" */ = {
583 | isa = XCConfigurationList;
584 | buildConfigurations = (
585 | 6D553DC61E9B3CAF009595E6 /* Debug */,
586 | 6D553DC71E9B3CAF009595E6 /* Release */,
587 | );
588 | defaultConfigurationIsVisible = 0;
589 | defaultConfigurationName = Release;
590 | };
591 | /* End XCConfigurationList section */
592 | };
593 | rootObject = 6D553D8A1E9B3CAF009595E6 /* Project object */;
594 | }
595 |
--------------------------------------------------------------------------------