├── .DS_Store ├── .gitignore ├── LICENSE ├── README.md ├── YLAwesomePicker ├── .DS_Store ├── YLAwesomePicker.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── YLAwesomePicker │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ ├── YLAwesomeData.h │ ├── YLAwesomeData.m │ ├── YLAwesomeDataDelegate.h │ ├── YLAwesomeSheetController.h │ ├── YLAwesomeSheetController.m │ ├── YLDataConfiguration.h │ ├── YLDataConfiguration.m │ ├── YLTestData.h │ ├── YLTestData.m │ ├── area.json │ ├── city.json │ ├── main.m │ └── province.json ├── YLAwesomePickerTests │ ├── Info.plist │ └── YLAwesomePickerTests.m └── YLAwesomePickerUITests │ ├── Info.plist │ └── YLAwesomePickerUITests.m └── picker.gif /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApesTalk/YLAwesomePicker/d1bd07140a34659c80c9889940303ea5a34a6f69/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Mr Lu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YLAwesomePicker 2 | 3 | 最少只需三行代码的一个自定义数据拾取器,可以记录并展示上次选中的数据。 4 | 5 | A custom data picker that requires only three lines of code to record and display the last selected data. 6 | 7 | ## 介绍 8 | 9 | 在我们的项目开发过程中难免会遇到要使用UIPickerView实现拾取性别、年龄、工作经验、学历、时间、爱好、省市区地址等等数据,有时候甚至要结合 10 | UIActionSheet(or UIAlertController)使用。而且,有时候项目中可能会有很多页面需要这种功能。这种情况下,我们以前的做法是在每个需要的页面: 11 | 12 | - 创建UIPickerView和UIActionSheet(or UIAlertController)并设置代理; 13 | - 实现一系列的代理方法,在代理方法中实现一切必须的数据逻辑; 14 | - 记录UIPickerView选中的数据,在确认选择之后处理其选择的数据并展示。 15 | 16 | 这么做太糟糕了,耗时而且麻烦。于是,YLAwesomePicker产生了,YLAwesomePicker实现了我们常常需要的性别、年龄、工作经验、学历、开始时间、截止时间 17 | 和省市区地址选择的功能,如果你的项目中刚好需要这样的数据,那恭喜你,你可以省下很多处理逻辑的时间了。如果你的项目中需要其他数据,你可以模仿demo中 18 | 的“自定义其他类型”的实现方式,简单配置一下数据就好了。 19 | 20 | 21 | ## 如何使用 22 | 23 | 1.如果你需要的是性别、年龄、工作经验、学历、开始时间、截止时间和省市区地址数据,那么你可以使用已有的枚举类型: 24 | 25 | ``` 26 | YLDataConfiguration *config = [[YLDataConfiguration alloc]initWithType:YLDataConfigTypeGender selectedData:selectedData]; 27 | YLAwesomeSheetController *sheet = [[YLAwesomeSheetController alloc]initWithTitle:testData.title 28 | config:config 29 | callBack:^(NSArray *selectedData) { 30 | testData.data = selectedData; 31 | [tableView reloadData]; 32 | }]; 33 | [sheet showInController:self]; 34 | ``` 35 | 36 | 2.如果你需要自定义类型的数据,你只需要像这样配置一个YLDataConfiguration对象,然后传入即可: 37 | 38 | ``` 39 | NSDictionary *data = @{@0:@[[[YLAwesomeData alloc]initWithId:0 name:@"红色"], 40 | [[YLAwesomeData alloc]initWithId:1 name:@"橙色"], 41 | [[YLAwesomeData alloc]initWithId:2 name:@"黄色"], 42 | [[YLAwesomeData alloc]initWithId:3 name:@"绿色"], 43 | [[YLAwesomeData alloc]initWithId:4 name:@"青色"], 44 | [[YLAwesomeData alloc]initWithId:5 name:@"蓝色"], 45 | [[YLAwesomeData alloc]initWithId:6 name:@"紫色"]], 46 | @1:@[[[YLAwesomeData alloc]initWithId:0 name:@"S码"], 47 | [[YLAwesomeData alloc]initWithId:2 name:@"M码"], 48 | [[YLAwesomeData alloc]initWithId:3 name:@"L码"], 49 | [[YLAwesomeData alloc]initWithId:4 name:@"XL码"], 50 | [[YLAwesomeData alloc]initWithId:5 name:@"XXL码"], 51 | [[YLAwesomeData alloc]initWithId:6 name:@"XXXL码"]] 52 | }; 53 | 54 | YLDataConfiguration *config = [[YLDataConfiguration alloc]initWithData:data selectedData:selectedData]; 55 | YLAwesomeSheetController *sheet = [[YLAwesomeSheetController alloc]initWithTitle:testData.title 56 | config:config 57 | callBack:^(NSArray *selectedData) { 58 | testData.data = selectedData; 59 | [tableView reloadData]; 60 | }]; 61 | [sheet showInController:self]; 62 | ``` 63 | 64 | 3.如果你需要选择日期(1.1.0新增): 65 | 66 | ``` 67 | YLAwesomeSheetController *sheet = [[YLAwesomeSheetController alloc]initDatePickerWithTitle:testData.title 68 | callBack:^(NSDate *date) { 69 | NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; 70 | [formatter setDateFormat:@"yyyy年MM月dd日"]; 71 | testData.data = @[[formatter stringFromDate:date]]; 72 | [tableView reloadData]; 73 | }]; 74 | //you can set the datepicker property here 75 | sheet.datePicker.datePickerMode = UIDatePickerModeDateAndTime; 76 | sheet.datePicker.date = [NSDate date]; 77 | [sheet showInController:self]; 78 | ``` 79 | 80 | 对,数据选择就应该这么简单! 81 | 82 | 83 | ## 效果图 84 | 85 | ![](https://github.com/lqcjdx/YLAwesomePicker/blob/master/picker.gif) 86 | 87 | -------------------------------------------------------------------------------- /YLAwesomePicker/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApesTalk/YLAwesomePicker/d1bd07140a34659c80c9889940303ea5a34a6f69/YLAwesomePicker/.DS_Store -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 455048011EF374A700CC0499 /* YLTestData.m in Sources */ = {isa = PBXBuildFile; fileRef = 455048001EF374A700CC0499 /* YLTestData.m */; }; 11 | 456325041EF26757000AD9AF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 456325031EF26757000AD9AF /* main.m */; }; 12 | 456325071EF26757000AD9AF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 456325061EF26757000AD9AF /* AppDelegate.m */; }; 13 | 4563250A1EF26758000AD9AF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 456325091EF26758000AD9AF /* ViewController.m */; }; 14 | 4563250D1EF26758000AD9AF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4563250B1EF26758000AD9AF /* Main.storyboard */; }; 15 | 4563250F1EF26758000AD9AF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4563250E1EF26758000AD9AF /* Assets.xcassets */; }; 16 | 456325121EF26758000AD9AF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 456325101EF26758000AD9AF /* LaunchScreen.storyboard */; }; 17 | 4563251D1EF26759000AD9AF /* YLAwesomePickerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4563251C1EF26759000AD9AF /* YLAwesomePickerTests.m */; }; 18 | 456325281EF26759000AD9AF /* YLAwesomePickerUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 456325271EF26759000AD9AF /* YLAwesomePickerUITests.m */; }; 19 | 456325381EF2686A000AD9AF /* YLAwesomeSheetController.m in Sources */ = {isa = PBXBuildFile; fileRef = 456325371EF2686A000AD9AF /* YLAwesomeSheetController.m */; }; 20 | 4563253B1EF26B39000AD9AF /* YLDataConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 4563253A1EF26B39000AD9AF /* YLDataConfiguration.m */; }; 21 | 4563253E1EF26B6C000AD9AF /* YLAwesomeData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4563253D1EF26B6C000AD9AF /* YLAwesomeData.m */; }; 22 | 45CCB06D1EFB788600A76776 /* area.json in Resources */ = {isa = PBXBuildFile; fileRef = 45CCB06A1EFB788600A76776 /* area.json */; }; 23 | 45CCB06E1EFB788600A76776 /* city.json in Resources */ = {isa = PBXBuildFile; fileRef = 45CCB06B1EFB788600A76776 /* city.json */; }; 24 | 45CCB06F1EFB788600A76776 /* province.json in Resources */ = {isa = PBXBuildFile; fileRef = 45CCB06C1EFB788600A76776 /* province.json */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 456325191EF26758000AD9AF /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 456324F71EF26757000AD9AF /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 456324FE1EF26757000AD9AF; 33 | remoteInfo = YLAwesomePicker; 34 | }; 35 | 456325241EF26759000AD9AF /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 456324F71EF26757000AD9AF /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 456324FE1EF26757000AD9AF; 40 | remoteInfo = YLAwesomePicker; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 455047FF1EF374A700CC0499 /* YLTestData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YLTestData.h; sourceTree = ""; }; 46 | 455048001EF374A700CC0499 /* YLTestData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YLTestData.m; sourceTree = ""; }; 47 | 456324FF1EF26757000AD9AF /* YLAwesomePicker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YLAwesomePicker.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 456325031EF26757000AD9AF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 456325051EF26757000AD9AF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 50 | 456325061EF26757000AD9AF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 51 | 456325081EF26758000AD9AF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 52 | 456325091EF26758000AD9AF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 53 | 4563250C1EF26758000AD9AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54 | 4563250E1EF26758000AD9AF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 55 | 456325111EF26758000AD9AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 56 | 456325131EF26758000AD9AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 456325181EF26758000AD9AF /* YLAwesomePickerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YLAwesomePickerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | 4563251C1EF26759000AD9AF /* YLAwesomePickerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YLAwesomePickerTests.m; sourceTree = ""; }; 59 | 4563251E1EF26759000AD9AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 456325231EF26759000AD9AF /* YLAwesomePickerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YLAwesomePickerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 456325271EF26759000AD9AF /* YLAwesomePickerUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YLAwesomePickerUITests.m; sourceTree = ""; }; 62 | 456325291EF26759000AD9AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 63 | 456325361EF2686A000AD9AF /* YLAwesomeSheetController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YLAwesomeSheetController.h; sourceTree = ""; }; 64 | 456325371EF2686A000AD9AF /* YLAwesomeSheetController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YLAwesomeSheetController.m; sourceTree = ""; }; 65 | 456325391EF26B39000AD9AF /* YLDataConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YLDataConfiguration.h; sourceTree = ""; }; 66 | 4563253A1EF26B39000AD9AF /* YLDataConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YLDataConfiguration.m; sourceTree = ""; }; 67 | 4563253C1EF26B6C000AD9AF /* YLAwesomeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YLAwesomeData.h; sourceTree = ""; }; 68 | 4563253D1EF26B6C000AD9AF /* YLAwesomeData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YLAwesomeData.m; sourceTree = ""; }; 69 | 4563253F1EF2773F000AD9AF /* YLAwesomeDataDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YLAwesomeDataDelegate.h; sourceTree = ""; }; 70 | 45CCB06A1EFB788600A76776 /* area.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = area.json; sourceTree = ""; }; 71 | 45CCB06B1EFB788600A76776 /* city.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = city.json; sourceTree = ""; }; 72 | 45CCB06C1EFB788600A76776 /* province.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = province.json; sourceTree = ""; }; 73 | /* End PBXFileReference section */ 74 | 75 | /* Begin PBXFrameworksBuildPhase section */ 76 | 456324FC1EF26757000AD9AF /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | 456325151EF26758000AD9AF /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | 456325201EF26759000AD9AF /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | /* End PBXFrameworksBuildPhase section */ 98 | 99 | /* Begin PBXGroup section */ 100 | 456324F61EF26757000AD9AF = { 101 | isa = PBXGroup; 102 | children = ( 103 | 456325011EF26757000AD9AF /* YLAwesomePicker */, 104 | 4563251B1EF26758000AD9AF /* YLAwesomePickerTests */, 105 | 456325261EF26759000AD9AF /* YLAwesomePickerUITests */, 106 | 456325001EF26757000AD9AF /* Products */, 107 | ); 108 | sourceTree = ""; 109 | }; 110 | 456325001EF26757000AD9AF /* Products */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 456324FF1EF26757000AD9AF /* YLAwesomePicker.app */, 114 | 456325181EF26758000AD9AF /* YLAwesomePickerTests.xctest */, 115 | 456325231EF26759000AD9AF /* YLAwesomePickerUITests.xctest */, 116 | ); 117 | name = Products; 118 | sourceTree = ""; 119 | }; 120 | 456325011EF26757000AD9AF /* YLAwesomePicker */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 45CCB0691EFB787900A76776 /* Data */, 124 | 456325351EF2685A000AD9AF /* Class */, 125 | 456325051EF26757000AD9AF /* AppDelegate.h */, 126 | 456325061EF26757000AD9AF /* AppDelegate.m */, 127 | 456325081EF26758000AD9AF /* ViewController.h */, 128 | 456325091EF26758000AD9AF /* ViewController.m */, 129 | 4563250B1EF26758000AD9AF /* Main.storyboard */, 130 | 4563250E1EF26758000AD9AF /* Assets.xcassets */, 131 | 456325101EF26758000AD9AF /* LaunchScreen.storyboard */, 132 | 456325131EF26758000AD9AF /* Info.plist */, 133 | 456325021EF26757000AD9AF /* Supporting Files */, 134 | 455047FF1EF374A700CC0499 /* YLTestData.h */, 135 | 455048001EF374A700CC0499 /* YLTestData.m */, 136 | ); 137 | path = YLAwesomePicker; 138 | sourceTree = ""; 139 | }; 140 | 456325021EF26757000AD9AF /* Supporting Files */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 456325031EF26757000AD9AF /* main.m */, 144 | ); 145 | name = "Supporting Files"; 146 | sourceTree = ""; 147 | }; 148 | 4563251B1EF26758000AD9AF /* YLAwesomePickerTests */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 4563251C1EF26759000AD9AF /* YLAwesomePickerTests.m */, 152 | 4563251E1EF26759000AD9AF /* Info.plist */, 153 | ); 154 | path = YLAwesomePickerTests; 155 | sourceTree = ""; 156 | }; 157 | 456325261EF26759000AD9AF /* YLAwesomePickerUITests */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 456325271EF26759000AD9AF /* YLAwesomePickerUITests.m */, 161 | 456325291EF26759000AD9AF /* Info.plist */, 162 | ); 163 | path = YLAwesomePickerUITests; 164 | sourceTree = ""; 165 | }; 166 | 456325351EF2685A000AD9AF /* Class */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 4563253F1EF2773F000AD9AF /* YLAwesomeDataDelegate.h */, 170 | 4563253C1EF26B6C000AD9AF /* YLAwesomeData.h */, 171 | 4563253D1EF26B6C000AD9AF /* YLAwesomeData.m */, 172 | 456325391EF26B39000AD9AF /* YLDataConfiguration.h */, 173 | 4563253A1EF26B39000AD9AF /* YLDataConfiguration.m */, 174 | 456325361EF2686A000AD9AF /* YLAwesomeSheetController.h */, 175 | 456325371EF2686A000AD9AF /* YLAwesomeSheetController.m */, 176 | ); 177 | name = Class; 178 | sourceTree = ""; 179 | }; 180 | 45CCB0691EFB787900A76776 /* Data */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 45CCB06A1EFB788600A76776 /* area.json */, 184 | 45CCB06B1EFB788600A76776 /* city.json */, 185 | 45CCB06C1EFB788600A76776 /* province.json */, 186 | ); 187 | name = Data; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXGroup section */ 191 | 192 | /* Begin PBXNativeTarget section */ 193 | 456324FE1EF26757000AD9AF /* YLAwesomePicker */ = { 194 | isa = PBXNativeTarget; 195 | buildConfigurationList = 4563252C1EF26759000AD9AF /* Build configuration list for PBXNativeTarget "YLAwesomePicker" */; 196 | buildPhases = ( 197 | 456324FB1EF26757000AD9AF /* Sources */, 198 | 456324FC1EF26757000AD9AF /* Frameworks */, 199 | 456324FD1EF26757000AD9AF /* Resources */, 200 | ); 201 | buildRules = ( 202 | ); 203 | dependencies = ( 204 | ); 205 | name = YLAwesomePicker; 206 | productName = YLAwesomePicker; 207 | productReference = 456324FF1EF26757000AD9AF /* YLAwesomePicker.app */; 208 | productType = "com.apple.product-type.application"; 209 | }; 210 | 456325171EF26758000AD9AF /* YLAwesomePickerTests */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = 4563252F1EF26759000AD9AF /* Build configuration list for PBXNativeTarget "YLAwesomePickerTests" */; 213 | buildPhases = ( 214 | 456325141EF26758000AD9AF /* Sources */, 215 | 456325151EF26758000AD9AF /* Frameworks */, 216 | 456325161EF26758000AD9AF /* Resources */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | 4563251A1EF26758000AD9AF /* PBXTargetDependency */, 222 | ); 223 | name = YLAwesomePickerTests; 224 | productName = YLAwesomePickerTests; 225 | productReference = 456325181EF26758000AD9AF /* YLAwesomePickerTests.xctest */; 226 | productType = "com.apple.product-type.bundle.unit-test"; 227 | }; 228 | 456325221EF26759000AD9AF /* YLAwesomePickerUITests */ = { 229 | isa = PBXNativeTarget; 230 | buildConfigurationList = 456325321EF26759000AD9AF /* Build configuration list for PBXNativeTarget "YLAwesomePickerUITests" */; 231 | buildPhases = ( 232 | 4563251F1EF26759000AD9AF /* Sources */, 233 | 456325201EF26759000AD9AF /* Frameworks */, 234 | 456325211EF26759000AD9AF /* Resources */, 235 | ); 236 | buildRules = ( 237 | ); 238 | dependencies = ( 239 | 456325251EF26759000AD9AF /* PBXTargetDependency */, 240 | ); 241 | name = YLAwesomePickerUITests; 242 | productName = YLAwesomePickerUITests; 243 | productReference = 456325231EF26759000AD9AF /* YLAwesomePickerUITests.xctest */; 244 | productType = "com.apple.product-type.bundle.ui-testing"; 245 | }; 246 | /* End PBXNativeTarget section */ 247 | 248 | /* Begin PBXProject section */ 249 | 456324F71EF26757000AD9AF /* Project object */ = { 250 | isa = PBXProject; 251 | attributes = { 252 | LastUpgradeCheck = 0820; 253 | ORGANIZATIONNAME = "TK-001289"; 254 | TargetAttributes = { 255 | 456324FE1EF26757000AD9AF = { 256 | CreatedOnToolsVersion = 8.2.1; 257 | DevelopmentTeam = M3Y7JKHK66; 258 | ProvisioningStyle = Automatic; 259 | }; 260 | 456325171EF26758000AD9AF = { 261 | CreatedOnToolsVersion = 8.2.1; 262 | DevelopmentTeam = M3Y7JKHK66; 263 | ProvisioningStyle = Automatic; 264 | TestTargetID = 456324FE1EF26757000AD9AF; 265 | }; 266 | 456325221EF26759000AD9AF = { 267 | CreatedOnToolsVersion = 8.2.1; 268 | DevelopmentTeam = M3Y7JKHK66; 269 | ProvisioningStyle = Automatic; 270 | TestTargetID = 456324FE1EF26757000AD9AF; 271 | }; 272 | }; 273 | }; 274 | buildConfigurationList = 456324FA1EF26757000AD9AF /* Build configuration list for PBXProject "YLAwesomePicker" */; 275 | compatibilityVersion = "Xcode 3.2"; 276 | developmentRegion = English; 277 | hasScannedForEncodings = 0; 278 | knownRegions = ( 279 | en, 280 | Base, 281 | ); 282 | mainGroup = 456324F61EF26757000AD9AF; 283 | productRefGroup = 456325001EF26757000AD9AF /* Products */; 284 | projectDirPath = ""; 285 | projectRoot = ""; 286 | targets = ( 287 | 456324FE1EF26757000AD9AF /* YLAwesomePicker */, 288 | 456325171EF26758000AD9AF /* YLAwesomePickerTests */, 289 | 456325221EF26759000AD9AF /* YLAwesomePickerUITests */, 290 | ); 291 | }; 292 | /* End PBXProject section */ 293 | 294 | /* Begin PBXResourcesBuildPhase section */ 295 | 456324FD1EF26757000AD9AF /* Resources */ = { 296 | isa = PBXResourcesBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | 456325121EF26758000AD9AF /* LaunchScreen.storyboard in Resources */, 300 | 45CCB06E1EFB788600A76776 /* city.json in Resources */, 301 | 4563250F1EF26758000AD9AF /* Assets.xcassets in Resources */, 302 | 45CCB06D1EFB788600A76776 /* area.json in Resources */, 303 | 4563250D1EF26758000AD9AF /* Main.storyboard in Resources */, 304 | 45CCB06F1EFB788600A76776 /* province.json in Resources */, 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | }; 308 | 456325161EF26758000AD9AF /* Resources */ = { 309 | isa = PBXResourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | 456325211EF26759000AD9AF /* Resources */ = { 316 | isa = PBXResourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | ); 320 | runOnlyForDeploymentPostprocessing = 0; 321 | }; 322 | /* End PBXResourcesBuildPhase section */ 323 | 324 | /* Begin PBXSourcesBuildPhase section */ 325 | 456324FB1EF26757000AD9AF /* Sources */ = { 326 | isa = PBXSourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | 4563250A1EF26758000AD9AF /* ViewController.m in Sources */, 330 | 456325071EF26757000AD9AF /* AppDelegate.m in Sources */, 331 | 4563253E1EF26B6C000AD9AF /* YLAwesomeData.m in Sources */, 332 | 455048011EF374A700CC0499 /* YLTestData.m in Sources */, 333 | 456325041EF26757000AD9AF /* main.m in Sources */, 334 | 456325381EF2686A000AD9AF /* YLAwesomeSheetController.m in Sources */, 335 | 4563253B1EF26B39000AD9AF /* YLDataConfiguration.m in Sources */, 336 | ); 337 | runOnlyForDeploymentPostprocessing = 0; 338 | }; 339 | 456325141EF26758000AD9AF /* Sources */ = { 340 | isa = PBXSourcesBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | 4563251D1EF26759000AD9AF /* YLAwesomePickerTests.m in Sources */, 344 | ); 345 | runOnlyForDeploymentPostprocessing = 0; 346 | }; 347 | 4563251F1EF26759000AD9AF /* Sources */ = { 348 | isa = PBXSourcesBuildPhase; 349 | buildActionMask = 2147483647; 350 | files = ( 351 | 456325281EF26759000AD9AF /* YLAwesomePickerUITests.m in Sources */, 352 | ); 353 | runOnlyForDeploymentPostprocessing = 0; 354 | }; 355 | /* End PBXSourcesBuildPhase section */ 356 | 357 | /* Begin PBXTargetDependency section */ 358 | 4563251A1EF26758000AD9AF /* PBXTargetDependency */ = { 359 | isa = PBXTargetDependency; 360 | target = 456324FE1EF26757000AD9AF /* YLAwesomePicker */; 361 | targetProxy = 456325191EF26758000AD9AF /* PBXContainerItemProxy */; 362 | }; 363 | 456325251EF26759000AD9AF /* PBXTargetDependency */ = { 364 | isa = PBXTargetDependency; 365 | target = 456324FE1EF26757000AD9AF /* YLAwesomePicker */; 366 | targetProxy = 456325241EF26759000AD9AF /* PBXContainerItemProxy */; 367 | }; 368 | /* End PBXTargetDependency section */ 369 | 370 | /* Begin PBXVariantGroup section */ 371 | 4563250B1EF26758000AD9AF /* Main.storyboard */ = { 372 | isa = PBXVariantGroup; 373 | children = ( 374 | 4563250C1EF26758000AD9AF /* Base */, 375 | ); 376 | name = Main.storyboard; 377 | sourceTree = ""; 378 | }; 379 | 456325101EF26758000AD9AF /* LaunchScreen.storyboard */ = { 380 | isa = PBXVariantGroup; 381 | children = ( 382 | 456325111EF26758000AD9AF /* Base */, 383 | ); 384 | name = LaunchScreen.storyboard; 385 | sourceTree = ""; 386 | }; 387 | /* End PBXVariantGroup section */ 388 | 389 | /* Begin XCBuildConfiguration section */ 390 | 4563252A1EF26759000AD9AF /* Debug */ = { 391 | isa = XCBuildConfiguration; 392 | buildSettings = { 393 | ALWAYS_SEARCH_USER_PATHS = NO; 394 | CLANG_ANALYZER_NONNULL = YES; 395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 396 | CLANG_CXX_LIBRARY = "libc++"; 397 | CLANG_ENABLE_MODULES = YES; 398 | CLANG_ENABLE_OBJC_ARC = YES; 399 | CLANG_WARN_BOOL_CONVERSION = YES; 400 | CLANG_WARN_CONSTANT_CONVERSION = YES; 401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 402 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 409 | CLANG_WARN_UNREACHABLE_CODE = YES; 410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 411 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 412 | COPY_PHASE_STRIP = NO; 413 | DEBUG_INFORMATION_FORMAT = dwarf; 414 | ENABLE_STRICT_OBJC_MSGSEND = YES; 415 | ENABLE_TESTABILITY = YES; 416 | GCC_C_LANGUAGE_STANDARD = gnu99; 417 | GCC_DYNAMIC_NO_PIC = NO; 418 | GCC_NO_COMMON_BLOCKS = YES; 419 | GCC_OPTIMIZATION_LEVEL = 0; 420 | GCC_PREPROCESSOR_DEFINITIONS = ( 421 | "DEBUG=1", 422 | "$(inherited)", 423 | ); 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 431 | MTL_ENABLE_DEBUG_INFO = YES; 432 | ONLY_ACTIVE_ARCH = YES; 433 | SDKROOT = iphoneos; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | }; 436 | name = Debug; 437 | }; 438 | 4563252B1EF26759000AD9AF /* Release */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | ALWAYS_SEARCH_USER_PATHS = NO; 442 | CLANG_ANALYZER_NONNULL = YES; 443 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 444 | CLANG_CXX_LIBRARY = "libc++"; 445 | CLANG_ENABLE_MODULES = YES; 446 | CLANG_ENABLE_OBJC_ARC = YES; 447 | CLANG_WARN_BOOL_CONVERSION = YES; 448 | CLANG_WARN_CONSTANT_CONVERSION = YES; 449 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 450 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 451 | CLANG_WARN_EMPTY_BODY = YES; 452 | CLANG_WARN_ENUM_CONVERSION = YES; 453 | CLANG_WARN_INFINITE_RECURSION = YES; 454 | CLANG_WARN_INT_CONVERSION = YES; 455 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 456 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 457 | CLANG_WARN_UNREACHABLE_CODE = YES; 458 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 459 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 460 | COPY_PHASE_STRIP = NO; 461 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 462 | ENABLE_NS_ASSERTIONS = NO; 463 | ENABLE_STRICT_OBJC_MSGSEND = YES; 464 | GCC_C_LANGUAGE_STANDARD = gnu99; 465 | GCC_NO_COMMON_BLOCKS = YES; 466 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 467 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 468 | GCC_WARN_UNDECLARED_SELECTOR = YES; 469 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 470 | GCC_WARN_UNUSED_FUNCTION = YES; 471 | GCC_WARN_UNUSED_VARIABLE = YES; 472 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 473 | MTL_ENABLE_DEBUG_INFO = NO; 474 | SDKROOT = iphoneos; 475 | TARGETED_DEVICE_FAMILY = "1,2"; 476 | VALIDATE_PRODUCT = YES; 477 | }; 478 | name = Release; 479 | }; 480 | 4563252D1EF26759000AD9AF /* Debug */ = { 481 | isa = XCBuildConfiguration; 482 | buildSettings = { 483 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 484 | DEVELOPMENT_TEAM = M3Y7JKHK66; 485 | INFOPLIST_FILE = YLAwesomePicker/Info.plist; 486 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 487 | PRODUCT_BUNDLE_IDENTIFIER = com.lambert.YLAwesomePicker; 488 | PRODUCT_NAME = "$(TARGET_NAME)"; 489 | }; 490 | name = Debug; 491 | }; 492 | 4563252E1EF26759000AD9AF /* Release */ = { 493 | isa = XCBuildConfiguration; 494 | buildSettings = { 495 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 496 | DEVELOPMENT_TEAM = M3Y7JKHK66; 497 | INFOPLIST_FILE = YLAwesomePicker/Info.plist; 498 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 499 | PRODUCT_BUNDLE_IDENTIFIER = com.lambert.YLAwesomePicker; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | }; 502 | name = Release; 503 | }; 504 | 456325301EF26759000AD9AF /* Debug */ = { 505 | isa = XCBuildConfiguration; 506 | buildSettings = { 507 | BUNDLE_LOADER = "$(TEST_HOST)"; 508 | DEVELOPMENT_TEAM = M3Y7JKHK66; 509 | INFOPLIST_FILE = YLAwesomePickerTests/Info.plist; 510 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 511 | PRODUCT_BUNDLE_IDENTIFIER = com.dailekeji.YLAwesomePickerTests; 512 | PRODUCT_NAME = "$(TARGET_NAME)"; 513 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YLAwesomePicker.app/YLAwesomePicker"; 514 | }; 515 | name = Debug; 516 | }; 517 | 456325311EF26759000AD9AF /* Release */ = { 518 | isa = XCBuildConfiguration; 519 | buildSettings = { 520 | BUNDLE_LOADER = "$(TEST_HOST)"; 521 | DEVELOPMENT_TEAM = M3Y7JKHK66; 522 | INFOPLIST_FILE = YLAwesomePickerTests/Info.plist; 523 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 524 | PRODUCT_BUNDLE_IDENTIFIER = com.dailekeji.YLAwesomePickerTests; 525 | PRODUCT_NAME = "$(TARGET_NAME)"; 526 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YLAwesomePicker.app/YLAwesomePicker"; 527 | }; 528 | name = Release; 529 | }; 530 | 456325331EF26759000AD9AF /* Debug */ = { 531 | isa = XCBuildConfiguration; 532 | buildSettings = { 533 | DEVELOPMENT_TEAM = M3Y7JKHK66; 534 | INFOPLIST_FILE = YLAwesomePickerUITests/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 536 | PRODUCT_BUNDLE_IDENTIFIER = com.dailekeji.YLAwesomePickerUITests; 537 | PRODUCT_NAME = "$(TARGET_NAME)"; 538 | TEST_TARGET_NAME = YLAwesomePicker; 539 | }; 540 | name = Debug; 541 | }; 542 | 456325341EF26759000AD9AF /* Release */ = { 543 | isa = XCBuildConfiguration; 544 | buildSettings = { 545 | DEVELOPMENT_TEAM = M3Y7JKHK66; 546 | INFOPLIST_FILE = YLAwesomePickerUITests/Info.plist; 547 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 548 | PRODUCT_BUNDLE_IDENTIFIER = com.dailekeji.YLAwesomePickerUITests; 549 | PRODUCT_NAME = "$(TARGET_NAME)"; 550 | TEST_TARGET_NAME = YLAwesomePicker; 551 | }; 552 | name = Release; 553 | }; 554 | /* End XCBuildConfiguration section */ 555 | 556 | /* Begin XCConfigurationList section */ 557 | 456324FA1EF26757000AD9AF /* Build configuration list for PBXProject "YLAwesomePicker" */ = { 558 | isa = XCConfigurationList; 559 | buildConfigurations = ( 560 | 4563252A1EF26759000AD9AF /* Debug */, 561 | 4563252B1EF26759000AD9AF /* Release */, 562 | ); 563 | defaultConfigurationIsVisible = 0; 564 | defaultConfigurationName = Release; 565 | }; 566 | 4563252C1EF26759000AD9AF /* Build configuration list for PBXNativeTarget "YLAwesomePicker" */ = { 567 | isa = XCConfigurationList; 568 | buildConfigurations = ( 569 | 4563252D1EF26759000AD9AF /* Debug */, 570 | 4563252E1EF26759000AD9AF /* Release */, 571 | ); 572 | defaultConfigurationIsVisible = 0; 573 | defaultConfigurationName = Release; 574 | }; 575 | 4563252F1EF26759000AD9AF /* Build configuration list for PBXNativeTarget "YLAwesomePickerTests" */ = { 576 | isa = XCConfigurationList; 577 | buildConfigurations = ( 578 | 456325301EF26759000AD9AF /* Debug */, 579 | 456325311EF26759000AD9AF /* Release */, 580 | ); 581 | defaultConfigurationIsVisible = 0; 582 | defaultConfigurationName = Release; 583 | }; 584 | 456325321EF26759000AD9AF /* Build configuration list for PBXNativeTarget "YLAwesomePickerUITests" */ = { 585 | isa = XCConfigurationList; 586 | buildConfigurations = ( 587 | 456325331EF26759000AD9AF /* Debug */, 588 | 456325341EF26759000AD9AF /* Release */, 589 | ); 590 | defaultConfigurationIsVisible = 0; 591 | defaultConfigurationName = Release; 592 | }; 593 | /* End XCConfigurationList section */ 594 | }; 595 | rootObject = 456324F71EF26757000AD9AF /* Project object */; 596 | } 597 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. 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 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. 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 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/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 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/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 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/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.1.0 19 | CFBundleVersion 20 | 1000 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 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "YLAwesomeData.h" 11 | #import "YLDataConfiguration.h" 12 | #import "YLAwesomeSheetController.h" 13 | #import "YLTestData.h" 14 | 15 | static NSString *cellIdentifier = @"cellIdenfier"; 16 | 17 | @interface ViewController () 18 | { 19 | NSArray *testDataList; 20 | } 21 | @property(nonatomic,strong)UITableView *table; 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view, typically from a nib. 30 | testDataList = @[[[YLTestData alloc]initWithTitle:@"选择性别"], 31 | [[YLTestData alloc]initWithTitle:@"请选择学历"], 32 | [[YLTestData alloc]initWithTitle:@"请选择工作年限"], 33 | [[YLTestData alloc]initWithTitle:@"请选择开始时间"], 34 | [[YLTestData alloc]initWithTitle:@"请选择结束时间"], 35 | [[YLTestData alloc]initWithTitle:@"请选择地址"], 36 | [[YLTestData alloc]initWithTitle:@"自定义其他类型"], 37 | [[YLTestData alloc]initWithTitle:@"选择日期"]]; 38 | _table = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped]; 39 | _table.delegate = self; 40 | _table.dataSource = self; 41 | [self.view addSubview:_table]; 42 | } 43 | 44 | - (void)didReceiveMemoryWarning 45 | { 46 | [super didReceiveMemoryWarning]; 47 | // Dispose of any resources that can be recreated. 48 | } 49 | 50 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 51 | { 52 | return testDataList.count; 53 | } 54 | 55 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 56 | { 57 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 58 | if(!cell){ 59 | cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; 60 | cell.textLabel.font = [UIFont systemFontOfSize:14]; 61 | cell.detailTextLabel.font = [UIFont systemFontOfSize:10]; 62 | } 63 | YLTestData *testData = testDataList[indexPath.row]; 64 | cell.textLabel.text = testData.title; 65 | NSString *detail; 66 | if(testData.data){ 67 | detail = [testData.data componentsJoinedByString:@"-"]; 68 | } 69 | cell.detailTextLabel.text = detail; 70 | return cell; 71 | } 72 | 73 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 74 | { 75 | return 45.f; 76 | } 77 | 78 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 79 | { 80 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 81 | NSInteger row = indexPath.row; 82 | YLTestData *testData = testDataList[row]; 83 | if(row < 6){ 84 | YLDataConfigType type = YLDataConfigTypeGender + row; 85 | NSArray *selectedData = testData.data; 86 | YLDataConfiguration *config = [[YLDataConfiguration alloc]initWithType:type selectedData:selectedData]; 87 | YLAwesomeSheetController *sheet = [[YLAwesomeSheetController alloc]initWithTitle:testData.title 88 | config:config 89 | callBack:^(NSArray *selectedData) { 90 | testData.data = selectedData; 91 | [tableView reloadData]; 92 | }]; 93 | [sheet showInController:self]; 94 | }else if(row == 6){ 95 | NSArray *selectedData = testData.data; 96 | NSDictionary *data = [self testDic]; 97 | YLDataConfiguration *config = [[YLDataConfiguration alloc]initWithData:data selectedData:selectedData]; 98 | YLAwesomeSheetController *sheet = [[YLAwesomeSheetController alloc]initWithTitle:testData.title 99 | config:config 100 | callBack:^(NSArray *selectedData) { 101 | testData.data = selectedData; 102 | [tableView reloadData]; 103 | }]; 104 | [sheet showInController:self]; 105 | }else{ 106 | //select date 107 | YLAwesomeSheetController *sheet = [[YLAwesomeSheetController alloc]initDatePickerWithTitle:testData.title 108 | callBack:^(NSDate *date) { 109 | NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; 110 | [formatter setDateFormat:@"yyyy年MM月dd日"]; 111 | testData.data = @[[formatter stringFromDate:date]]; 112 | [tableView reloadData]; 113 | }]; 114 | //you can set the datepicker property here 115 | sheet.datePicker.datePickerMode = UIDatePickerModeDateAndTime; 116 | sheet.datePicker.date = [NSDate date]; 117 | [sheet showInController:self]; 118 | } 119 | } 120 | 121 | - (NSDictionary *)testDic 122 | { 123 | NSDictionary *data = @{@0:@[[[YLAwesomeData alloc]initWithId:0 name:@"红色"], 124 | [[YLAwesomeData alloc]initWithId:1 name:@"橙色"], 125 | [[YLAwesomeData alloc]initWithId:2 name:@"黄色"], 126 | [[YLAwesomeData alloc]initWithId:3 name:@"绿色"], 127 | [[YLAwesomeData alloc]initWithId:4 name:@"青色"], 128 | [[YLAwesomeData alloc]initWithId:5 name:@"蓝色"], 129 | [[YLAwesomeData alloc]initWithId:6 name:@"紫色"]], 130 | @1:@[[[YLAwesomeData alloc]initWithId:0 name:@"S码"], 131 | [[YLAwesomeData alloc]initWithId:2 name:@"M码"], 132 | [[YLAwesomeData alloc]initWithId:3 name:@"L码"], 133 | [[YLAwesomeData alloc]initWithId:4 name:@"XL码"], 134 | [[YLAwesomeData alloc]initWithId:5 name:@"XXL码"], 135 | [[YLAwesomeData alloc]initWithId:6 name:@"XXXL码"]] 136 | }; 137 | return data; 138 | } 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLAwesomeData.h: -------------------------------------------------------------------------------- 1 | // 2 | // YLAwesomeData.h 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YLAwesomeData : NSObject 12 | @property(nonatomic,assign)NSInteger objId; 13 | @property(nonatomic,copy)NSString *name; 14 | 15 | - (instancetype)initWithId:(NSInteger)oId name:(NSString *)name; 16 | 17 | @end 18 | //the data object the picker can pick 19 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLAwesomeData.m: -------------------------------------------------------------------------------- 1 | // 2 | // YLAwesomeData.m 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import "YLAwesomeData.h" 10 | 11 | @implementation YLAwesomeData 12 | - (instancetype)initWithId:(NSInteger)oId name:(NSString *)name 13 | { 14 | if(self = [super init]){ 15 | self.objId = oId; 16 | self.name = name; 17 | } 18 | return self; 19 | } 20 | 21 | - (BOOL)isEqual:(id)object 22 | { 23 | if(![object isKindOfClass:[self class]]){ 24 | return NO; 25 | } 26 | YLAwesomeData *otherData = (YLAwesomeData *)object; 27 | return self.objId == otherData.objId && [self.name isEqualToString:otherData.name]; 28 | } 29 | 30 | - (NSString *)description 31 | { 32 | return self.name; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLAwesomeDataDelegate.h: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // YLAwesomeDataDelegate.h 4 | // YLAwesomePicker 5 | // 6 | // Created by TK-001289 on 2017/6/15. 7 | // Copyright © 2017年 TK-001289. All rights reserved. 8 | // 9 | 10 | #ifndef YLAwesomeDataDelegate_h 11 | #define YLAwesomeDataDelegate_h 12 | 13 | @class YLAwesomeData; 14 | 15 | @protocol YLAwesomeDataDelegate 16 | @property(nonatomic,copy,readonly)NSDictionary *dataSource;///< contains data like: @{@0:@[data0,data1...],@1:@[data0,data1,...]} 17 | 18 | /** 19 | the total number of components 20 | */ 21 | - (NSInteger)numberOfComponents; 22 | 23 | /** 24 | the default selected data in the component, default nil. Used when need remember the last select state 25 | 26 | @param component the target component 27 | @return selected data 28 | */ 29 | - (YLAwesomeData *)defaultSelectDataInComponent:(NSInteger)component; 30 | 31 | /** 32 | the default data in the component, when first appear show the default data 33 | 34 | @param component the target component 35 | @return data array 36 | */ 37 | - (NSArray *)dataInComponent:(NSInteger)component; 38 | 39 | /** 40 | when selected the row in the component, get data again with this method if need refresh 41 | 42 | @param nComponent the component which need refresh data 43 | @param sComponent the current selected component 44 | @param row the current selected row 45 | @return data array 46 | */ 47 | - (NSArray *)dataInComponent:(NSInteger)nComponent selectedComponent:(NSInteger)sComponent row:(NSInteger)row; 48 | 49 | @end 50 | 51 | #endif /* YLAwesomeDataDelegate_h */ 52 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLAwesomeSheetController.h: -------------------------------------------------------------------------------- 1 | // 2 | // YLResumeActionSheetController.h 3 | // YLLanJiQuan 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 YL. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YLAwesomeDataDelegate.h" 11 | @class YLAwesomeData; 12 | 13 | typedef void(^YLAwesomeSheetSelectCallBack)(NSArray *selectedData); 14 | typedef void(^YLAwesomeSelectDateCallBack)(NSDate *date); 15 | 16 | @interface YLAwesomeSheetController : UIViewController 17 | @property(nonatomic,strong)id dataConfiguration; 18 | @property(nonatomic,copy)YLAwesomeSheetSelectCallBack callBack; 19 | @property(nonatomic,copy)YLAwesomeSelectDateCallBack dateCallBack; 20 | @property(nonatomic,strong)UIDatePicker *datePicker; 21 | 22 | 23 | /** 24 | 指定标题、配置和回调创建对象 25 | 26 | @param title 标题 27 | @param config 配置对象 28 | @param callBack 回调 29 | @return 对象 30 | */ 31 | - (instancetype)initWithTitle:(NSString *)title config:(id)config callBack:(YLAwesomeSheetSelectCallBack)callBack; 32 | 33 | 34 | /** 35 | 日期选择 36 | 37 | @param title 标题 38 | @param callBack 毁掉 39 | @return 对象 40 | */ 41 | - (instancetype)initDatePickerWithTitle:(NSString *)title callBack:(YLAwesomeSelectDateCallBack)callBack; 42 | 43 | /** 44 | will present picker from the bottom of controller.view 45 | */ 46 | - (void)showInController:(UIViewController *)controller; 47 | 48 | @end 49 | 50 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLAwesomeSheetController.m: -------------------------------------------------------------------------------- 1 | // 2 | // YLResumeActionSheetController.m 3 | // YLLanJiQuan 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 YL. All rights reserved. 7 | // 8 | 9 | #import "YLAwesomeSheetController.h" 10 | #import "YLAwesomeData.h" 11 | 12 | #define kFrameWidth [UIScreen mainScreen].bounds.size.width 13 | #define kFrameHeight [UIScreen mainScreen].bounds.size.height 14 | 15 | static CGFloat maxHeight = 261; 16 | static CGFloat headerHeight = 40; 17 | static CGFloat cellHeight = 55; 18 | 19 | @interface YLAwesomeSheetController () 20 | @property(nonatomic,copy)NSArray *currentMonths;///< 当前年份可选的最大月份 21 | @property(nonatomic,copy)NSArray *monthArray;///< 1~12月 22 | @property(nonatomic,copy)NSString *titleStr; 23 | @property(nonatomic,strong)UIView *contentView; 24 | @property(nonatomic,strong)UIButton *cancelBtn; 25 | @property(nonatomic,strong)UIButton *ensureBtn; 26 | @property(nonatomic,strong)UILabel *titleLabel; 27 | @property(nonatomic,strong)UIView *line; 28 | @property(nonatomic,strong)UIPickerView *picker; 29 | 30 | @property(nonatomic,assign)NSInteger componentCount;///< the total component count 31 | @property(nonatomic,strong)NSMutableArray *tmpSelectedData;///< contains the temp selectd data in each component 32 | @end 33 | 34 | @implementation YLAwesomeSheetController 35 | - (instancetype)initWithTitle:(NSString *)title config:(id)config callBack:(YLAwesomeSheetSelectCallBack)callBack 36 | { 37 | if(self = [super init]){ 38 | self.titleLabel.text = title; 39 | self.dataConfiguration = config; 40 | self.callBack = callBack; 41 | } 42 | return self; 43 | } 44 | 45 | - (instancetype)initDatePickerWithTitle:(NSString *)title callBack:(YLAwesomeSelectDateCallBack)callBack 46 | { 47 | if(self = [super init]){ 48 | self.titleLabel.text = title; 49 | self.dateCallBack = callBack; 50 | } 51 | return self; 52 | } 53 | 54 | - (void)viewDidLoad { 55 | [super viewDidLoad]; 56 | // Do any additional setup after loading the view. 57 | self.view.backgroundColor = [[UIColor blackColor]colorWithAlphaComponent:0.2]; 58 | UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(cancel)]; 59 | [self.view addGestureRecognizer:tapGesture]; 60 | [self.view addSubview:self.contentView]; 61 | if(_dataConfiguration){ 62 | [self fetchData]; 63 | } 64 | [self showContentView]; 65 | } 66 | 67 | - (void)didReceiveMemoryWarning { 68 | [super didReceiveMemoryWarning]; 69 | // Dispose of any resources that can be recreated. 70 | } 71 | 72 | - (UIView *)contentView 73 | { 74 | if(!_contentView){ 75 | _contentView = [[UIView alloc]initWithFrame:CGRectMake(0, kFrameHeight, kFrameWidth, maxHeight)]; 76 | _contentView.backgroundColor = [UIColor whiteColor]; 77 | [_contentView addSubview:self.cancelBtn]; 78 | [_contentView addSubview:self.titleLabel]; 79 | [_contentView addSubview:self.ensureBtn]; 80 | [_contentView addSubview:self.line]; 81 | if(_dataConfiguration){//picker view 82 | [_contentView addSubview:self.picker]; 83 | }else{//date picker view 84 | [_contentView addSubview:self.datePicker]; 85 | } 86 | } 87 | return _contentView; 88 | } 89 | 90 | - (UIButton *)cancelBtn 91 | { 92 | if(!_cancelBtn){ 93 | _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 94 | _cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15]; 95 | UIColor *titleColor = [UIColor lightGrayColor]; 96 | [_cancelBtn setTitleColor:titleColor forState:UIControlStateNormal]; 97 | [_cancelBtn setTitleColor:[titleColor colorWithAlphaComponent:0.7] forState:UIControlStateHighlighted]; 98 | [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal]; 99 | [_cancelBtn addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchUpInside]; 100 | _cancelBtn.frame = CGRectMake(0, 0, 50, headerHeight); 101 | } 102 | return _cancelBtn; 103 | } 104 | 105 | - (UIButton *)ensureBtn 106 | { 107 | if(!_ensureBtn){ 108 | _ensureBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 109 | _ensureBtn.titleLabel.font = [UIFont systemFontOfSize:15]; 110 | UIColor *titleColor = [UIColor blackColor]; 111 | [_ensureBtn setTitleColor:titleColor forState:UIControlStateNormal]; 112 | [_ensureBtn setTitleColor:[titleColor colorWithAlphaComponent:0.7] forState:UIControlStateHighlighted]; 113 | [_ensureBtn setTitle:@"确定" forState:UIControlStateNormal]; 114 | [_ensureBtn addTarget:self action:@selector(ensure) forControlEvents:UIControlEventTouchUpInside]; 115 | _ensureBtn.frame = CGRectMake(kFrameWidth - 50, 0, 50, headerHeight); 116 | } 117 | return _ensureBtn; 118 | } 119 | 120 | - (UILabel *)titleLabel 121 | { 122 | if(!_titleLabel){ 123 | _titleLabel = [[UILabel alloc]init]; 124 | _titleLabel.font = [UIFont systemFontOfSize:15]; 125 | _titleLabel.textColor = [UIColor blackColor]; 126 | _titleLabel.textAlignment = NSTextAlignmentCenter; 127 | _titleLabel.frame = CGRectMake(60, 0, kFrameWidth - 120, headerHeight); 128 | } 129 | return _titleLabel; 130 | } 131 | 132 | - (UIView *)line 133 | { 134 | if(!_line){ 135 | _line = [[UIView alloc]initWithFrame:CGRectMake(0, headerHeight, kFrameWidth, 1)]; 136 | _line.backgroundColor = [UIColor groupTableViewBackgroundColor]; 137 | } 138 | return _line; 139 | } 140 | 141 | - (UIPickerView *)picker 142 | { 143 | if(!_picker) 144 | { 145 | _picker = [[UIPickerView alloc]initWithFrame:CGRectMake(0, headerHeight + 1, kFrameWidth, maxHeight - headerHeight - 1)]; 146 | _picker.delegate = self; 147 | _picker.dataSource = self; 148 | _picker.showsSelectionIndicator = YES; 149 | } 150 | return _picker; 151 | } 152 | 153 | - (UIDatePicker *)datePicker 154 | { 155 | if(!_datePicker){ 156 | _datePicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, headerHeight + 1, kFrameWidth, maxHeight - headerHeight - 1)]; 157 | [_datePicker setDate:[NSDate date] animated:NO]; 158 | [_datePicker setLocale:[[NSLocale alloc]initWithLocaleIdentifier:@"zh_CN"]]; 159 | NSDate *maxDate = [NSDate date]; 160 | [_datePicker setMaximumDate:maxDate]; 161 | [_datePicker setDatePickerMode:UIDatePickerModeDate]; 162 | } 163 | return _datePicker; 164 | } 165 | 166 | - (void)fetchData 167 | { 168 | _componentCount = [_dataConfiguration numberOfComponents]; 169 | _tmpSelectedData = [NSMutableArray arrayWithCapacity:_componentCount]; 170 | [self.picker reloadAllComponents]; 171 | 172 | for(NSInteger i = 0; i < _componentCount; i++){ 173 | YLAwesomeData *selectedData = [_dataConfiguration defaultSelectDataInComponent:i]; 174 | if(!selectedData){ 175 | NSArray *currentDatas = _dataConfiguration.dataSource[@(i)]; 176 | if(currentDatas && currentDatas.count > 0){ 177 | selectedData = currentDatas[0]; 178 | } 179 | } 180 | 181 | if(selectedData){ 182 | NSArray *array = _dataConfiguration.dataSource[@(i)]; 183 | if(array){ 184 | NSInteger row = [array indexOfObject:selectedData]; 185 | if(row != NSNotFound){ 186 | [_picker selectRow:row inComponent:i animated:NO]; 187 | [self pickerView:_picker didSelectRow:row inComponent:i]; 188 | } 189 | } 190 | } 191 | } 192 | } 193 | 194 | 195 | #pragma mark ---UIPickerViewDataSource 196 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 197 | { 198 | return _componentCount; 199 | } 200 | 201 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component; 202 | { 203 | if(component < _componentCount){ 204 | NSArray *array = _dataConfiguration.dataSource[@(component)]; 205 | if(array){ 206 | return array.count; 207 | } 208 | } 209 | return 0; 210 | } 211 | 212 | #pragma mark ---UIPickerViewDelegate 213 | - (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component 214 | { 215 | return pickerView.bounds.size.width / _componentCount; 216 | } 217 | 218 | - (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component 219 | { 220 | return cellHeight; 221 | } 222 | 223 | - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 224 | { 225 | NSString *title; 226 | if(component < _componentCount){ 227 | NSArray *array = _dataConfiguration.dataSource[@(component)]; 228 | if(array && array.count > row){ 229 | YLAwesomeData *data = array[row]; 230 | title = data.name; 231 | } 232 | } 233 | return title; 234 | } 235 | 236 | - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component 237 | { 238 | if(component < _componentCount){ 239 | //remember the select data 240 | NSArray *array = _dataConfiguration.dataSource[@(component)]; 241 | if(array && array.count > row){ 242 | YLAwesomeData *currentData = array[row]; 243 | if(_tmpSelectedData.count > component){ 244 | _tmpSelectedData[component] = currentData; 245 | }else{ 246 | [_tmpSelectedData addObject:currentData]; 247 | } 248 | } 249 | 250 | //ex: when select first component, the second to the last component data need refresh 251 | for(NSInteger nextCom = component + 1; nextCom < _componentCount; nextCom++){ 252 | //reload data 253 | NSArray *nextArray = [_dataConfiguration dataInComponent:nextCom selectedComponent:component row:row]; 254 | [pickerView reloadComponent:nextCom]; 255 | if(nextArray.count > 0){ 256 | NSInteger nextSelectRow = 0; 257 | //remember the select data 258 | YLAwesomeData *nextData = nextArray[nextSelectRow]; 259 | if(_tmpSelectedData.count > nextCom){ 260 | _tmpSelectedData[nextCom] = nextData; 261 | }else{ 262 | [_tmpSelectedData addObject:nextData]; 263 | } 264 | [pickerView selectRow:nextSelectRow inComponent:nextCom animated:NO]; 265 | }else{ 266 | if(_tmpSelectedData.count > nextCom){ 267 | //remove the last selected data 268 | [_tmpSelectedData removeObjectsInRange:NSMakeRange(nextCom, _tmpSelectedData.count - nextCom)]; 269 | } 270 | } 271 | } 272 | } 273 | } 274 | 275 | - (void)showContentView 276 | { 277 | if(_contentView){ 278 | [UIView animateWithDuration:0.15 animations:^{ 279 | CGRect frame = _contentView.frame; 280 | frame.origin.y = kFrameHeight - maxHeight; 281 | _contentView.frame = frame; 282 | }]; 283 | } 284 | } 285 | 286 | - (void)dismissContentView 287 | { 288 | if(_contentView){ 289 | [UIView animateWithDuration:0.15 animations:^{ 290 | CGRect frame = _contentView.frame; 291 | frame.origin.y = kFrameHeight; 292 | _contentView.frame = frame; 293 | }completion:^(BOOL finished) { 294 | [self.view removeFromSuperview]; 295 | [self removeFromParentViewController]; 296 | }]; 297 | }else{ 298 | [self.view removeFromSuperview]; 299 | [self removeFromParentViewController]; 300 | } 301 | } 302 | 303 | - (void)showInController:(UIViewController *)controller 304 | { 305 | if(controller && [controller isKindOfClass:[UIViewController class]]){ 306 | UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; 307 | [keyWindow addSubview:self.view]; 308 | [controller addChildViewController:self]; 309 | } 310 | } 311 | 312 | #pragma mark---other methods 313 | - (void)cancel 314 | { 315 | [_tmpSelectedData removeAllObjects]; 316 | [self dismissContentView]; 317 | } 318 | 319 | - (void)ensure 320 | { 321 | if(_dataConfiguration){ 322 | if(_callBack){ 323 | _callBack(_tmpSelectedData); 324 | } 325 | }else if(_dateCallBack){ 326 | _dateCallBack(_datePicker.date); 327 | } 328 | [self dismissContentView]; 329 | } 330 | 331 | @end 332 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLDataConfiguration.h: -------------------------------------------------------------------------------- 1 | // 2 | // YLDataConfiguration.h 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "YLAwesomeDataDelegate.h" 11 | 12 | typedef NS_ENUM(NSInteger,YLDataConfigType) { 13 | YLDataConfigTypeUnKnow = 0,///< unknow the type 14 | YLDataConfigTypeGender = 1000,///< select gender 15 | YLDataConfigTypeAcademic,///< select academic 16 | YLDataConfigTypeWorkYear,///< select work years 17 | YLDataConfigTypeStartTime,///< select start time 18 | YLDataConfigTypeEndTime,///< select end time 19 | YLDataConfigTypeAddress,////< select province-city-region 20 | }; 21 | 22 | @interface YLDataConfiguration : NSObject 23 | @property(nonatomic,copy)NSArray *selectedData; 24 | 25 | 26 | /** 27 | You can use the default type, it will auto init the data. 28 | 29 | @param type YLDataConfigType 30 | @param selectedData The last selected data 31 | @return instance 32 | */ 33 | - (instancetype)initWithType:(YLDataConfigType)type selectedData:(NSArray *)selectedData; 34 | 35 | 36 | /** 37 | You can use this method to custom the select data. 38 | 39 | @param dataDic The select data like: @{@0:@[data0,data1...]} 40 | @param selectedData The last selected data 41 | @return instance 42 | */ 43 | - (instancetype)initWithData:(NSDictionary *)dataDic selectedData:(NSArray *)selectedData; 44 | 45 | 46 | @end 47 | //the data configuration center 48 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLDataConfiguration.m: -------------------------------------------------------------------------------- 1 | // 2 | // YLDataConfiguration.m 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import "YLDataConfiguration.h" 10 | #import "YLAwesomeData.h" 11 | 12 | @interface YLDataConfiguration () 13 | @property(nonatomic,copy,readwrite)NSDictionary *dataSource;///< ex: @{@0:@[data0,data1...]} 14 | @property(nonatomic,assign)YLDataConfigType type; 15 | @property(nonatomic,copy)NSArray *allMonths;///< 12~1 16 | @property(nonatomic,copy)NSArray *currentMonths;///< currentMonth ~ 1 17 | @end 18 | 19 | @implementation YLDataConfiguration 20 | - (instancetype)initWithType:(YLDataConfigType)type selectedData:(NSArray *)selectedData 21 | { 22 | if(self = [super init]){ 23 | self.type = type; 24 | [self getDefaultDataWithType:type]; 25 | self.selectedData = selectedData; 26 | } 27 | return self; 28 | } 29 | 30 | - (instancetype)initWithData:(NSDictionary *)dataDic selectedData:(NSArray *)selectedData 31 | { 32 | if(self = [super init]){ 33 | self.dataSource = dataDic; 34 | self.selectedData = selectedData; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)getDefaultDataWithType:(YLDataConfigType)type 40 | { 41 | switch (type) { 42 | case YLDataConfigTypeGender:{ 43 | YLAwesomeData *data0 = [[YLAwesomeData alloc]initWithId:0 name:@"男"]; 44 | YLAwesomeData *data1 = [[YLAwesomeData alloc]initWithId:1 name:@"女"]; 45 | self.dataSource = @{@0:@[data0,data1]}; 46 | } 47 | break; 48 | case YLDataConfigTypeAcademic:{ 49 | NSArray *names = @[@"小学",@"初中",@"高中",@"大专",@"本科",@"硕士",@"博士",@"博士后"]; 50 | NSMutableArray *array = [NSMutableArray arrayWithCapacity:names.count]; 51 | for(NSInteger i = 0; i < names.count; i++){ 52 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:i name:names[i]]; 53 | [array addObject:data]; 54 | } 55 | self.dataSource = @{@0:array}; 56 | } 57 | break; 58 | case YLDataConfigTypeWorkYear:{ 59 | NSArray *names = @[@"应届毕业生",@"1~3年",@"3~5年",@"5~10年",@"10年以上"]; 60 | NSMutableArray *array = [NSMutableArray arrayWithCapacity:names.count]; 61 | for(NSInteger i = 0; i < names.count; i++){ 62 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:i name:names[i]]; 63 | [array addObject:data]; 64 | } 65 | self.dataSource = @{@0:array}; 66 | } 67 | break; 68 | case YLDataConfigTypeStartTime:{ 69 | NSDateComponents *dateComponents = [self currentDateComponents]; 70 | NSInteger year = dateComponents.year; 71 | NSInteger month = dateComponents.month; 72 | 73 | NSMutableArray *years = [NSMutableArray array]; 74 | for(NSInteger i = year; i >= 1990; i--){ 75 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:i name:[NSString stringWithFormat:@"%li",i]]; 76 | [years addObject:data]; 77 | } 78 | NSMutableArray *months = [NSMutableArray arrayWithCapacity:12]; 79 | NSMutableArray *currentMonths = [NSMutableArray arrayWithCapacity:month]; 80 | for(NSInteger j = 12; j > 0; j--){ 81 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:j name:[NSString stringWithFormat:@"%li",j]]; 82 | [months addObject:data]; 83 | if(j <= month){ 84 | [currentMonths addObject:data]; 85 | } 86 | } 87 | self.allMonths = months; 88 | self.currentMonths = currentMonths; 89 | self.dataSource = @{@0:years,@1:months}; 90 | } 91 | break; 92 | case YLDataConfigTypeEndTime:{ 93 | NSDateComponents *dateComponents = [self currentDateComponents]; 94 | NSInteger year = dateComponents.year; 95 | NSInteger month = dateComponents.month; 96 | 97 | NSMutableArray *years = [NSMutableArray array]; 98 | [years addObject:[[YLAwesomeData alloc]initWithId:0 name:@"至今"]]; 99 | for(NSInteger i = year; i >= 1990; i--){ 100 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:i name:[NSString stringWithFormat:@"%li",i]]; 101 | [years addObject:data]; 102 | } 103 | NSMutableArray *months = [NSMutableArray arrayWithCapacity:12]; 104 | NSMutableArray *currentMonths = [NSMutableArray arrayWithCapacity:month]; 105 | for(NSInteger j = 12; j > 0; j--){ 106 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:j name:[NSString stringWithFormat:@"%li",j]]; 107 | [months addObject:data]; 108 | if(j <= month){ 109 | [currentMonths addObject:data]; 110 | } 111 | } 112 | self.allMonths = months; 113 | self.currentMonths = currentMonths; 114 | self.dataSource = @{@0:years,@1:months}; 115 | } 116 | break; 117 | case YLDataConfigTypeAddress:{ 118 | NSString *provincePath = [[NSBundle mainBundle]pathForResource:@"province" ofType:@"json"]; 119 | NSData *provinceData = [NSData dataWithContentsOfFile:provincePath]; 120 | NSArray *provinceArray = [NSJSONSerialization JSONObjectWithData:provinceData options:0 error:nil]; 121 | NSMutableArray *provinces = [NSMutableArray arrayWithCapacity:provinceArray.count]; 122 | for(NSInteger i = 0; i < provinceArray.count; i++){ 123 | NSDictionary *tmpDic = provinceArray[i]; 124 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:[tmpDic[@"id"]integerValue] name:tmpDic[@"name"]]; 125 | [provinces addObject:data]; 126 | } 127 | 128 | NSArray *citys = [NSArray array]; 129 | if(provinces.count > 0){ 130 | YLAwesomeData *firstProvince = provinces[0]; 131 | citys = [self citysInProvince:firstProvince.objId]; 132 | } 133 | 134 | NSArray *areas = [NSArray array]; 135 | if(citys.count > 0){ 136 | YLAwesomeData *firstCity = citys[0]; 137 | areas = [self areasInCity:firstCity.objId]; 138 | } 139 | 140 | self.dataSource = @{@0:provinces,@1:citys,@2:areas}; 141 | } 142 | break; 143 | case YLDataConfigTypeUnKnow: 144 | default: 145 | break; 146 | } 147 | } 148 | 149 | - (NSDateComponents *)currentDateComponents 150 | { 151 | NSDate *now = [NSDate date]; 152 | NSCalendar *calendar = [NSCalendar currentCalendar]; 153 | NSDateComponents *dateComponents = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth fromDate:now]; 154 | return dateComponents; 155 | } 156 | 157 | - (NSArray *)citysInProvince:(NSInteger)pId 158 | { 159 | NSMutableArray *citys = [NSMutableArray array]; 160 | NSString *cityPath = [[NSBundle mainBundle]pathForResource:@"city" ofType:@"json"]; 161 | NSData *cityData = [NSData dataWithContentsOfFile:cityPath]; 162 | NSDictionary *cityDictionary = [NSJSONSerialization JSONObjectWithData:cityData options:0 error:nil]; 163 | NSArray *firstCityArray = [cityDictionary objectForKey:[NSString stringWithFormat:@"%li",pId]]; 164 | if(firstCityArray){ 165 | for(NSInteger i = 0; i < firstCityArray.count; i++){ 166 | NSDictionary *tmpDic = firstCityArray[i]; 167 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:[tmpDic[@"id"]integerValue] name:tmpDic[@"name"]]; 168 | [citys addObject:data]; 169 | } 170 | } 171 | return citys; 172 | } 173 | 174 | - (NSArray *)areasInCity:(NSInteger)cId 175 | { 176 | NSMutableArray *areas = [NSMutableArray array]; 177 | NSString *areaPath = [[NSBundle mainBundle]pathForResource:@"area" ofType:@"json"]; 178 | NSData *areaData = [NSData dataWithContentsOfFile:areaPath]; 179 | NSDictionary *areaDictionary = [NSJSONSerialization JSONObjectWithData:areaData options:0 error:nil]; 180 | NSArray *areaArray = [areaDictionary objectForKey:[NSString stringWithFormat:@"%li",cId]]; 181 | if(areaArray){ 182 | for(NSInteger i = 0; i < areaArray.count; i++){ 183 | NSDictionary *tmpDic = areaArray[i]; 184 | YLAwesomeData *data = [[YLAwesomeData alloc]initWithId:[tmpDic[@"id"]integerValue] name:tmpDic[@"name"]]; 185 | [areas addObject:data]; 186 | } 187 | } 188 | return areas; 189 | } 190 | 191 | #pragma mark---YLAwesomeDataDelegate 192 | - (NSInteger)numberOfComponents 193 | { 194 | return _dataSource.allKeys.count; 195 | } 196 | 197 | - (YLAwesomeData *)defaultSelectDataInComponent:(NSInteger)component 198 | { 199 | if(_selectedData.count > component){ 200 | return _selectedData[component]; 201 | } 202 | return nil; 203 | } 204 | 205 | - (NSArray *)dataInComponent:(NSInteger)component 206 | { 207 | if([_dataSource.allKeys containsObject:@(component)]){ 208 | return _dataSource[@(component)]; 209 | } 210 | return @[]; 211 | } 212 | 213 | - (void)updateDataSourceWithIndex:(NSInteger)index data:(NSArray *)data 214 | { 215 | if(data){ 216 | NSMutableDictionary *tmpDic = [NSMutableDictionary dictionaryWithDictionary:self.dataSource]; 217 | tmpDic[@(index)] = data; 218 | self.dataSource = tmpDic; 219 | } 220 | } 221 | 222 | - (NSArray *)dataInComponent:(NSInteger)nComponent selectedComponent:(NSInteger)sComponent row:(NSInteger)row 223 | { 224 | if(_type == YLDataConfigTypeStartTime){ 225 | if(sComponent == 0){ 226 | if(row == 0){ 227 | [self updateDataSourceWithIndex:1 data:self.currentMonths]; 228 | return self.currentMonths; 229 | }else{ 230 | [self updateDataSourceWithIndex:1 data:self.allMonths]; 231 | return self.allMonths; 232 | } 233 | } 234 | }else if (_type == YLDataConfigTypeEndTime){ 235 | if(sComponent == 0){ 236 | if(row == 0){ 237 | [self updateDataSourceWithIndex:1 data:@[]]; 238 | return @[]; 239 | }else if(row == 1){ 240 | [self updateDataSourceWithIndex:1 data:self.currentMonths]; 241 | return self.currentMonths; 242 | }else{ 243 | [self updateDataSourceWithIndex:1 data:self.allMonths]; 244 | return self.allMonths; 245 | } 246 | } 247 | }else if(_type == YLDataConfigTypeAddress){ 248 | if(sComponent == 0){//select province,then refresh citys and areas 249 | NSArray *provinces = self.dataSource[@0]; 250 | if(provinces && provinces.count > row){ 251 | YLAwesomeData *currentProvince = provinces[row]; 252 | NSArray *citys = [self citysInProvince:currentProvince.objId]; 253 | NSArray *areas = [NSArray array]; 254 | if(citys.count > 0){ 255 | YLAwesomeData *firstCity = citys[0]; 256 | areas = [self areasInCity:firstCity.objId]; 257 | } 258 | if(nComponent == 1){ 259 | [self updateDataSourceWithIndex:1 data:citys]; 260 | return citys; 261 | }else if (nComponent == 2){ 262 | [self updateDataSourceWithIndex:2 data:areas]; 263 | return areas; 264 | } 265 | } 266 | return @[]; 267 | }else if (sComponent == 1){//select city,then refresh areas 268 | NSArray *citys = self.dataSource[@1]; 269 | if(citys && citys.count > row){ 270 | YLAwesomeData *currentCity = citys[row]; 271 | NSArray *areas = [self areasInCity:currentCity.objId]; 272 | [self updateDataSourceWithIndex:2 data:areas]; 273 | return areas; 274 | } 275 | return @[]; 276 | } 277 | }else if (nComponent < _dataSource.allKeys.count){ 278 | NSArray *data = _dataSource[@(nComponent)]; 279 | [self updateDataSourceWithIndex:nComponent data:data]; 280 | return data; 281 | } 282 | return @[]; 283 | } 284 | 285 | @end 286 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLTestData.h: -------------------------------------------------------------------------------- 1 | // 2 | // YLTestData.h 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/16. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YLTestData : NSObject 12 | @property(nonatomic,copy)NSString *title; 13 | @property(nonatomic,copy)NSArray *data; 14 | 15 | - (instancetype)initWithTitle:(NSString *)title; 16 | 17 | @end 18 | //test object 19 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/YLTestData.m: -------------------------------------------------------------------------------- 1 | // 2 | // YLTestData.m 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/16. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import "YLTestData.h" 10 | 11 | @implementation YLTestData 12 | - (instancetype)initWithTitle:(NSString *)title 13 | { 14 | if(self = [super init]){ 15 | self.title = title; 16 | } 17 | return self; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/city.json: -------------------------------------------------------------------------------- 1 | { 2 | "110000": [ 3 | { 4 | "province": "北京市", 5 | "name": "市辖区", 6 | "id": "110100" 7 | } 8 | ], 9 | "120000": [ 10 | { 11 | "province": "天津市", 12 | "name": "市辖区", 13 | "id": "120100" 14 | } 15 | ], 16 | "130000": [ 17 | { 18 | "province": "河北省", 19 | "name": "石家庄市", 20 | "id": "130100" 21 | }, 22 | { 23 | "province": "河北省", 24 | "name": "唐山市", 25 | "id": "130200" 26 | }, 27 | { 28 | "province": "河北省", 29 | "name": "秦皇岛市", 30 | "id": "130300" 31 | }, 32 | { 33 | "province": "河北省", 34 | "name": "邯郸市", 35 | "id": "130400" 36 | }, 37 | { 38 | "province": "河北省", 39 | "name": "邢台市", 40 | "id": "130500" 41 | }, 42 | { 43 | "province": "河北省", 44 | "name": "保定市", 45 | "id": "130600" 46 | }, 47 | { 48 | "province": "河北省", 49 | "name": "张家口市", 50 | "id": "130700" 51 | }, 52 | { 53 | "province": "河北省", 54 | "name": "承德市", 55 | "id": "130800" 56 | }, 57 | { 58 | "province": "河北省", 59 | "name": "沧州市", 60 | "id": "130900" 61 | }, 62 | { 63 | "province": "河北省", 64 | "name": "廊坊市", 65 | "id": "131000" 66 | }, 67 | { 68 | "province": "河北省", 69 | "name": "衡水市", 70 | "id": "131100" 71 | }, 72 | { 73 | "province": "河北省", 74 | "name": "省直辖县级行政区划", 75 | "id": "139000" 76 | } 77 | ], 78 | "140000": [ 79 | { 80 | "province": "山西省", 81 | "name": "太原市", 82 | "id": "140100" 83 | }, 84 | { 85 | "province": "山西省", 86 | "name": "大同市", 87 | "id": "140200" 88 | }, 89 | { 90 | "province": "山西省", 91 | "name": "阳泉市", 92 | "id": "140300" 93 | }, 94 | { 95 | "province": "山西省", 96 | "name": "长治市", 97 | "id": "140400" 98 | }, 99 | { 100 | "province": "山西省", 101 | "name": "晋城市", 102 | "id": "140500" 103 | }, 104 | { 105 | "province": "山西省", 106 | "name": "朔州市", 107 | "id": "140600" 108 | }, 109 | { 110 | "province": "山西省", 111 | "name": "晋中市", 112 | "id": "140700" 113 | }, 114 | { 115 | "province": "山西省", 116 | "name": "运城市", 117 | "id": "140800" 118 | }, 119 | { 120 | "province": "山西省", 121 | "name": "忻州市", 122 | "id": "140900" 123 | }, 124 | { 125 | "province": "山西省", 126 | "name": "临汾市", 127 | "id": "141000" 128 | }, 129 | { 130 | "province": "山西省", 131 | "name": "吕梁市", 132 | "id": "141100" 133 | } 134 | ], 135 | "150000": [ 136 | { 137 | "province": "内蒙古自治区", 138 | "name": "呼和浩特市", 139 | "id": "150100" 140 | }, 141 | { 142 | "province": "内蒙古自治区", 143 | "name": "包头市", 144 | "id": "150200" 145 | }, 146 | { 147 | "province": "内蒙古自治区", 148 | "name": "乌海市", 149 | "id": "150300" 150 | }, 151 | { 152 | "province": "内蒙古自治区", 153 | "name": "赤峰市", 154 | "id": "150400" 155 | }, 156 | { 157 | "province": "内蒙古自治区", 158 | "name": "通辽市", 159 | "id": "150500" 160 | }, 161 | { 162 | "province": "内蒙古自治区", 163 | "name": "鄂尔多斯市", 164 | "id": "150600" 165 | }, 166 | { 167 | "province": "内蒙古自治区", 168 | "name": "呼伦贝尔市", 169 | "id": "150700" 170 | }, 171 | { 172 | "province": "内蒙古自治区", 173 | "name": "巴彦淖尔市", 174 | "id": "150800" 175 | }, 176 | { 177 | "province": "内蒙古自治区", 178 | "name": "乌兰察布市", 179 | "id": "150900" 180 | }, 181 | { 182 | "province": "内蒙古自治区", 183 | "name": "兴安盟", 184 | "id": "152200" 185 | }, 186 | { 187 | "province": "内蒙古自治区", 188 | "name": "锡林郭勒盟", 189 | "id": "152500" 190 | }, 191 | { 192 | "province": "内蒙古自治区", 193 | "name": "阿拉善盟", 194 | "id": "152900" 195 | } 196 | ], 197 | "210000": [ 198 | { 199 | "province": "辽宁省", 200 | "name": "沈阳市", 201 | "id": "210100" 202 | }, 203 | { 204 | "province": "辽宁省", 205 | "name": "大连市", 206 | "id": "210200" 207 | }, 208 | { 209 | "province": "辽宁省", 210 | "name": "鞍山市", 211 | "id": "210300" 212 | }, 213 | { 214 | "province": "辽宁省", 215 | "name": "抚顺市", 216 | "id": "210400" 217 | }, 218 | { 219 | "province": "辽宁省", 220 | "name": "本溪市", 221 | "id": "210500" 222 | }, 223 | { 224 | "province": "辽宁省", 225 | "name": "丹东市", 226 | "id": "210600" 227 | }, 228 | { 229 | "province": "辽宁省", 230 | "name": "锦州市", 231 | "id": "210700" 232 | }, 233 | { 234 | "province": "辽宁省", 235 | "name": "营口市", 236 | "id": "210800" 237 | }, 238 | { 239 | "province": "辽宁省", 240 | "name": "阜新市", 241 | "id": "210900" 242 | }, 243 | { 244 | "province": "辽宁省", 245 | "name": "辽阳市", 246 | "id": "211000" 247 | }, 248 | { 249 | "province": "辽宁省", 250 | "name": "盘锦市", 251 | "id": "211100" 252 | }, 253 | { 254 | "province": "辽宁省", 255 | "name": "铁岭市", 256 | "id": "211200" 257 | }, 258 | { 259 | "province": "辽宁省", 260 | "name": "朝阳市", 261 | "id": "211300" 262 | }, 263 | { 264 | "province": "辽宁省", 265 | "name": "葫芦岛市", 266 | "id": "211400" 267 | } 268 | ], 269 | "220000": [ 270 | { 271 | "province": "吉林省", 272 | "name": "长春市", 273 | "id": "220100" 274 | }, 275 | { 276 | "province": "吉林省", 277 | "name": "吉林市", 278 | "id": "220200" 279 | }, 280 | { 281 | "province": "吉林省", 282 | "name": "四平市", 283 | "id": "220300" 284 | }, 285 | { 286 | "province": "吉林省", 287 | "name": "辽源市", 288 | "id": "220400" 289 | }, 290 | { 291 | "province": "吉林省", 292 | "name": "通化市", 293 | "id": "220500" 294 | }, 295 | { 296 | "province": "吉林省", 297 | "name": "白山市", 298 | "id": "220600" 299 | }, 300 | { 301 | "province": "吉林省", 302 | "name": "松原市", 303 | "id": "220700" 304 | }, 305 | { 306 | "province": "吉林省", 307 | "name": "白城市", 308 | "id": "220800" 309 | }, 310 | { 311 | "province": "吉林省", 312 | "name": "延边朝鲜族自治州", 313 | "id": "222400" 314 | } 315 | ], 316 | "230000": [ 317 | { 318 | "province": "黑龙江省", 319 | "name": "哈尔滨市", 320 | "id": "230100" 321 | }, 322 | { 323 | "province": "黑龙江省", 324 | "name": "齐齐哈尔市", 325 | "id": "230200" 326 | }, 327 | { 328 | "province": "黑龙江省", 329 | "name": "鸡西市", 330 | "id": "230300" 331 | }, 332 | { 333 | "province": "黑龙江省", 334 | "name": "鹤岗市", 335 | "id": "230400" 336 | }, 337 | { 338 | "province": "黑龙江省", 339 | "name": "双鸭山市", 340 | "id": "230500" 341 | }, 342 | { 343 | "province": "黑龙江省", 344 | "name": "大庆市", 345 | "id": "230600" 346 | }, 347 | { 348 | "province": "黑龙江省", 349 | "name": "伊春市", 350 | "id": "230700" 351 | }, 352 | { 353 | "province": "黑龙江省", 354 | "name": "佳木斯市", 355 | "id": "230800" 356 | }, 357 | { 358 | "province": "黑龙江省", 359 | "name": "七台河市", 360 | "id": "230900" 361 | }, 362 | { 363 | "province": "黑龙江省", 364 | "name": "牡丹江市", 365 | "id": "231000" 366 | }, 367 | { 368 | "province": "黑龙江省", 369 | "name": "黑河市", 370 | "id": "231100" 371 | }, 372 | { 373 | "province": "黑龙江省", 374 | "name": "绥化市", 375 | "id": "231200" 376 | }, 377 | { 378 | "province": "黑龙江省", 379 | "name": "大兴安岭地区", 380 | "id": "232700" 381 | } 382 | ], 383 | "310000": [ 384 | { 385 | "province": "上海市", 386 | "name": "市辖区", 387 | "id": "310100" 388 | } 389 | ], 390 | "320000": [ 391 | { 392 | "province": "江苏省", 393 | "name": "南京市", 394 | "id": "320100" 395 | }, 396 | { 397 | "province": "江苏省", 398 | "name": "无锡市", 399 | "id": "320200" 400 | }, 401 | { 402 | "province": "江苏省", 403 | "name": "徐州市", 404 | "id": "320300" 405 | }, 406 | { 407 | "province": "江苏省", 408 | "name": "常州市", 409 | "id": "320400" 410 | }, 411 | { 412 | "province": "江苏省", 413 | "name": "苏州市", 414 | "id": "320500" 415 | }, 416 | { 417 | "province": "江苏省", 418 | "name": "南通市", 419 | "id": "320600" 420 | }, 421 | { 422 | "province": "江苏省", 423 | "name": "连云港市", 424 | "id": "320700" 425 | }, 426 | { 427 | "province": "江苏省", 428 | "name": "淮安市", 429 | "id": "320800" 430 | }, 431 | { 432 | "province": "江苏省", 433 | "name": "盐城市", 434 | "id": "320900" 435 | }, 436 | { 437 | "province": "江苏省", 438 | "name": "扬州市", 439 | "id": "321000" 440 | }, 441 | { 442 | "province": "江苏省", 443 | "name": "镇江市", 444 | "id": "321100" 445 | }, 446 | { 447 | "province": "江苏省", 448 | "name": "泰州市", 449 | "id": "321200" 450 | }, 451 | { 452 | "province": "江苏省", 453 | "name": "宿迁市", 454 | "id": "321300" 455 | } 456 | ], 457 | "330000": [ 458 | { 459 | "province": "浙江省", 460 | "name": "杭州市", 461 | "id": "330100" 462 | }, 463 | { 464 | "province": "浙江省", 465 | "name": "宁波市", 466 | "id": "330200" 467 | }, 468 | { 469 | "province": "浙江省", 470 | "name": "温州市", 471 | "id": "330300" 472 | }, 473 | { 474 | "province": "浙江省", 475 | "name": "嘉兴市", 476 | "id": "330400" 477 | }, 478 | { 479 | "province": "浙江省", 480 | "name": "湖州市", 481 | "id": "330500" 482 | }, 483 | { 484 | "province": "浙江省", 485 | "name": "绍兴市", 486 | "id": "330600" 487 | }, 488 | { 489 | "province": "浙江省", 490 | "name": "金华市", 491 | "id": "330700" 492 | }, 493 | { 494 | "province": "浙江省", 495 | "name": "衢州市", 496 | "id": "330800" 497 | }, 498 | { 499 | "province": "浙江省", 500 | "name": "舟山市", 501 | "id": "330900" 502 | }, 503 | { 504 | "province": "浙江省", 505 | "name": "台州市", 506 | "id": "331000" 507 | }, 508 | { 509 | "province": "浙江省", 510 | "name": "丽水市", 511 | "id": "331100" 512 | } 513 | ], 514 | "340000": [ 515 | { 516 | "province": "安徽省", 517 | "name": "合肥市", 518 | "id": "340100" 519 | }, 520 | { 521 | "province": "安徽省", 522 | "name": "芜湖市", 523 | "id": "340200" 524 | }, 525 | { 526 | "province": "安徽省", 527 | "name": "蚌埠市", 528 | "id": "340300" 529 | }, 530 | { 531 | "province": "安徽省", 532 | "name": "淮南市", 533 | "id": "340400" 534 | }, 535 | { 536 | "province": "安徽省", 537 | "name": "马鞍山市", 538 | "id": "340500" 539 | }, 540 | { 541 | "province": "安徽省", 542 | "name": "淮北市", 543 | "id": "340600" 544 | }, 545 | { 546 | "province": "安徽省", 547 | "name": "铜陵市", 548 | "id": "340700" 549 | }, 550 | { 551 | "province": "安徽省", 552 | "name": "安庆市", 553 | "id": "340800" 554 | }, 555 | { 556 | "province": "安徽省", 557 | "name": "黄山市", 558 | "id": "341000" 559 | }, 560 | { 561 | "province": "安徽省", 562 | "name": "滁州市", 563 | "id": "341100" 564 | }, 565 | { 566 | "province": "安徽省", 567 | "name": "阜阳市", 568 | "id": "341200" 569 | }, 570 | { 571 | "province": "安徽省", 572 | "name": "宿州市", 573 | "id": "341300" 574 | }, 575 | { 576 | "province": "安徽省", 577 | "name": "六安市", 578 | "id": "341500" 579 | }, 580 | { 581 | "province": "安徽省", 582 | "name": "亳州市", 583 | "id": "341600" 584 | }, 585 | { 586 | "province": "安徽省", 587 | "name": "池州市", 588 | "id": "341700" 589 | }, 590 | { 591 | "province": "安徽省", 592 | "name": "宣城市", 593 | "id": "341800" 594 | } 595 | ], 596 | "350000": [ 597 | { 598 | "province": "福建省", 599 | "name": "福州市", 600 | "id": "350100" 601 | }, 602 | { 603 | "province": "福建省", 604 | "name": "厦门市", 605 | "id": "350200" 606 | }, 607 | { 608 | "province": "福建省", 609 | "name": "莆田市", 610 | "id": "350300" 611 | }, 612 | { 613 | "province": "福建省", 614 | "name": "三明市", 615 | "id": "350400" 616 | }, 617 | { 618 | "province": "福建省", 619 | "name": "泉州市", 620 | "id": "350500" 621 | }, 622 | { 623 | "province": "福建省", 624 | "name": "漳州市", 625 | "id": "350600" 626 | }, 627 | { 628 | "province": "福建省", 629 | "name": "南平市", 630 | "id": "350700" 631 | }, 632 | { 633 | "province": "福建省", 634 | "name": "龙岩市", 635 | "id": "350800" 636 | }, 637 | { 638 | "province": "福建省", 639 | "name": "宁德市", 640 | "id": "350900" 641 | } 642 | ], 643 | "360000": [ 644 | { 645 | "province": "江西省", 646 | "name": "南昌市", 647 | "id": "360100" 648 | }, 649 | { 650 | "province": "江西省", 651 | "name": "景德镇市", 652 | "id": "360200" 653 | }, 654 | { 655 | "province": "江西省", 656 | "name": "萍乡市", 657 | "id": "360300" 658 | }, 659 | { 660 | "province": "江西省", 661 | "name": "九江市", 662 | "id": "360400" 663 | }, 664 | { 665 | "province": "江西省", 666 | "name": "新余市", 667 | "id": "360500" 668 | }, 669 | { 670 | "province": "江西省", 671 | "name": "鹰潭市", 672 | "id": "360600" 673 | }, 674 | { 675 | "province": "江西省", 676 | "name": "赣州市", 677 | "id": "360700" 678 | }, 679 | { 680 | "province": "江西省", 681 | "name": "吉安市", 682 | "id": "360800" 683 | }, 684 | { 685 | "province": "江西省", 686 | "name": "宜春市", 687 | "id": "360900" 688 | }, 689 | { 690 | "province": "江西省", 691 | "name": "抚州市", 692 | "id": "361000" 693 | }, 694 | { 695 | "province": "江西省", 696 | "name": "上饶市", 697 | "id": "361100" 698 | } 699 | ], 700 | "370000": [ 701 | { 702 | "province": "山东省", 703 | "name": "济南市", 704 | "id": "370100" 705 | }, 706 | { 707 | "province": "山东省", 708 | "name": "青岛市", 709 | "id": "370200" 710 | }, 711 | { 712 | "province": "山东省", 713 | "name": "淄博市", 714 | "id": "370300" 715 | }, 716 | { 717 | "province": "山东省", 718 | "name": "枣庄市", 719 | "id": "370400" 720 | }, 721 | { 722 | "province": "山东省", 723 | "name": "东营市", 724 | "id": "370500" 725 | }, 726 | { 727 | "province": "山东省", 728 | "name": "烟台市", 729 | "id": "370600" 730 | }, 731 | { 732 | "province": "山东省", 733 | "name": "潍坊市", 734 | "id": "370700" 735 | }, 736 | { 737 | "province": "山东省", 738 | "name": "济宁市", 739 | "id": "370800" 740 | }, 741 | { 742 | "province": "山东省", 743 | "name": "泰安市", 744 | "id": "370900" 745 | }, 746 | { 747 | "province": "山东省", 748 | "name": "威海市", 749 | "id": "371000" 750 | }, 751 | { 752 | "province": "山东省", 753 | "name": "日照市", 754 | "id": "371100" 755 | }, 756 | { 757 | "province": "山东省", 758 | "name": "莱芜市", 759 | "id": "371200" 760 | }, 761 | { 762 | "province": "山东省", 763 | "name": "临沂市", 764 | "id": "371300" 765 | }, 766 | { 767 | "province": "山东省", 768 | "name": "德州市", 769 | "id": "371400" 770 | }, 771 | { 772 | "province": "山东省", 773 | "name": "聊城市", 774 | "id": "371500" 775 | }, 776 | { 777 | "province": "山东省", 778 | "name": "滨州市", 779 | "id": "371600" 780 | }, 781 | { 782 | "province": "山东省", 783 | "name": "菏泽市", 784 | "id": "371700" 785 | } 786 | ], 787 | "410000": [ 788 | { 789 | "province": "河南省", 790 | "name": "郑州市", 791 | "id": "410100" 792 | }, 793 | { 794 | "province": "河南省", 795 | "name": "开封市", 796 | "id": "410200" 797 | }, 798 | { 799 | "province": "河南省", 800 | "name": "洛阳市", 801 | "id": "410300" 802 | }, 803 | { 804 | "province": "河南省", 805 | "name": "平顶山市", 806 | "id": "410400" 807 | }, 808 | { 809 | "province": "河南省", 810 | "name": "安阳市", 811 | "id": "410500" 812 | }, 813 | { 814 | "province": "河南省", 815 | "name": "鹤壁市", 816 | "id": "410600" 817 | }, 818 | { 819 | "province": "河南省", 820 | "name": "新乡市", 821 | "id": "410700" 822 | }, 823 | { 824 | "province": "河南省", 825 | "name": "焦作市", 826 | "id": "410800" 827 | }, 828 | { 829 | "province": "河南省", 830 | "name": "濮阳市", 831 | "id": "410900" 832 | }, 833 | { 834 | "province": "河南省", 835 | "name": "许昌市", 836 | "id": "411000" 837 | }, 838 | { 839 | "province": "河南省", 840 | "name": "漯河市", 841 | "id": "411100" 842 | }, 843 | { 844 | "province": "河南省", 845 | "name": "三门峡市", 846 | "id": "411200" 847 | }, 848 | { 849 | "province": "河南省", 850 | "name": "南阳市", 851 | "id": "411300" 852 | }, 853 | { 854 | "province": "河南省", 855 | "name": "商丘市", 856 | "id": "411400" 857 | }, 858 | { 859 | "province": "河南省", 860 | "name": "信阳市", 861 | "id": "411500" 862 | }, 863 | { 864 | "province": "河南省", 865 | "name": "周口市", 866 | "id": "411600" 867 | }, 868 | { 869 | "province": "河南省", 870 | "name": "驻马店市", 871 | "id": "411700" 872 | }, 873 | { 874 | "province": "河南省", 875 | "name": "省直辖县级行政区划", 876 | "id": "419000" 877 | } 878 | ], 879 | "420000": [ 880 | { 881 | "province": "湖北省", 882 | "name": "武汉市", 883 | "id": "420100" 884 | }, 885 | { 886 | "province": "湖北省", 887 | "name": "黄石市", 888 | "id": "420200" 889 | }, 890 | { 891 | "province": "湖北省", 892 | "name": "十堰市", 893 | "id": "420300" 894 | }, 895 | { 896 | "province": "湖北省", 897 | "name": "宜昌市", 898 | "id": "420500" 899 | }, 900 | { 901 | "province": "湖北省", 902 | "name": "襄阳市", 903 | "id": "420600" 904 | }, 905 | { 906 | "province": "湖北省", 907 | "name": "鄂州市", 908 | "id": "420700" 909 | }, 910 | { 911 | "province": "湖北省", 912 | "name": "荆门市", 913 | "id": "420800" 914 | }, 915 | { 916 | "province": "湖北省", 917 | "name": "孝感市", 918 | "id": "420900" 919 | }, 920 | { 921 | "province": "湖北省", 922 | "name": "荆州市", 923 | "id": "421000" 924 | }, 925 | { 926 | "province": "湖北省", 927 | "name": "黄冈市", 928 | "id": "421100" 929 | }, 930 | { 931 | "province": "湖北省", 932 | "name": "咸宁市", 933 | "id": "421200" 934 | }, 935 | { 936 | "province": "湖北省", 937 | "name": "随州市", 938 | "id": "421300" 939 | }, 940 | { 941 | "province": "湖北省", 942 | "name": "恩施土家族苗族自治州", 943 | "id": "422800" 944 | }, 945 | { 946 | "province": "湖北省", 947 | "name": "省直辖县级行政区划", 948 | "id": "429000" 949 | } 950 | ], 951 | "430000": [ 952 | { 953 | "province": "湖南省", 954 | "name": "长沙市", 955 | "id": "430100" 956 | }, 957 | { 958 | "province": "湖南省", 959 | "name": "株洲市", 960 | "id": "430200" 961 | }, 962 | { 963 | "province": "湖南省", 964 | "name": "湘潭市", 965 | "id": "430300" 966 | }, 967 | { 968 | "province": "湖南省", 969 | "name": "衡阳市", 970 | "id": "430400" 971 | }, 972 | { 973 | "province": "湖南省", 974 | "name": "邵阳市", 975 | "id": "430500" 976 | }, 977 | { 978 | "province": "湖南省", 979 | "name": "岳阳市", 980 | "id": "430600" 981 | }, 982 | { 983 | "province": "湖南省", 984 | "name": "常德市", 985 | "id": "430700" 986 | }, 987 | { 988 | "province": "湖南省", 989 | "name": "张家界市", 990 | "id": "430800" 991 | }, 992 | { 993 | "province": "湖南省", 994 | "name": "益阳市", 995 | "id": "430900" 996 | }, 997 | { 998 | "province": "湖南省", 999 | "name": "郴州市", 1000 | "id": "431000" 1001 | }, 1002 | { 1003 | "province": "湖南省", 1004 | "name": "永州市", 1005 | "id": "431100" 1006 | }, 1007 | { 1008 | "province": "湖南省", 1009 | "name": "怀化市", 1010 | "id": "431200" 1011 | }, 1012 | { 1013 | "province": "湖南省", 1014 | "name": "娄底市", 1015 | "id": "431300" 1016 | }, 1017 | { 1018 | "province": "湖南省", 1019 | "name": "湘西土家族苗族自治州", 1020 | "id": "433100" 1021 | } 1022 | ], 1023 | "440000": [ 1024 | { 1025 | "province": "广东省", 1026 | "name": "广州市", 1027 | "id": "440100" 1028 | }, 1029 | { 1030 | "province": "广东省", 1031 | "name": "韶关市", 1032 | "id": "440200" 1033 | }, 1034 | { 1035 | "province": "广东省", 1036 | "name": "深圳市", 1037 | "id": "440300" 1038 | }, 1039 | { 1040 | "province": "广东省", 1041 | "name": "珠海市", 1042 | "id": "440400" 1043 | }, 1044 | { 1045 | "province": "广东省", 1046 | "name": "汕头市", 1047 | "id": "440500" 1048 | }, 1049 | { 1050 | "province": "广东省", 1051 | "name": "佛山市", 1052 | "id": "440600" 1053 | }, 1054 | { 1055 | "province": "广东省", 1056 | "name": "江门市", 1057 | "id": "440700" 1058 | }, 1059 | { 1060 | "province": "广东省", 1061 | "name": "湛江市", 1062 | "id": "440800" 1063 | }, 1064 | { 1065 | "province": "广东省", 1066 | "name": "茂名市", 1067 | "id": "440900" 1068 | }, 1069 | { 1070 | "province": "广东省", 1071 | "name": "肇庆市", 1072 | "id": "441200" 1073 | }, 1074 | { 1075 | "province": "广东省", 1076 | "name": "惠州市", 1077 | "id": "441300" 1078 | }, 1079 | { 1080 | "province": "广东省", 1081 | "name": "梅州市", 1082 | "id": "441400" 1083 | }, 1084 | { 1085 | "province": "广东省", 1086 | "name": "汕尾市", 1087 | "id": "441500" 1088 | }, 1089 | { 1090 | "province": "广东省", 1091 | "name": "河源市", 1092 | "id": "441600" 1093 | }, 1094 | { 1095 | "province": "广东省", 1096 | "name": "阳江市", 1097 | "id": "441700" 1098 | }, 1099 | { 1100 | "province": "广东省", 1101 | "name": "清远市", 1102 | "id": "441800" 1103 | }, 1104 | { 1105 | "province": "广东省", 1106 | "name": "东莞市", 1107 | "id": "441900" 1108 | }, 1109 | { 1110 | "province": "广东省", 1111 | "name": "中山市", 1112 | "id": "442000" 1113 | }, 1114 | { 1115 | "province": "广东省", 1116 | "name": "潮州市", 1117 | "id": "445100" 1118 | }, 1119 | { 1120 | "province": "广东省", 1121 | "name": "揭阳市", 1122 | "id": "445200" 1123 | }, 1124 | { 1125 | "province": "广东省", 1126 | "name": "云浮市", 1127 | "id": "445300" 1128 | } 1129 | ], 1130 | "450000": [ 1131 | { 1132 | "province": "广西壮族自治区", 1133 | "name": "南宁市", 1134 | "id": "450100" 1135 | }, 1136 | { 1137 | "province": "广西壮族自治区", 1138 | "name": "柳州市", 1139 | "id": "450200" 1140 | }, 1141 | { 1142 | "province": "广西壮族自治区", 1143 | "name": "桂林市", 1144 | "id": "450300" 1145 | }, 1146 | { 1147 | "province": "广西壮族自治区", 1148 | "name": "梧州市", 1149 | "id": "450400" 1150 | }, 1151 | { 1152 | "province": "广西壮族自治区", 1153 | "name": "北海市", 1154 | "id": "450500" 1155 | }, 1156 | { 1157 | "province": "广西壮族自治区", 1158 | "name": "防城港市", 1159 | "id": "450600" 1160 | }, 1161 | { 1162 | "province": "广西壮族自治区", 1163 | "name": "钦州市", 1164 | "id": "450700" 1165 | }, 1166 | { 1167 | "province": "广西壮族自治区", 1168 | "name": "贵港市", 1169 | "id": "450800" 1170 | }, 1171 | { 1172 | "province": "广西壮族自治区", 1173 | "name": "玉林市", 1174 | "id": "450900" 1175 | }, 1176 | { 1177 | "province": "广西壮族自治区", 1178 | "name": "百色市", 1179 | "id": "451000" 1180 | }, 1181 | { 1182 | "province": "广西壮族自治区", 1183 | "name": "贺州市", 1184 | "id": "451100" 1185 | }, 1186 | { 1187 | "province": "广西壮族自治区", 1188 | "name": "河池市", 1189 | "id": "451200" 1190 | }, 1191 | { 1192 | "province": "广西壮族自治区", 1193 | "name": "来宾市", 1194 | "id": "451300" 1195 | }, 1196 | { 1197 | "province": "广西壮族自治区", 1198 | "name": "崇左市", 1199 | "id": "451400" 1200 | } 1201 | ], 1202 | "460000": [ 1203 | { 1204 | "province": "海南省", 1205 | "name": "海口市", 1206 | "id": "460100" 1207 | }, 1208 | { 1209 | "province": "海南省", 1210 | "name": "三亚市", 1211 | "id": "460200" 1212 | }, 1213 | { 1214 | "province": "海南省", 1215 | "name": "三沙市", 1216 | "id": "460300" 1217 | }, 1218 | { 1219 | "province": "海南省", 1220 | "name": "儋州市", 1221 | "id": "460400" 1222 | }, 1223 | { 1224 | "province": "海南省", 1225 | "name": "省直辖县级行政区划", 1226 | "id": "469000" 1227 | } 1228 | ], 1229 | "500000": [ 1230 | { 1231 | "province": "重庆市", 1232 | "name": "市辖区", 1233 | "id": "500100" 1234 | }, 1235 | { 1236 | "province": "重庆市", 1237 | "name": "县", 1238 | "id": "500200" 1239 | } 1240 | ], 1241 | "510000": [ 1242 | { 1243 | "province": "四川省", 1244 | "name": "成都市", 1245 | "id": "510100" 1246 | }, 1247 | { 1248 | "province": "四川省", 1249 | "name": "自贡市", 1250 | "id": "510300" 1251 | }, 1252 | { 1253 | "province": "四川省", 1254 | "name": "攀枝花市", 1255 | "id": "510400" 1256 | }, 1257 | { 1258 | "province": "四川省", 1259 | "name": "泸州市", 1260 | "id": "510500" 1261 | }, 1262 | { 1263 | "province": "四川省", 1264 | "name": "德阳市", 1265 | "id": "510600" 1266 | }, 1267 | { 1268 | "province": "四川省", 1269 | "name": "绵阳市", 1270 | "id": "510700" 1271 | }, 1272 | { 1273 | "province": "四川省", 1274 | "name": "广元市", 1275 | "id": "510800" 1276 | }, 1277 | { 1278 | "province": "四川省", 1279 | "name": "遂宁市", 1280 | "id": "510900" 1281 | }, 1282 | { 1283 | "province": "四川省", 1284 | "name": "内江市", 1285 | "id": "511000" 1286 | }, 1287 | { 1288 | "province": "四川省", 1289 | "name": "乐山市", 1290 | "id": "511100" 1291 | }, 1292 | { 1293 | "province": "四川省", 1294 | "name": "南充市", 1295 | "id": "511300" 1296 | }, 1297 | { 1298 | "province": "四川省", 1299 | "name": "眉山市", 1300 | "id": "511400" 1301 | }, 1302 | { 1303 | "province": "四川省", 1304 | "name": "宜宾市", 1305 | "id": "511500" 1306 | }, 1307 | { 1308 | "province": "四川省", 1309 | "name": "广安市", 1310 | "id": "511600" 1311 | }, 1312 | { 1313 | "province": "四川省", 1314 | "name": "达州市", 1315 | "id": "511700" 1316 | }, 1317 | { 1318 | "province": "四川省", 1319 | "name": "雅安市", 1320 | "id": "511800" 1321 | }, 1322 | { 1323 | "province": "四川省", 1324 | "name": "巴中市", 1325 | "id": "511900" 1326 | }, 1327 | { 1328 | "province": "四川省", 1329 | "name": "资阳市", 1330 | "id": "512000" 1331 | }, 1332 | { 1333 | "province": "四川省", 1334 | "name": "阿坝藏族羌族自治州", 1335 | "id": "513200" 1336 | }, 1337 | { 1338 | "province": "四川省", 1339 | "name": "甘孜藏族自治州", 1340 | "id": "513300" 1341 | }, 1342 | { 1343 | "province": "四川省", 1344 | "name": "凉山彝族自治州", 1345 | "id": "513400" 1346 | } 1347 | ], 1348 | "520000": [ 1349 | { 1350 | "province": "贵州省", 1351 | "name": "贵阳市", 1352 | "id": "520100" 1353 | }, 1354 | { 1355 | "province": "贵州省", 1356 | "name": "六盘水市", 1357 | "id": "520200" 1358 | }, 1359 | { 1360 | "province": "贵州省", 1361 | "name": "遵义市", 1362 | "id": "520300" 1363 | }, 1364 | { 1365 | "province": "贵州省", 1366 | "name": "安顺市", 1367 | "id": "520400" 1368 | }, 1369 | { 1370 | "province": "贵州省", 1371 | "name": "毕节市", 1372 | "id": "520500" 1373 | }, 1374 | { 1375 | "province": "贵州省", 1376 | "name": "铜仁市", 1377 | "id": "520600" 1378 | }, 1379 | { 1380 | "province": "贵州省", 1381 | "name": "黔西南布依族苗族自治州", 1382 | "id": "522300" 1383 | }, 1384 | { 1385 | "province": "贵州省", 1386 | "name": "黔东南苗族侗族自治州", 1387 | "id": "522600" 1388 | }, 1389 | { 1390 | "province": "贵州省", 1391 | "name": "黔南布依族苗族自治州", 1392 | "id": "522700" 1393 | } 1394 | ], 1395 | "530000": [ 1396 | { 1397 | "province": "云南省", 1398 | "name": "昆明市", 1399 | "id": "530100" 1400 | }, 1401 | { 1402 | "province": "云南省", 1403 | "name": "曲靖市", 1404 | "id": "530300" 1405 | }, 1406 | { 1407 | "province": "云南省", 1408 | "name": "玉溪市", 1409 | "id": "530400" 1410 | }, 1411 | { 1412 | "province": "云南省", 1413 | "name": "保山市", 1414 | "id": "530500" 1415 | }, 1416 | { 1417 | "province": "云南省", 1418 | "name": "昭通市", 1419 | "id": "530600" 1420 | }, 1421 | { 1422 | "province": "云南省", 1423 | "name": "丽江市", 1424 | "id": "530700" 1425 | }, 1426 | { 1427 | "province": "云南省", 1428 | "name": "普洱市", 1429 | "id": "530800" 1430 | }, 1431 | { 1432 | "province": "云南省", 1433 | "name": "临沧市", 1434 | "id": "530900" 1435 | }, 1436 | { 1437 | "province": "云南省", 1438 | "name": "楚雄彝族自治州", 1439 | "id": "532300" 1440 | }, 1441 | { 1442 | "province": "云南省", 1443 | "name": "红河哈尼族彝族自治州", 1444 | "id": "532500" 1445 | }, 1446 | { 1447 | "province": "云南省", 1448 | "name": "文山壮族苗族自治州", 1449 | "id": "532600" 1450 | }, 1451 | { 1452 | "province": "云南省", 1453 | "name": "西双版纳傣族自治州", 1454 | "id": "532800" 1455 | }, 1456 | { 1457 | "province": "云南省", 1458 | "name": "大理白族自治州", 1459 | "id": "532900" 1460 | }, 1461 | { 1462 | "province": "云南省", 1463 | "name": "德宏傣族景颇族自治州", 1464 | "id": "533100" 1465 | }, 1466 | { 1467 | "province": "云南省", 1468 | "name": "怒江傈僳族自治州", 1469 | "id": "533300" 1470 | }, 1471 | { 1472 | "province": "云南省", 1473 | "name": "迪庆藏族自治州", 1474 | "id": "533400" 1475 | } 1476 | ], 1477 | "540000": [ 1478 | { 1479 | "province": "西藏自治区", 1480 | "name": "拉萨市", 1481 | "id": "540100" 1482 | }, 1483 | { 1484 | "province": "西藏自治区", 1485 | "name": "日喀则市", 1486 | "id": "540200" 1487 | }, 1488 | { 1489 | "province": "西藏自治区", 1490 | "name": "昌都市", 1491 | "id": "540300" 1492 | }, 1493 | { 1494 | "province": "西藏自治区", 1495 | "name": "林芝市", 1496 | "id": "540400" 1497 | }, 1498 | { 1499 | "province": "西藏自治区", 1500 | "name": "山南市", 1501 | "id": "540500" 1502 | }, 1503 | { 1504 | "province": "西藏自治区", 1505 | "name": "那曲地区", 1506 | "id": "542400" 1507 | }, 1508 | { 1509 | "province": "西藏自治区", 1510 | "name": "阿里地区", 1511 | "id": "542500" 1512 | } 1513 | ], 1514 | "610000": [ 1515 | { 1516 | "province": "陕西省", 1517 | "name": "西安市", 1518 | "id": "610100" 1519 | }, 1520 | { 1521 | "province": "陕西省", 1522 | "name": "铜川市", 1523 | "id": "610200" 1524 | }, 1525 | { 1526 | "province": "陕西省", 1527 | "name": "宝鸡市", 1528 | "id": "610300" 1529 | }, 1530 | { 1531 | "province": "陕西省", 1532 | "name": "咸阳市", 1533 | "id": "610400" 1534 | }, 1535 | { 1536 | "province": "陕西省", 1537 | "name": "渭南市", 1538 | "id": "610500" 1539 | }, 1540 | { 1541 | "province": "陕西省", 1542 | "name": "延安市", 1543 | "id": "610600" 1544 | }, 1545 | { 1546 | "province": "陕西省", 1547 | "name": "汉中市", 1548 | "id": "610700" 1549 | }, 1550 | { 1551 | "province": "陕西省", 1552 | "name": "榆林市", 1553 | "id": "610800" 1554 | }, 1555 | { 1556 | "province": "陕西省", 1557 | "name": "安康市", 1558 | "id": "610900" 1559 | }, 1560 | { 1561 | "province": "陕西省", 1562 | "name": "商洛市", 1563 | "id": "611000" 1564 | } 1565 | ], 1566 | "620000": [ 1567 | { 1568 | "province": "甘肃省", 1569 | "name": "兰州市", 1570 | "id": "620100" 1571 | }, 1572 | { 1573 | "province": "甘肃省", 1574 | "name": "嘉峪关市", 1575 | "id": "620200" 1576 | }, 1577 | { 1578 | "province": "甘肃省", 1579 | "name": "金昌市", 1580 | "id": "620300" 1581 | }, 1582 | { 1583 | "province": "甘肃省", 1584 | "name": "白银市", 1585 | "id": "620400" 1586 | }, 1587 | { 1588 | "province": "甘肃省", 1589 | "name": "天水市", 1590 | "id": "620500" 1591 | }, 1592 | { 1593 | "province": "甘肃省", 1594 | "name": "武威市", 1595 | "id": "620600" 1596 | }, 1597 | { 1598 | "province": "甘肃省", 1599 | "name": "张掖市", 1600 | "id": "620700" 1601 | }, 1602 | { 1603 | "province": "甘肃省", 1604 | "name": "平凉市", 1605 | "id": "620800" 1606 | }, 1607 | { 1608 | "province": "甘肃省", 1609 | "name": "酒泉市", 1610 | "id": "620900" 1611 | }, 1612 | { 1613 | "province": "甘肃省", 1614 | "name": "庆阳市", 1615 | "id": "621000" 1616 | }, 1617 | { 1618 | "province": "甘肃省", 1619 | "name": "定西市", 1620 | "id": "621100" 1621 | }, 1622 | { 1623 | "province": "甘肃省", 1624 | "name": "陇南市", 1625 | "id": "621200" 1626 | }, 1627 | { 1628 | "province": "甘肃省", 1629 | "name": "临夏回族自治州", 1630 | "id": "622900" 1631 | }, 1632 | { 1633 | "province": "甘肃省", 1634 | "name": "甘南藏族自治州", 1635 | "id": "623000" 1636 | } 1637 | ], 1638 | "630000": [ 1639 | { 1640 | "province": "青海省", 1641 | "name": "西宁市", 1642 | "id": "630100" 1643 | }, 1644 | { 1645 | "province": "青海省", 1646 | "name": "海东市", 1647 | "id": "630200" 1648 | }, 1649 | { 1650 | "province": "青海省", 1651 | "name": "海北藏族自治州", 1652 | "id": "632200" 1653 | }, 1654 | { 1655 | "province": "青海省", 1656 | "name": "黄南藏族自治州", 1657 | "id": "632300" 1658 | }, 1659 | { 1660 | "province": "青海省", 1661 | "name": "海南藏族自治州", 1662 | "id": "632500" 1663 | }, 1664 | { 1665 | "province": "青海省", 1666 | "name": "果洛藏族自治州", 1667 | "id": "632600" 1668 | }, 1669 | { 1670 | "province": "青海省", 1671 | "name": "玉树藏族自治州", 1672 | "id": "632700" 1673 | }, 1674 | { 1675 | "province": "青海省", 1676 | "name": "海西蒙古族藏族自治州", 1677 | "id": "632800" 1678 | } 1679 | ], 1680 | "640000": [ 1681 | { 1682 | "province": "宁夏回族自治区", 1683 | "name": "银川市", 1684 | "id": "640100" 1685 | }, 1686 | { 1687 | "province": "宁夏回族自治区", 1688 | "name": "石嘴山市", 1689 | "id": "640200" 1690 | }, 1691 | { 1692 | "province": "宁夏回族自治区", 1693 | "name": "吴忠市", 1694 | "id": "640300" 1695 | }, 1696 | { 1697 | "province": "宁夏回族自治区", 1698 | "name": "固原市", 1699 | "id": "640400" 1700 | }, 1701 | { 1702 | "province": "宁夏回族自治区", 1703 | "name": "中卫市", 1704 | "id": "640500" 1705 | } 1706 | ], 1707 | "650000": [ 1708 | { 1709 | "province": "新疆维吾尔自治区", 1710 | "name": "乌鲁木齐市", 1711 | "id": "650100" 1712 | }, 1713 | { 1714 | "province": "新疆维吾尔自治区", 1715 | "name": "克拉玛依市", 1716 | "id": "650200" 1717 | }, 1718 | { 1719 | "province": "新疆维吾尔自治区", 1720 | "name": "吐鲁番市", 1721 | "id": "650400" 1722 | }, 1723 | { 1724 | "province": "新疆维吾尔自治区", 1725 | "name": "哈密市", 1726 | "id": "650500" 1727 | }, 1728 | { 1729 | "province": "新疆维吾尔自治区", 1730 | "name": "昌吉回族自治州", 1731 | "id": "652300" 1732 | }, 1733 | { 1734 | "province": "新疆维吾尔自治区", 1735 | "name": "博尔塔拉蒙古自治州", 1736 | "id": "652700" 1737 | }, 1738 | { 1739 | "province": "新疆维吾尔自治区", 1740 | "name": "巴音郭楞蒙古自治州", 1741 | "id": "652800" 1742 | }, 1743 | { 1744 | "province": "新疆维吾尔自治区", 1745 | "name": "阿克苏地区", 1746 | "id": "652900" 1747 | }, 1748 | { 1749 | "province": "新疆维吾尔自治区", 1750 | "name": "克孜勒苏柯尔克孜自治州", 1751 | "id": "653000" 1752 | }, 1753 | { 1754 | "province": "新疆维吾尔自治区", 1755 | "name": "喀什地区", 1756 | "id": "653100" 1757 | }, 1758 | { 1759 | "province": "新疆维吾尔自治区", 1760 | "name": "和田地区", 1761 | "id": "653200" 1762 | }, 1763 | { 1764 | "province": "新疆维吾尔自治区", 1765 | "name": "伊犁哈萨克自治州", 1766 | "id": "654000" 1767 | }, 1768 | { 1769 | "province": "新疆维吾尔自治区", 1770 | "name": "塔城地区", 1771 | "id": "654200" 1772 | }, 1773 | { 1774 | "province": "新疆维吾尔自治区", 1775 | "name": "阿勒泰地区", 1776 | "id": "654300" 1777 | }, 1778 | { 1779 | "province": "新疆维吾尔自治区", 1780 | "name": "自治区直辖县级行政区划", 1781 | "id": "659000" 1782 | } 1783 | ] 1784 | } -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // YLAwesomePicker 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. 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 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePicker/province.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "name": "北京市", 3 | "id": "110000" 4 | }, { 5 | "name": "天津市", 6 | "id": "120000" 7 | }, { 8 | "name": "河北省", 9 | "id": "130000" 10 | }, { 11 | "name": "山西省", 12 | "id": "140000" 13 | }, { 14 | "name": "内蒙古自治区", 15 | "id": "150000" 16 | }, { 17 | "name": "辽宁省", 18 | "id": "210000" 19 | }, { 20 | "name": "吉林省", 21 | "id": "220000" 22 | }, { 23 | "name": "黑龙江省", 24 | "id": "230000" 25 | }, { 26 | "name": "上海市", 27 | "id": "310000" 28 | }, { 29 | "name": "江苏省", 30 | "id": "320000" 31 | }, { 32 | "name": "浙江省", 33 | "id": "330000" 34 | }, { 35 | "name": "安徽省", 36 | "id": "340000" 37 | }, { 38 | "name": "福建省", 39 | "id": "350000" 40 | }, { 41 | "name": "江西省", 42 | "id": "360000" 43 | }, { 44 | "name": "山东省", 45 | "id": "370000" 46 | }, { 47 | "name": "河南省", 48 | "id": "410000" 49 | }, { 50 | "name": "湖北省", 51 | "id": "420000" 52 | }, { 53 | "name": "湖南省", 54 | "id": "430000" 55 | }, { 56 | "name": "广东省", 57 | "id": "440000" 58 | }, { 59 | "name": "广西壮族自治区", 60 | "id": "450000" 61 | }, { 62 | "name": "海南省", 63 | "id": "460000" 64 | }, { 65 | "name": "重庆市", 66 | "id": "500000" 67 | }, { 68 | "name": "四川省", 69 | "id": "510000" 70 | }, { 71 | "name": "贵州省", 72 | "id": "520000" 73 | }, { 74 | "name": "云南省", 75 | "id": "530000" 76 | }, { 77 | "name": "西藏自治区", 78 | "id": "540000" 79 | }, { 80 | "name": "陕西省", 81 | "id": "610000" 82 | }, { 83 | "name": "甘肃省", 84 | "id": "620000" 85 | }, { 86 | "name": "青海省", 87 | "id": "630000" 88 | }, { 89 | "name": "宁夏回族自治区", 90 | "id": "640000" 91 | }, { 92 | "name": "新疆维吾尔自治区", 93 | "id": "650000" 94 | }, { 95 | "name": "台湾省", 96 | "id": "710000" 97 | }, { 98 | "name": "香港特别行政区", 99 | "id": "810000" 100 | }, { 101 | "name": "澳门特别行政区", 102 | "id": "820000" 103 | }] 104 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePickerTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePickerTests/YLAwesomePickerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // YLAwesomePickerTests.m 3 | // YLAwesomePickerTests 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YLAwesomePickerTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation YLAwesomePickerTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePickerUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /YLAwesomePicker/YLAwesomePickerUITests/YLAwesomePickerUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // YLAwesomePickerUITests.m 3 | // YLAwesomePickerUITests 4 | // 5 | // Created by TK-001289 on 2017/6/15. 6 | // Copyright © 2017年 TK-001289. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YLAwesomePickerUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation YLAwesomePickerUITests 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 | -------------------------------------------------------------------------------- /picker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ApesTalk/YLAwesomePicker/d1bd07140a34659c80c9889940303ea5a34a6f69/picker.gif --------------------------------------------------------------------------------