├── FILE_LICENSE
├── show.png
├── Podfile
├── .gitignore
├── XZPickView.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── project.pbxproj
├── XZPickView
├── ViewController.h
├── AppDelegate.h
├── main.m
├── XZPickView
│ ├── UIView+Category.h
│ ├── UIView+Category.m
│ ├── XZPickView.h
│ └── XZPickView.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── AppDelegate.m
└── ViewController.m
├── readme.md
├── XZPickView.podspec
└── upload.sh
/FILE_LICENSE:
--------------------------------------------------------------------------------
1 | MIT
2 |
--------------------------------------------------------------------------------
/show.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyj179638121/XZPickView/HEAD/show.png
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 |
2 | source 'https://github.com/CocoaPods/Specs.git'
3 |
4 | target 'XZPickView' do
5 |
6 | pod 'Masonry'
7 |
8 | end
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | XZPickView.xcodeproj/xcuserdata/
2 | XZPickView.xcworkspace/
3 | Pods/
4 | *.swp
5 | Podfile.lock
6 | .DS_Store
7 | XZPickView.xcodeproj/project.xcworkspace/xcuserdata/
8 |
--------------------------------------------------------------------------------
/XZPickView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XZPickView/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 17/3/24.
6 | // Copyright © 2017年 zhaoyongjie. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/XZPickView/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 17/3/24.
6 | // Copyright © 2017年 zhaoyongjie. 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 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | XZPickView
2 | ===
3 | ### iOS自定义pickView,时间选择器,类似于滴滴出行时间的选择,具体效果可以根据需求更改pickView的数据源。
4 |
5 | ## 效果图
6 |
7 |
8 | ## 集成说明
9 | 你可以在`Podfile`中加入下面一行代码来使用`XZPickView`
10 |
11 | pod 'XZPickView'
12 |
13 | 然后实现对应的代理方法
14 |
15 | ## 其他
16 | 具体可以参考demo中的代码。
17 |
--------------------------------------------------------------------------------
/XZPickView/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 17/3/24.
6 | // Copyright © 2017年 zhaoyongjie. 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 |
--------------------------------------------------------------------------------
/XZPickView/XZPickView/UIView+Category.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+Category.h
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 2017/6/21.
6 | // Copyright © 2017年 zhaoyongjie. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIView (Category)
12 |
13 | @property (nonatomic, assign)CGFloat width;
14 | @property (nonatomic, assign)CGFloat height;
15 | @property (nonatomic, assign)CGFloat x;
16 | @property (nonatomic, assign)CGFloat y;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/XZPickView.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 |
3 | s.name = "XZPickView"
4 | s.version = "1"
5 | s.summary = "XZPickView."
6 |
7 | s.description = <<-DESC
8 | this is XZPickView
9 | DESC
10 |
11 | s.homepage = "https://github.com/zyj179638121/XZPickView"
12 |
13 | s.license = { :type => "MIT", :file => "FILE_LICENSE" }
14 |
15 | s.author = "zhaoyongjie"
16 |
17 | s.platform = :ios, "8.0"
18 |
19 | s.source = { :git => "https://github.com/zyj179638121/XZPickView.git", :tag => s.version.to_s }
20 |
21 | s.source_files = "XZPickView/XZPickView/*.{h,m}"
22 |
23 | s.requires_arc = true
24 |
25 | s.dependency "Masonry"
26 |
27 | end
28 |
--------------------------------------------------------------------------------
/XZPickView/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 | }
--------------------------------------------------------------------------------
/XZPickView/XZPickView/UIView+Category.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+Category.m
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 2017/6/21.
6 | // Copyright © 2017年 zhaoyongjie. All rights reserved.
7 | //
8 |
9 | #import "UIView+Category.h"
10 |
11 | @implementation UIView (Category)
12 |
13 | - (void)setX:(CGFloat)x{
14 | CGRect rect = self.frame;
15 | rect.origin.x = x;
16 | self.frame = rect;
17 | }
18 |
19 | - (void)setY:(CGFloat)y{
20 | CGRect rect = self.frame;
21 | rect.origin.y = y;
22 | self.frame = rect;
23 | }
24 |
25 | - (void)setWidth:(CGFloat)width{
26 | CGRect rect = self.frame;
27 | rect.size.width = width;
28 | self.frame = rect;
29 | }
30 |
31 | - (void)setHeight:(CGFloat)height{
32 | CGRect rect = self.frame;
33 | rect.size.height = height;
34 | self.frame = rect;
35 | }
36 |
37 | - (CGFloat)x{
38 | return self.frame.origin.x;
39 | }
40 |
41 | - (CGFloat)y{
42 | return self.frame.origin.y;
43 | }
44 |
45 | - (CGFloat)width{
46 | return self.frame.size.width;
47 | }
48 |
49 | - (CGFloat)height{
50 | return self.frame.size.height;
51 | }
52 |
53 | @end
54 |
--------------------------------------------------------------------------------
/upload.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | Cyan='\033[0;36m'
4 | Default='\033[0;m'
5 |
6 | version=""
7 | repoName=""
8 | confirmed="n"
9 |
10 | getVersion() {
11 | read -p "请输入版本号: " version
12 |
13 | if test -z "$version"; then
14 | getVersion
15 | fi
16 | }
17 |
18 | getRepoName() {
19 | read -p "请输入仓库名: " repoName
20 |
21 | if test -z "$repoName"; then
22 | getRepoName
23 | fi
24 | }
25 |
26 | getInfomation() {
27 | getVersion
28 | getRepoName
29 |
30 | echo -e "\n${Default}================================================"
31 | echo -e " Version : ${Cyan}${version}${Default}"
32 | echo -e " RepoName : ${Cyan}${repoName}${Default}"
33 | echo -e "================================================\n"
34 | }
35 |
36 | echo -e "\n"
37 | while [ "$confirmed" != "y" -a "$confirmed" != "Y" ]
38 | do
39 | if [ "$confirmed" == "n" -o "$confirmed" == "N" ]; then
40 | getInfomation
41 | fi
42 | read -p "确定? (y/n):" confirmed
43 | done
44 |
45 | git add .
46 | git commit -m "update to repo"
47 | git tag $version
48 | git push
49 | git push --tags
50 | pod repo push $repoName --allow-warnings --use-libraries
51 | say "finished"
52 | echo "finished"
53 |
--------------------------------------------------------------------------------
/XZPickView/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 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/XZPickView/XZPickView/XZPickView.h:
--------------------------------------------------------------------------------
1 | //
2 | // XZPickView.h
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 17/3/24.
6 | // Copyright © 2017年 zhaoyongjie. All rights reserved.
7 | //
8 |
9 | #import
10 | @class XZPickView;
11 |
12 | @protocol XZPickViewDataSource
13 |
14 | @required
15 |
16 | - (NSInteger)numberOfComponentsInPickerView:(XZPickView *)pickerView;
17 |
18 | - (NSInteger)pickerView:(XZPickView *)pickerView numberOfRowsInComponent:(NSInteger)component;
19 |
20 | @end
21 |
22 | @protocol XZPickViewDelegate
23 |
24 | - (NSString *)pickerView:(XZPickView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
25 |
26 | - (void)pickView:(XZPickView *)pickerView confirmButtonClick:(UIButton *)button;
27 |
28 | @optional
29 | - (NSAttributedString *)pickerView:(XZPickView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)componen;
30 |
31 | - (void)pickerView:(XZPickView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
32 |
33 | @end
34 |
35 | @interface XZPickView : UIView
36 |
37 | @property (nonatomic, weak) id delegate;
38 | @property (nonatomic, weak) id dataSource;
39 | - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title;
40 | - (void)show;
41 | - (void)dismiss;
42 | // 选中某一行
43 | - (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated;
44 | // 获取当前选中的row
45 | - (NSInteger)selectedRowInComponent:(NSInteger)component;
46 |
47 | //刷新某列数据
48 | -(void)pickReloadComponent:(NSInteger)component;
49 | //刷新数据
50 | -(void)reloadData;
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/XZPickView/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 |
--------------------------------------------------------------------------------
/XZPickView/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 17/3/24.
6 | // Copyright © 2017年 zhaoyongjie. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
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 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // 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.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // 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.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // 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.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // 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.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/XZPickView/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 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/XZPickView/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 17/3/24.
6 | // Copyright © 2017年 zhaoyongjie. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "XZPickView.h"
11 |
12 | #define kScreenBounds [UIScreen mainScreen].bounds
13 |
14 | @interface ViewController ()
15 |
16 | @property (nonatomic,strong) XZPickView * pickView;
17 |
18 |
19 | @property (nonatomic,copy) NSDictionary * dateDic;
20 | @property (nonatomic,copy) NSString * weekStr;
21 | @property (nonatomic,copy) NSString * timeStr;
22 | @property (nonatomic, strong) NSDate *selectDate;
23 | @property (nonatomic, assign) NSInteger currentSelectDay;
24 |
25 |
26 |
27 | @end
28 |
29 | @implementation ViewController
30 |
31 | - (void)viewDidLoad {
32 | [super viewDidLoad];
33 | // Do any additional setup after loading the view, typically from a nib.
34 | }
35 |
36 |
37 | - (IBAction)showPickView:(UIButton *)sender {
38 |
39 | NSLog(@"%s",__func__);
40 | self.dateDic = [self LHGetStartTime];
41 | self.weekStr = self.dateDic[@"week"][0];
42 | NSDate *date = [[self.dateDic[@"time"] objectAtIndex:0] objectAtIndex:0];
43 | self.timeStr = [self XZGetTimeStringWithDate:date dateFormatStr:@"HH:mm"];
44 | [self.pickView reloadData];
45 | //[self.userNumPickView selectRow:0 inComponent:0 animated:NO];
46 | [[UIApplication sharedApplication].keyWindow addSubview:self.pickView];
47 | [self.pickView show];
48 | }
49 |
50 |
51 | -(void)pickView:(XZPickView *)pickerView confirmButtonClick:(UIButton *)button{
52 |
53 | NSInteger left = [pickerView selectedRowInComponent:0];
54 | NSInteger right = [pickerView selectedRowInComponent:1];
55 | self.selectDate = [[self.dateDic[@"time"] objectAtIndex:left] objectAtIndex:right];
56 |
57 | NSLog(@"select date = %@",[self XZGetTimeStringWithDate:self.selectDate dateFormatStr:@"yyyy-MM-dd HH:mm:ss"]);
58 | }
59 |
60 | -(NSInteger)pickerView:(XZPickView *)pickerView numberOfRowsInComponent:(NSInteger)component{
61 |
62 | //时间
63 | if (component == 0) {
64 | return [self.dateDic[@"week"] count];
65 | }else{
66 | NSInteger whichWeek = [pickerView selectedRowInComponent:0];
67 | return [[self.dateDic[@"time"] objectAtIndex:whichWeek] count];
68 | }
69 | }
70 |
71 | -(void)pickerView:(XZPickView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
72 |
73 | if(component == 0){
74 | self.currentSelectDay = [pickerView selectedRowInComponent:0];
75 | [pickerView pickReloadComponent:1];
76 | self.weekStr = self.dateDic[@"week"][row];
77 | NSArray *arr = [[self.dateDic objectForKey:@"time"] objectAtIndex:self.currentSelectDay];
78 | NSDate *date = [arr objectAtIndex:[pickerView selectedRowInComponent:1]];
79 | self.timeStr = [self XZGetTimeStringWithDate:date dateFormatStr:@"HH:mm"];
80 | }else{
81 | NSInteger whichWeek = [pickerView selectedRowInComponent:0];
82 | NSDate *date = [[self.dateDic[@"time"] objectAtIndex:whichWeek] objectAtIndex:row];
83 | self.timeStr = [self XZGetTimeStringWithDate:date dateFormatStr:@"HH:mm"];
84 | }
85 |
86 | }
87 |
88 | -(NSString *)pickerView:(XZPickView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
89 |
90 | if(component == 0){
91 | return self.dateDic[@"week"][row];
92 | }else{
93 | NSArray *arr = [[self.dateDic objectForKey:@"time"] objectAtIndex:self.currentSelectDay];
94 | NSDate *date = [arr objectAtIndex:row];
95 | NSString *str = [self XZGetTimeStringWithDate:date dateFormatStr:@"HH:mm"];
96 | return str;
97 | }
98 | }
99 |
100 | -(NSInteger)numberOfComponentsInPickerView:(XZPickView *)pickerView{
101 | return 2;
102 | }
103 |
104 | #pragma mark -
105 |
106 | - (NSString *)XZGetTimeStringWithDate:(NSDate *)date dateFormatStr:(NSString *)dateFormatStr {
107 | NSDateFormatter *format = [[NSDateFormatter alloc] init];
108 | format.dateFormat = dateFormatStr;
109 | return [format stringFromDate:date];
110 | }
111 |
112 | - (NSDictionary *)LHGetStartTime {
113 | // 获取当前date
114 | NSDate *date = [NSDate date];
115 | NSCalendar *calendar = [NSCalendar currentCalendar];
116 | NSDictionary *weekDict = @{@"2" : @"周一", @"3" : @"周二", @"4" : @"周三", @"5" : @"周四", @"6" : @"周五", @"7" : @"周六", @"1" : @"周日"};
117 | // 日期格式
118 | NSDateFormatter *fullFormatter = [[NSDateFormatter alloc] init];
119 | fullFormatter.dateFormat = @"yyyy-MM-dd HH:mm";
120 | // 获取当前几时(晚上23点要把今天的时间做处理)
121 | NSInteger currentHour = [calendar component:NSCalendarUnitHour fromDate:date];
122 | // 存放周几和时间的数组
123 | NSMutableArray *weekStrArr = [NSMutableArray array];
124 | NSMutableArray *detailTimeArr = [NSMutableArray array];
125 | // 设置合适的时间
126 | for (int i = 0; i < 3; i++) {
127 | NSDate *new = [calendar dateByAddingUnit:NSCalendarUnitDay value:i toDate:date options:NSCalendarMatchStrictly];
128 | NSInteger week = [calendar component:NSCalendarUnitWeekday fromDate:new];
129 | // 周几
130 | NSString *weekStr = weekDict[[NSString stringWithFormat:@"%ld",week]];
131 | NSString *todayOrOther = @"";
132 | if (i == 0) {
133 | todayOrOther = @"今天";
134 | }else if (i == 1) {
135 | todayOrOther = @"明天";
136 | }else if (i == 2){
137 | todayOrOther = @"后天";
138 | }
139 | // 今天周几 明天周几 后天周几
140 | NSString *resultWeekStr = [NSString stringWithFormat:@"%@ %@",todayOrOther,weekStr];
141 | [weekStrArr addObject:resultWeekStr];
142 |
143 | NSInteger year = [calendar component:NSCalendarUnitYear fromDate:new];
144 | NSInteger month = [calendar component:NSCalendarUnitMonth fromDate:new];
145 | NSInteger day = [calendar component:NSCalendarUnitDay fromDate:new];
146 |
147 | // 把符合条件的时间筛选出来
148 | NSMutableArray *smallArr = [NSMutableArray array];
149 | for (int hour = 0; hour < 24; hour++) {
150 | for (int min = 0; min < 60; min ++) {
151 | if (min % 15 == 0) {
152 | NSString *tempDateStr = [NSString stringWithFormat:@"%ld-%ld-%ld %d:%d",year,month,day,hour,min];
153 |
154 | NSDate *tempDate = [fullFormatter dateFromString:tempDateStr];
155 | // 今天 之后的时间段
156 | if (i == 0) {
157 | if ([calendar compareDate:tempDate toDate:date toUnitGranularity:NSCalendarUnitHour] == 1) {
158 | [smallArr addObject:tempDate];
159 | }
160 | }else{
161 | [smallArr addObject:tempDate];
162 | }
163 | }
164 | }
165 | }
166 | [detailTimeArr addObject:smallArr];
167 | }
168 | // 晚上23点把今天对应的周几和今天的时间空数组去掉
169 | if (currentHour == 23) {
170 | [weekStrArr removeObjectAtIndex:0];
171 | [detailTimeArr removeObjectAtIndex:0];
172 | }
173 | NSDictionary *resultDic = @{@"week" : weekStrArr , @"time" : detailTimeArr};
174 | return resultDic;
175 | }
176 |
177 | #pragma mark - getter methods
178 |
179 | -(XZPickView *)pickView{
180 | if(!_pickView){
181 | _pickView = [[XZPickView alloc]initWithFrame:kScreenBounds title:@"请选择"];
182 | _pickView.delegate = self;
183 | _pickView.dataSource = self;
184 | }
185 | return _pickView;
186 | }
187 |
188 |
189 | @end
190 |
--------------------------------------------------------------------------------
/XZPickView/XZPickView/XZPickView.m:
--------------------------------------------------------------------------------
1 | //
2 | // XZPickView.m
3 | // XZPickView
4 | //
5 | // Created by 赵永杰 on 17/3/24.
6 | // Copyright © 2017年 zhaoyongjie. All rights reserved.
7 | //
8 |
9 | #import "XZPickView.h"
10 | #import
11 | #import "UIView+Category.h"
12 |
13 | // 屏幕宽度
14 | #define kScreenW [UIScreen mainScreen].bounds.size.width
15 | // 屏幕高度
16 | #define kScreenH [UIScreen mainScreen].bounds.size.height
17 |
18 | #define XZColor(r, g, b) [UIColor colorWithRed:(r) / 255.0 green:(g) / 255.0 blue:(b) / 255.0 alpha:1]
19 |
20 | @interface XZPickView ()
21 |
22 | @property (nonatomic, strong) UIButton *cancelBtn;
23 |
24 | @property (nonatomic, strong) UIButton *confirmBtn;
25 |
26 | @property (nonatomic, strong) UIView *naviContainView;
27 |
28 | @property (nonatomic, strong) UILabel *titleLabel;
29 |
30 | @property (nonatomic, strong) UIPickerView *pickView;
31 |
32 | @property (nonatomic, strong) UIButton *bgBtn;
33 |
34 | @property (nonatomic, strong) UIView *mainView;
35 |
36 | @end
37 |
38 | @implementation XZPickView
39 |
40 | - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title {
41 | self = [super initWithFrame:frame];
42 | if (self) {
43 | [self setupChildViews];
44 | self.titleLabel.text = title;
45 | }
46 | return self;
47 | }
48 |
49 | - (void)setupChildViews {
50 |
51 | [self addSubview:self.bgBtn];
52 | [self addSubview:self.mainView];
53 |
54 | [self.mainView addSubview:self.naviContainView];
55 | [self.naviContainView addSubview:self.cancelBtn];
56 | [self.naviContainView addSubview:self.titleLabel];
57 | [self.naviContainView addSubview:self.confirmBtn];
58 | [self.mainView addSubview:self.pickView];
59 |
60 | [self.bgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
61 | make.edges.equalTo(self);
62 | }];
63 |
64 | [self.mainView setFrame:CGRectMake(0, kScreenH, kScreenW, 260)];
65 |
66 | [self.naviContainView mas_makeConstraints:^(MASConstraintMaker *make) {
67 | make.top.left.right.equalTo(self.mainView);
68 | make.height.mas_equalTo(44);
69 | }];
70 |
71 | [self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
72 | make.left.mas_equalTo(12);
73 | make.centerY.equalTo(self.naviContainView);
74 | }];
75 |
76 | [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
77 | make.center.equalTo(self.naviContainView);
78 | }];
79 |
80 | [self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
81 | make.right.mas_equalTo(-12);
82 | make.centerY.equalTo(self.naviContainView);
83 | }];
84 |
85 | [self.pickView mas_makeConstraints:^(MASConstraintMaker *make) {
86 | make.top.equalTo(self.naviContainView.mas_bottom);
87 | make.left.right.bottom.equalTo(self.mainView);
88 | }];
89 | }
90 |
91 | #pragma mark - private methods
92 |
93 | - (void)cancelAction:(UIButton *)btn {
94 | [self dismiss];
95 | }
96 |
97 | - (void)confirmAction:(UIButton *)btn {
98 | [self dismiss];
99 | if ([self.delegate respondsToSelector:@selector(pickView:confirmButtonClick:)]) {
100 | [self.delegate pickView:self confirmButtonClick:btn];
101 | }
102 | }
103 |
104 | #pragma mark - public methods
105 |
106 | - (void)show {
107 |
108 | self.bgBtn.alpha = 0.3;
109 | [UIView animateWithDuration:0.3 animations:^{
110 | self.mainView.y = kScreenH - 260;
111 | }];
112 | }
113 |
114 | - (void)dismiss {
115 |
116 | [UIView animateWithDuration:0.3 animations:^{
117 | self.mainView.y = kScreenH;
118 | self.bgBtn.alpha = 0;
119 | } completion:^(BOOL finished) {
120 | [self removeFromSuperview];
121 | }];
122 | }
123 |
124 | - (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated {
125 | [self.pickView selectRow:row inComponent:component animated:animated];
126 | }
127 |
128 | - (NSInteger)selectedRowInComponent:(NSInteger)component {
129 | return [self.pickView selectedRowInComponent:component];
130 | }
131 |
132 | #pragma mark - UIPickViewDelegate, UIPickViewDataSource
133 |
134 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
135 | return [self.dataSource numberOfComponentsInPickerView:self];
136 | }
137 |
138 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
139 | return [self.dataSource pickerView:self numberOfRowsInComponent:component];
140 | }
141 |
142 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
143 | if ([self.delegate respondsToSelector:@selector(pickerView:titleForRow:forComponent:)]) {
144 | return [self.delegate pickerView:self titleForRow:row forComponent:component];
145 | }else{
146 | return @"";
147 | }
148 | }
149 |
150 | - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
151 | if ([self.delegate respondsToSelector:@selector(pickerView:didSelectRow:inComponent:)]) {
152 | return [self.delegate pickerView:self didSelectRow:row inComponent:component];
153 | }
154 | }
155 |
156 | - (NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)component {
157 | if ([self.delegate respondsToSelector:@selector(pickerView:attributedTitleForRow:forComponent:)]) {
158 | return [self.delegate pickerView:self attributedTitleForRow:row forComponent:component];
159 | }else{
160 | return nil;
161 | }
162 | }
163 |
164 |
165 |
166 | #pragma mark - getter methods
167 |
168 | - (UIButton *)cancelBtn {
169 | if (!_cancelBtn) {
170 | _cancelBtn = [[UIButton alloc] init];
171 | [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
172 | [_cancelBtn setTitleColor:XZColor(85, 85, 85) forState:UIControlStateNormal];
173 | [_cancelBtn addTarget:self action:@selector(cancelAction:) forControlEvents:UIControlEventTouchUpInside];
174 | _cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
175 | [_cancelBtn sizeToFit];
176 | }
177 | return _cancelBtn;
178 | }
179 |
180 | - (UIButton *)confirmBtn {
181 | if (!_confirmBtn) {
182 | _confirmBtn = [[UIButton alloc] init];
183 | [_confirmBtn setTitle:@"确定" forState:UIControlStateNormal];
184 | [_confirmBtn setTitleColor:XZColor(255, 126, 0) forState:UIControlStateNormal];
185 | [_confirmBtn addTarget:self action:@selector(confirmAction:) forControlEvents:UIControlEventTouchUpInside];
186 | _confirmBtn.titleLabel.font = [UIFont systemFontOfSize:14];
187 | [_confirmBtn sizeToFit];
188 |
189 | }
190 | return _confirmBtn;
191 | }
192 |
193 | - (UIView *)naviContainView {
194 | if (!_naviContainView) {
195 | _naviContainView = [[UIView alloc] init];
196 | _naviContainView.backgroundColor = [UIColor whiteColor];
197 | }
198 | return _naviContainView;
199 | }
200 |
201 | - (UILabel *)titleLabel {
202 | if (!_titleLabel) {
203 | _titleLabel = [[UILabel alloc] init];
204 | _titleLabel.text = @"title";
205 | _titleLabel.textColor = [UIColor darkGrayColor];
206 | _titleLabel.font = [UIFont systemFontOfSize:17];
207 | }
208 | return _titleLabel;
209 | }
210 |
211 | - (UIPickerView *)pickView {
212 | if (!_pickView) {
213 | _pickView = [[UIPickerView alloc] init];
214 | _pickView.delegate = self;
215 | _pickView.dataSource = self;
216 | }
217 | return _pickView;
218 | }
219 |
220 | - (UIButton *)bgBtn {
221 | if (!_bgBtn) {
222 | _bgBtn = [[UIButton alloc] init];
223 | _bgBtn.backgroundColor = [UIColor blackColor];
224 | _bgBtn.alpha = 0.3;
225 | [_bgBtn addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];
226 | }
227 | return _bgBtn;
228 | }
229 |
230 | - (UIView *)mainView {
231 | if (!_mainView) {
232 | _mainView = [[UIView alloc] init];
233 | _mainView.backgroundColor = [UIColor whiteColor];
234 | }
235 | return _mainView;
236 | }
237 |
238 | -(void)pickReloadComponent:(NSInteger)component{
239 | [self.pickView reloadComponent:component];
240 | }
241 |
242 | -(void)reloadData{
243 | [self.pickView reloadAllComponents];
244 | }
245 |
246 | @end
247 |
--------------------------------------------------------------------------------
/XZPickView.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 081E34F01EFA14A700C8775F /* UIView+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 081E34EF1EFA14A700C8775F /* UIView+Category.m */; };
11 | 083B49741E850FDC00A865F9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 083B49731E850FDC00A865F9 /* main.m */; };
12 | 083B49771E850FDC00A865F9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 083B49761E850FDC00A865F9 /* AppDelegate.m */; };
13 | 083B497A1E850FDC00A865F9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 083B49791E850FDC00A865F9 /* ViewController.m */; };
14 | 083B497D1E850FDC00A865F9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 083B497B1E850FDC00A865F9 /* Main.storyboard */; };
15 | 083B497F1E850FDC00A865F9 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 083B497E1E850FDC00A865F9 /* Assets.xcassets */; };
16 | 083B49821E850FDC00A865F9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 083B49801E850FDC00A865F9 /* LaunchScreen.storyboard */; };
17 | 083B498C1E8510F100A865F9 /* XZPickView.m in Sources */ = {isa = PBXBuildFile; fileRef = 083B498B1E8510F100A865F9 /* XZPickView.m */; };
18 | 7F8995A62DB9C69C6CC07D1B /* libPods-XZPickView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 76430D3FA41D9D879E610744 /* libPods-XZPickView.a */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXFileReference section */
22 | 081E34EE1EFA14A700C8775F /* UIView+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Category.h"; sourceTree = ""; };
23 | 081E34EF1EFA14A700C8775F /* UIView+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Category.m"; sourceTree = ""; };
24 | 083B496F1E850FDC00A865F9 /* XZPickView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = XZPickView.app; sourceTree = BUILT_PRODUCTS_DIR; };
25 | 083B49731E850FDC00A865F9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
26 | 083B49751E850FDC00A865F9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
27 | 083B49761E850FDC00A865F9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
28 | 083B49781E850FDC00A865F9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
29 | 083B49791E850FDC00A865F9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
30 | 083B497C1E850FDC00A865F9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
31 | 083B497E1E850FDC00A865F9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
32 | 083B49811E850FDC00A865F9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
33 | 083B49831E850FDC00A865F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | 083B498A1E8510F100A865F9 /* XZPickView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XZPickView.h; sourceTree = ""; };
35 | 083B498B1E8510F100A865F9 /* XZPickView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XZPickView.m; sourceTree = ""; };
36 | 6717638AC9E47D0D4C3ED713 /* Pods-XZPickView.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XZPickView.debug.xcconfig"; path = "Pods/Target Support Files/Pods-XZPickView/Pods-XZPickView.debug.xcconfig"; sourceTree = ""; };
37 | 76430D3FA41D9D879E610744 /* libPods-XZPickView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-XZPickView.a"; sourceTree = BUILT_PRODUCTS_DIR; };
38 | 92E674C0C6DBD2A4A496227A /* Pods-XZPickView.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-XZPickView.release.xcconfig"; path = "Pods/Target Support Files/Pods-XZPickView/Pods-XZPickView.release.xcconfig"; sourceTree = ""; };
39 | /* End PBXFileReference section */
40 |
41 | /* Begin PBXFrameworksBuildPhase section */
42 | 083B496C1E850FDC00A865F9 /* Frameworks */ = {
43 | isa = PBXFrameworksBuildPhase;
44 | buildActionMask = 2147483647;
45 | files = (
46 | 7F8995A62DB9C69C6CC07D1B /* libPods-XZPickView.a in Frameworks */,
47 | );
48 | runOnlyForDeploymentPostprocessing = 0;
49 | };
50 | /* End PBXFrameworksBuildPhase section */
51 |
52 | /* Begin PBXGroup section */
53 | 083B49661E850FDC00A865F9 = {
54 | isa = PBXGroup;
55 | children = (
56 | 083B49711E850FDC00A865F9 /* XZPickView */,
57 | 083B49701E850FDC00A865F9 /* Products */,
58 | EA1BDCB279C9841D0F2B7F76 /* Pods */,
59 | 6E24CBB582C5086522C58B0B /* Frameworks */,
60 | );
61 | sourceTree = "";
62 | };
63 | 083B49701E850FDC00A865F9 /* Products */ = {
64 | isa = PBXGroup;
65 | children = (
66 | 083B496F1E850FDC00A865F9 /* XZPickView.app */,
67 | );
68 | name = Products;
69 | sourceTree = "";
70 | };
71 | 083B49711E850FDC00A865F9 /* XZPickView */ = {
72 | isa = PBXGroup;
73 | children = (
74 | 083B49891E8510DA00A865F9 /* XZPickView */,
75 | 083B49751E850FDC00A865F9 /* AppDelegate.h */,
76 | 083B49761E850FDC00A865F9 /* AppDelegate.m */,
77 | 083B49781E850FDC00A865F9 /* ViewController.h */,
78 | 083B49791E850FDC00A865F9 /* ViewController.m */,
79 | 083B497B1E850FDC00A865F9 /* Main.storyboard */,
80 | 083B497E1E850FDC00A865F9 /* Assets.xcassets */,
81 | 083B49801E850FDC00A865F9 /* LaunchScreen.storyboard */,
82 | 083B49831E850FDC00A865F9 /* Info.plist */,
83 | 083B49721E850FDC00A865F9 /* Supporting Files */,
84 | );
85 | path = XZPickView;
86 | sourceTree = "";
87 | };
88 | 083B49721E850FDC00A865F9 /* Supporting Files */ = {
89 | isa = PBXGroup;
90 | children = (
91 | 083B49731E850FDC00A865F9 /* main.m */,
92 | );
93 | name = "Supporting Files";
94 | sourceTree = "";
95 | };
96 | 083B49891E8510DA00A865F9 /* XZPickView */ = {
97 | isa = PBXGroup;
98 | children = (
99 | 083B498A1E8510F100A865F9 /* XZPickView.h */,
100 | 083B498B1E8510F100A865F9 /* XZPickView.m */,
101 | 081E34EE1EFA14A700C8775F /* UIView+Category.h */,
102 | 081E34EF1EFA14A700C8775F /* UIView+Category.m */,
103 | );
104 | path = XZPickView;
105 | sourceTree = "";
106 | };
107 | 6E24CBB582C5086522C58B0B /* Frameworks */ = {
108 | isa = PBXGroup;
109 | children = (
110 | 76430D3FA41D9D879E610744 /* libPods-XZPickView.a */,
111 | );
112 | name = Frameworks;
113 | sourceTree = "";
114 | };
115 | EA1BDCB279C9841D0F2B7F76 /* Pods */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 6717638AC9E47D0D4C3ED713 /* Pods-XZPickView.debug.xcconfig */,
119 | 92E674C0C6DBD2A4A496227A /* Pods-XZPickView.release.xcconfig */,
120 | );
121 | name = Pods;
122 | sourceTree = "";
123 | };
124 | /* End PBXGroup section */
125 |
126 | /* Begin PBXNativeTarget section */
127 | 083B496E1E850FDC00A865F9 /* XZPickView */ = {
128 | isa = PBXNativeTarget;
129 | buildConfigurationList = 083B49861E850FDC00A865F9 /* Build configuration list for PBXNativeTarget "XZPickView" */;
130 | buildPhases = (
131 | 7C3BDAD46848048E4B8A4336 /* [CP] Check Pods Manifest.lock */,
132 | 083B496B1E850FDC00A865F9 /* Sources */,
133 | 083B496C1E850FDC00A865F9 /* Frameworks */,
134 | 083B496D1E850FDC00A865F9 /* Resources */,
135 | F0982C4DA8849A8F6326F8C1 /* [CP] Embed Pods Frameworks */,
136 | 06FC8A704E5E9CEA3FCEE5C2 /* [CP] Copy Pods Resources */,
137 | );
138 | buildRules = (
139 | );
140 | dependencies = (
141 | );
142 | name = XZPickView;
143 | productName = XZPickView;
144 | productReference = 083B496F1E850FDC00A865F9 /* XZPickView.app */;
145 | productType = "com.apple.product-type.application";
146 | };
147 | /* End PBXNativeTarget section */
148 |
149 | /* Begin PBXProject section */
150 | 083B49671E850FDC00A865F9 /* Project object */ = {
151 | isa = PBXProject;
152 | attributes = {
153 | LastUpgradeCheck = 0800;
154 | ORGANIZATIONNAME = zhaoyongjie;
155 | TargetAttributes = {
156 | 083B496E1E850FDC00A865F9 = {
157 | CreatedOnToolsVersion = 8.0;
158 | ProvisioningStyle = Automatic;
159 | };
160 | };
161 | };
162 | buildConfigurationList = 083B496A1E850FDC00A865F9 /* Build configuration list for PBXProject "XZPickView" */;
163 | compatibilityVersion = "Xcode 3.2";
164 | developmentRegion = English;
165 | hasScannedForEncodings = 0;
166 | knownRegions = (
167 | en,
168 | Base,
169 | );
170 | mainGroup = 083B49661E850FDC00A865F9;
171 | productRefGroup = 083B49701E850FDC00A865F9 /* Products */;
172 | projectDirPath = "";
173 | projectRoot = "";
174 | targets = (
175 | 083B496E1E850FDC00A865F9 /* XZPickView */,
176 | );
177 | };
178 | /* End PBXProject section */
179 |
180 | /* Begin PBXResourcesBuildPhase section */
181 | 083B496D1E850FDC00A865F9 /* Resources */ = {
182 | isa = PBXResourcesBuildPhase;
183 | buildActionMask = 2147483647;
184 | files = (
185 | 083B49821E850FDC00A865F9 /* LaunchScreen.storyboard in Resources */,
186 | 083B497F1E850FDC00A865F9 /* Assets.xcassets in Resources */,
187 | 083B497D1E850FDC00A865F9 /* Main.storyboard in Resources */,
188 | );
189 | runOnlyForDeploymentPostprocessing = 0;
190 | };
191 | /* End PBXResourcesBuildPhase section */
192 |
193 | /* Begin PBXShellScriptBuildPhase section */
194 | 06FC8A704E5E9CEA3FCEE5C2 /* [CP] Copy Pods Resources */ = {
195 | isa = PBXShellScriptBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | inputPaths = (
200 | );
201 | name = "[CP] Copy Pods Resources";
202 | outputPaths = (
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | shellPath = /bin/sh;
206 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XZPickView/Pods-XZPickView-resources.sh\"\n";
207 | showEnvVarsInLog = 0;
208 | };
209 | 7C3BDAD46848048E4B8A4336 /* [CP] Check Pods Manifest.lock */ = {
210 | isa = PBXShellScriptBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | );
214 | inputPaths = (
215 | );
216 | name = "[CP] Check Pods Manifest.lock";
217 | outputPaths = (
218 | );
219 | runOnlyForDeploymentPostprocessing = 0;
220 | shellPath = /bin/sh;
221 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
222 | showEnvVarsInLog = 0;
223 | };
224 | F0982C4DA8849A8F6326F8C1 /* [CP] Embed Pods Frameworks */ = {
225 | isa = PBXShellScriptBuildPhase;
226 | buildActionMask = 2147483647;
227 | files = (
228 | );
229 | inputPaths = (
230 | );
231 | name = "[CP] Embed Pods Frameworks";
232 | outputPaths = (
233 | );
234 | runOnlyForDeploymentPostprocessing = 0;
235 | shellPath = /bin/sh;
236 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-XZPickView/Pods-XZPickView-frameworks.sh\"\n";
237 | showEnvVarsInLog = 0;
238 | };
239 | /* End PBXShellScriptBuildPhase section */
240 |
241 | /* Begin PBXSourcesBuildPhase section */
242 | 083B496B1E850FDC00A865F9 /* Sources */ = {
243 | isa = PBXSourcesBuildPhase;
244 | buildActionMask = 2147483647;
245 | files = (
246 | 083B497A1E850FDC00A865F9 /* ViewController.m in Sources */,
247 | 083B49771E850FDC00A865F9 /* AppDelegate.m in Sources */,
248 | 083B49741E850FDC00A865F9 /* main.m in Sources */,
249 | 081E34F01EFA14A700C8775F /* UIView+Category.m in Sources */,
250 | 083B498C1E8510F100A865F9 /* XZPickView.m in Sources */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | /* End PBXSourcesBuildPhase section */
255 |
256 | /* Begin PBXVariantGroup section */
257 | 083B497B1E850FDC00A865F9 /* Main.storyboard */ = {
258 | isa = PBXVariantGroup;
259 | children = (
260 | 083B497C1E850FDC00A865F9 /* Base */,
261 | );
262 | name = Main.storyboard;
263 | sourceTree = "";
264 | };
265 | 083B49801E850FDC00A865F9 /* LaunchScreen.storyboard */ = {
266 | isa = PBXVariantGroup;
267 | children = (
268 | 083B49811E850FDC00A865F9 /* Base */,
269 | );
270 | name = LaunchScreen.storyboard;
271 | sourceTree = "";
272 | };
273 | /* End PBXVariantGroup section */
274 |
275 | /* Begin XCBuildConfiguration section */
276 | 083B49841E850FDC00A865F9 /* Debug */ = {
277 | isa = XCBuildConfiguration;
278 | buildSettings = {
279 | ALWAYS_SEARCH_USER_PATHS = NO;
280 | CLANG_ANALYZER_NONNULL = YES;
281 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
282 | CLANG_CXX_LIBRARY = "libc++";
283 | CLANG_ENABLE_MODULES = YES;
284 | CLANG_ENABLE_OBJC_ARC = YES;
285 | CLANG_WARN_BOOL_CONVERSION = YES;
286 | CLANG_WARN_CONSTANT_CONVERSION = YES;
287 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
288 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
289 | CLANG_WARN_EMPTY_BODY = YES;
290 | CLANG_WARN_ENUM_CONVERSION = YES;
291 | CLANG_WARN_INFINITE_RECURSION = YES;
292 | CLANG_WARN_INT_CONVERSION = YES;
293 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
294 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
295 | CLANG_WARN_UNREACHABLE_CODE = YES;
296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
298 | COPY_PHASE_STRIP = NO;
299 | DEBUG_INFORMATION_FORMAT = dwarf;
300 | ENABLE_STRICT_OBJC_MSGSEND = YES;
301 | ENABLE_TESTABILITY = YES;
302 | GCC_C_LANGUAGE_STANDARD = gnu99;
303 | GCC_DYNAMIC_NO_PIC = NO;
304 | GCC_NO_COMMON_BLOCKS = YES;
305 | GCC_OPTIMIZATION_LEVEL = 0;
306 | GCC_PREPROCESSOR_DEFINITIONS = (
307 | "DEBUG=1",
308 | "$(inherited)",
309 | );
310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
312 | GCC_WARN_UNDECLARED_SELECTOR = YES;
313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
314 | GCC_WARN_UNUSED_FUNCTION = YES;
315 | GCC_WARN_UNUSED_VARIABLE = YES;
316 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
317 | MTL_ENABLE_DEBUG_INFO = YES;
318 | ONLY_ACTIVE_ARCH = YES;
319 | SDKROOT = iphoneos;
320 | };
321 | name = Debug;
322 | };
323 | 083B49851E850FDC00A865F9 /* Release */ = {
324 | isa = XCBuildConfiguration;
325 | buildSettings = {
326 | ALWAYS_SEARCH_USER_PATHS = NO;
327 | CLANG_ANALYZER_NONNULL = YES;
328 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
329 | CLANG_CXX_LIBRARY = "libc++";
330 | CLANG_ENABLE_MODULES = YES;
331 | CLANG_ENABLE_OBJC_ARC = YES;
332 | CLANG_WARN_BOOL_CONVERSION = YES;
333 | CLANG_WARN_CONSTANT_CONVERSION = YES;
334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
335 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
336 | CLANG_WARN_EMPTY_BODY = YES;
337 | CLANG_WARN_ENUM_CONVERSION = YES;
338 | CLANG_WARN_INFINITE_RECURSION = YES;
339 | CLANG_WARN_INT_CONVERSION = YES;
340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
341 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
342 | CLANG_WARN_UNREACHABLE_CODE = YES;
343 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
344 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
345 | COPY_PHASE_STRIP = NO;
346 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
347 | ENABLE_NS_ASSERTIONS = NO;
348 | ENABLE_STRICT_OBJC_MSGSEND = YES;
349 | GCC_C_LANGUAGE_STANDARD = gnu99;
350 | GCC_NO_COMMON_BLOCKS = YES;
351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
353 | GCC_WARN_UNDECLARED_SELECTOR = YES;
354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
355 | GCC_WARN_UNUSED_FUNCTION = YES;
356 | GCC_WARN_UNUSED_VARIABLE = YES;
357 | IPHONEOS_DEPLOYMENT_TARGET = 10.0;
358 | MTL_ENABLE_DEBUG_INFO = NO;
359 | SDKROOT = iphoneos;
360 | VALIDATE_PRODUCT = YES;
361 | };
362 | name = Release;
363 | };
364 | 083B49871E850FDC00A865F9 /* Debug */ = {
365 | isa = XCBuildConfiguration;
366 | baseConfigurationReference = 6717638AC9E47D0D4C3ED713 /* Pods-XZPickView.debug.xcconfig */;
367 | buildSettings = {
368 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
369 | INFOPLIST_FILE = XZPickView/Info.plist;
370 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
371 | PRODUCT_BUNDLE_IDENTIFIER = com.zhaoyongjie.XZPickView;
372 | PRODUCT_NAME = "$(TARGET_NAME)";
373 | };
374 | name = Debug;
375 | };
376 | 083B49881E850FDC00A865F9 /* Release */ = {
377 | isa = XCBuildConfiguration;
378 | baseConfigurationReference = 92E674C0C6DBD2A4A496227A /* Pods-XZPickView.release.xcconfig */;
379 | buildSettings = {
380 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
381 | INFOPLIST_FILE = XZPickView/Info.plist;
382 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
383 | PRODUCT_BUNDLE_IDENTIFIER = com.zhaoyongjie.XZPickView;
384 | PRODUCT_NAME = "$(TARGET_NAME)";
385 | };
386 | name = Release;
387 | };
388 | /* End XCBuildConfiguration section */
389 |
390 | /* Begin XCConfigurationList section */
391 | 083B496A1E850FDC00A865F9 /* Build configuration list for PBXProject "XZPickView" */ = {
392 | isa = XCConfigurationList;
393 | buildConfigurations = (
394 | 083B49841E850FDC00A865F9 /* Debug */,
395 | 083B49851E850FDC00A865F9 /* Release */,
396 | );
397 | defaultConfigurationIsVisible = 0;
398 | defaultConfigurationName = Release;
399 | };
400 | 083B49861E850FDC00A865F9 /* Build configuration list for PBXNativeTarget "XZPickView" */ = {
401 | isa = XCConfigurationList;
402 | buildConfigurations = (
403 | 083B49871E850FDC00A865F9 /* Debug */,
404 | 083B49881E850FDC00A865F9 /* Release */,
405 | );
406 | defaultConfigurationIsVisible = 0;
407 | defaultConfigurationName = Release;
408 | };
409 | /* End XCConfigurationList section */
410 | };
411 | rootObject = 083B49671E850FDC00A865F9 /* Project object */;
412 | }
413 |
--------------------------------------------------------------------------------