├── .gitattributes
├── DSSettingDataSource
├── Image
│ └── demo.png
├── DSSettingDataSource
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── 交通报销.imageset
│ │ │ ├── 交通报销@2x.png
│ │ │ └── Contents.json
│ │ ├── 人事申请.imageset
│ │ │ ├── 人事申请@2x.png
│ │ │ └── Contents.json
│ │ ├── 付款申请.imageset
│ │ │ ├── 付款申请@2x.png
│ │ │ └── Contents.json
│ │ ├── 休假申请.imageset
│ │ │ ├── 休假申请@2x.png
│ │ │ └── Contents.json
│ │ ├── 借款申请.imageset
│ │ │ ├── 借款申请@2x.png
│ │ │ └── Contents.json
│ │ ├── 打卡补签.imageset
│ │ │ ├── 打卡补签@2x.png
│ │ │ └── Contents.json
│ │ ├── 电脑故障.imageset
│ │ │ ├── 电脑故障@2x.png
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── ViewController.h
│ ├── AppDelegate.h
│ ├── main.m
│ ├── DSSettingDataSource
│ │ ├── DSSettingDataSource.h
│ │ ├── DSSettingCell.h
│ │ ├── DSSettingCellProtocol.h
│ │ ├── DSSettingItem.m
│ │ ├── DSSettingCell.m
│ │ ├── DSSettingItem.h
│ │ └── DSSettingDataSource.m
│ ├── Info.plist
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ ├── AppDelegate.m
│ └── ViewController.m
├── DSSettingDataSource.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── project.pbxproj
├── DSSettingDataSourceTests
│ ├── Info.plist
│ └── DSSettingDataSourceTests.m
└── DSSettingDataSourceUITests
│ ├── Info.plist
│ └── DSSettingDataSourceUITests.m
├── LICENSE
├── .gitignore
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/DSSettingDataSource/Image/demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/Image/demo.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/交通报销.imageset/交通报销@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/交通报销.imageset/交通报销@2x.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/人事申请.imageset/人事申请@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/人事申请.imageset/人事申请@2x.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/付款申请.imageset/付款申请@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/付款申请.imageset/付款申请@2x.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/休假申请.imageset/休假申请@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/休假申请.imageset/休假申请@2x.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/借款申请.imageset/借款申请@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/借款申请.imageset/借款申请@2x.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/打卡补签.imageset/打卡补签@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/打卡补签.imageset/打卡补签@2x.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/电脑故障.imageset/电脑故障@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloAda/DSSettingDataSource/HEAD/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/电脑故障.imageset/电脑故障@2x.png
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. 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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. 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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/交通报销.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "交通报销@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/人事申请.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "人事申请@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/付款申请.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "付款申请@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/休假申请.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "休假申请@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/借款申请.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "借款申请@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/打卡补签.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "打卡补签@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/电脑故障.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "电脑故障@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource.h:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingDataSource.h
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "DSSettingCell.h"
12 | #import "DSSettingCellProtocol.h"
13 | @interface DSSettingDataSource : NSObject
14 |
15 | //初始化
16 | - (instancetype)initWithItems:(NSArray *)items;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource/DSSettingCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingCell.h
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "DSSettingItem.h"
11 | #import "DSSettingCellProtocol.h"
12 | @interface DSSettingCell : UITableViewCell
13 |
14 | //初始化
15 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier;
16 |
17 | //设置数据
18 | - (void)refreshData:(DSSettingItem *)item tableView:(UITableView *)tableView;
19 |
20 | @end
21 |
22 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource/DSSettingCellProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingCellProtocol.h
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/5/30.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @class DSSettingItem;
13 | @protocol DSSettingCellProtocol
14 |
15 | //初始化方法
16 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier;
17 |
18 | @optional
19 | //传数据用这个
20 | - (void)refreshData:(DSSettingItem *)item tableView:(UITableView *)tableView;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSourceTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSourceUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 hello Ada
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.
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSourceTests/DSSettingDataSourceTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingDataSourceTests.m
3 | // DSSettingDataSourceTests
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface DSSettingDataSourceTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation DSSettingDataSourceTests
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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource/DSSettingItem.m:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingItem.m
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import "DSSettingItem.h"
10 |
11 | @implementation DSSettingItem
12 |
13 | + (instancetype)itemWithtype:(DSSettingItemType)type title:(NSString *)title icon:(NSString *)icon {
14 | DSSettingItem *item = [[DSSettingItem alloc] init];
15 | item.type = type;
16 | item.title = title;
17 | item.icon = icon;
18 |
19 | return item;
20 | }
21 |
22 |
23 | + (instancetype)itemWithtype:(DSSettingItemType)type cellClassName:(NSString *)cellClassName {
24 | DSSettingItem *item = [[DSSettingItem alloc] init];
25 | item.type = type;
26 | item.cellClassName = cellClassName;
27 | return item;
28 | }
29 |
30 |
31 | - (instancetype)init
32 | {
33 | self = [super init];
34 | if (self) {
35 | self.isShowAccessory = YES;
36 | self.sepLeftEdge = 15;
37 | self.rowHeight = 44;
38 | self.isForbidSelect = NO;
39 | }
40 | return self;
41 | }
42 | @end
43 |
44 | @implementation DSSettingGroup
45 |
46 | - (instancetype)init
47 | {
48 | self = [super init];
49 | if (self) {
50 | _items = [[NSMutableArray alloc] init];
51 | }
52 | return self;
53 | }
54 | @end
55 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSourceUITests/DSSettingDataSourceUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingDataSourceUITests.m
3 | // DSSettingDataSourceUITests
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface DSSettingDataSourceUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation DSSettingDataSourceUITests
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 |
--------------------------------------------------------------------------------
/.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 | *.DS_Store
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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource/DSSettingCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingCell.m
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import "DSSettingCell.h"
10 |
11 | @interface DSSettingCell ()
12 | //数据
13 | @property (nonatomic, strong) DSSettingItem *item;
14 | //switch按钮
15 | @property (nonatomic, strong) UISwitch *switchBtn;
16 |
17 | @end
18 |
19 | @implementation DSSettingCell
20 |
21 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
22 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
23 | if (self) {
24 | self.selectionStyle = UITableViewCellSelectionStyleNone;
25 | }
26 | return self;
27 | }
28 |
29 |
30 | - (void)refreshData:(DSSettingItem *)item tableView:(UITableView *)tableView {
31 | _item = item;
32 | self.imageView.image = [UIImage imageNamed:item.icon];
33 | self.textLabel.text = item.title;
34 |
35 | switch (item.type) {
36 | case DSSettingItemTypeNone: {
37 | self.detailTextLabel.text = @"";
38 | self.accessoryView = nil;
39 | }
40 | break;
41 | case DSSettingItemTypeDetial: {
42 | self.detailTextLabel.text = item.details;
43 | self.accessoryView = nil;
44 | }
45 | break;
46 | case DSSettingItemTypeSwitch: {
47 | if (!_switchBtn) {
48 | _switchBtn = [[UISwitch alloc] init];
49 | _switchBtn.on = item.isSwitchOn;
50 | [_switchBtn addTarget:self action:@selector(switchClickEvent:) forControlEvents:UIControlEventTouchUpInside];
51 | self.detailTextLabel.text = @"";
52 | self.accessoryView = _switchBtn;
53 | }
54 | }
55 | break;
56 | default:
57 | break;
58 | }
59 |
60 | }
61 |
62 | #pragma mark --- Switch 响应事件 ---
63 |
64 | - (void)switchClickEvent:(UISwitch *)switchBtn {
65 |
66 | if (self.item.switchClick && self.item.type == DSSettingItemTypeSwitch) {
67 | self.item.switchClick(switchBtn.on);
68 | }
69 | }
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. 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 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource/DSSettingItem.h:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingItem.h
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | //Switch回调
13 | typedef void(^SwitchClickBlock)(BOOL on);
14 | //点击cell回调
15 | typedef void(^DidSelectBlock)(void);
16 |
17 | typedef NS_ENUM(NSInteger, DSSettingItemType) {
18 | DSSettingItemTypeNone, // 不显示任何在右边
19 | DSSettingItemTypeCustom, // 自定义Cell
20 | DSSettingItemTypeDetial, // 显示详情在右边
21 | DSSettingItemTypeSwitch // 显示Switch在右边
22 | };
23 |
24 | //每个Cell的数据模型
25 | @interface DSSettingItem : NSObject
26 |
27 | //////////// 通用的属性 ////////
28 |
29 | //Cell类型
30 | @property (nonatomic, assign) DSSettingItemType type;
31 |
32 | //Cell点击事件名
33 | @property (nonatomic, copy) NSString *cellActionName;
34 |
35 | /*
36 | 点击Cell回调
37 | 可以采用传入cellActionName的方式实现,也可以直接使用block;
38 | 如果有block,则优先Block,不去执行cellActionName
39 | */
40 | @property (nonatomic, copy) DidSelectBlock didSelectBlock;
41 |
42 | //显示箭头 '>' 默认YES
43 | @property (nonatomic, assign) BOOL isShowAccessory;
44 |
45 | //cell禁止点击 默认为NO 即可以点
46 | @property (nonatomic, assign) BOOL isForbidSelect;
47 |
48 | //分割线距离左边的距离 默认15 需要将separatorStyle设置为UITableViewCellSeparatorStyleNone
49 | @property (nonatomic, assign) CGFloat sepLeftEdge;
50 |
51 | //行高 默认44
52 | @property (nonatomic, assign) CGFloat rowHeight;
53 |
54 | //////////// 已提供的几种Cell的配置 ////////////////
55 |
56 | //图标
57 | @property (nonatomic, copy) NSString *icon;
58 |
59 | //标题
60 | @property (nonatomic, copy) NSString *title;
61 |
62 | //详情 只有在DSSettingItemTypeDetial类型才有效
63 | @property (nonatomic, copy) NSString *details;
64 |
65 | //点击Switch事件
66 | @property (nonatomic, copy) SwitchClickBlock switchClick;
67 |
68 | //Switch状态 默认NO
69 | @property (nonatomic, assign) BOOL isSwitchOn;
70 |
71 |
72 | /////////////////// 自定义cell //////////////////
73 |
74 | //自定义Cell名称
75 | @property (nonatomic, copy) NSString *cellClassName;
76 |
77 | //自定义Cell数据
78 | @property (nonatomic, strong) id data;
79 |
80 | /**
81 | 初始化方法
82 |
83 | @param type 类型
84 | @param title 标题
85 | @param icon 图片名称
86 | @return 实例
87 | */
88 | //初始化方法
89 | + (instancetype)itemWithtype:(DSSettingItemType)type title:(NSString *)title icon:(NSString *)icon;
90 |
91 |
92 | /**
93 | 初始化方法
94 |
95 | @param type 类型
96 | @param cellClassName 自定义cell类名
97 | @return 实例
98 | */
99 | + (instancetype)itemWithtype:(DSSettingItemType)type cellClassName:(NSString *)cellClassName;
100 |
101 | @end
102 |
103 |
104 |
105 |
106 | //只有TableView.style为Group在使用
107 |
108 | //一组Cell的数据模型
109 | @interface DSSettingGroup : NSObject
110 |
111 | //Cell模型集合
112 | @property (nonatomic, strong) NSMutableArray *items;
113 | //头部标题
114 | @property (nonatomic, copy) NSString *headTitle;
115 | //尾部标题
116 | @property (nonatomic, copy) NSString *footTitle;
117 | //以后有需求在写
118 | ////头部高度
119 | //@property (nonatomic, assign) CGFloat headHeight;
120 | ////尾部高度
121 | //@property (nonatomic, assign) CGFloat footHeight;
122 |
123 | @end
124 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DSSettingDataSource
2 |
3 | ### 方便构建一个设置界面,只需要设置一下数据源,不需要继承。
4 |
5 | 
6 |
7 |
8 | ### 使用如下:
9 |
10 | ###### `#import "DSSettingDataSource.h"`
11 |
12 | ```
13 | //如果 tableView.style 为group
14 |
15 | {
16 | DSSettingGroup *group = [[DSSettingGroup alloc] init];
17 |
18 | {
19 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeSwitch title:@"打卡补签" icon:@"打卡补签"];
20 | item.didSelectBlock = ^{
21 | //todo
22 | };
23 | item.isSwitchOn = YES;
24 | item.switchClick = ^(BOOL on) {
25 | //todo
26 | };
27 | [group.items addObject:item];
28 |
29 | }
30 | {
31 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeDetial title:@"休假申请" icon:@"休假申请"];
32 | item.details = @"请假、调休";
33 | item.didSelectBlock = ^{
34 | //todo
35 | };
36 | [group.items addObject:item];
37 |
38 | }
39 | {
40 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeNone title:@"人事申请" icon:@"人事申请"];
41 | item.didSelectBlock = ^{
42 | //todo
43 | };
44 | [group.items addObject:item];
45 |
46 | }
47 | group.headTitle = @"人力资源部";
48 | group.footTitle = @"为您提供便利服务";
49 | [_array addObject:group];
50 | }
51 |
52 | {
53 | DSSettingGroup *group = [[DSSettingGroup alloc] init];
54 | {
55 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeNone title:@"电脑故障" icon:@"电脑故障"];
56 | item.cellActionName = @"computerFailure";
57 | item.rowHeight = 60;
58 | [group.items addObject:item];
59 | }
60 |
61 | group.headTitle = @"技术支持";
62 | [_array addObject:group];
63 | }
64 |
65 | _dataSource = [[DSSettingDataSource alloc] initWithItems:_array];
66 |
67 | self.tableView.dataSource = _dataSource;
68 | self.tableView.delegate = _dataSource;
69 |
70 | ```
71 |
72 | ```
73 | /*
74 | 如果 tableView.style 为Plain 则不需要使用DSSettingGroup
75 | 直接将DSSettingItem 添加到数据源
76 | */
77 |
78 | {
79 | DSSettingItem *item = [DSSettingItem itemWithTitle:@"付款申请" icon:@"付款申请" type:DSSettingItemTypeArrow];
80 | item.didSelectBlock = ^{
81 | //todo
82 | };
83 | [_array addObject:item];
84 | }
85 | {
86 | DSSettingItem *item = [DSSettingItem itemWithTitle:@"交通报销" icon:@"交通报销" type:DSSettingItemTypeArrow];
87 | item.didSelectBlock = ^{
88 | //todo
89 | };
90 | [_array addObject:item];
91 |
92 | }
93 | _dataSource = [[DSSettingDataSource alloc] initWithItems:_array];
94 |
95 | self.tableView.dataSource = _dataSource;
96 | self.tableView.delegate = _dataSource;
97 | ```
98 |
99 | ```
100 | 自定义Cell的时候,Cell遵循DSSettingCellProtocol协议
101 | 实现协议方法即可
102 | ```
103 |
104 | #### 目前支持
105 | - 2018.05.30
106 | - 支持自定义Cell,点击事件可选择Block或任意自定义方法
107 | - 增加禁止Cell点击,分割线距左边距离,自定义行高
108 | - 2018.04.24
109 | - 提供一个 默认Cell支持右边带有Switch按钮
110 |
111 | #### 有使用问题可以 [issues](https://github.com/helloAda/DSSettingDataSource/issues)
112 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "DSSettingDataSource.h"
11 |
12 |
13 | @interface ViewController ()
14 |
15 | @property (nonatomic, strong) UITableView *tableView;
16 |
17 | @property (nonatomic, strong) DSSettingDataSource *dataSource;
18 |
19 | @property (nonatomic, strong) NSMutableArray *array;
20 |
21 | @end
22 |
23 | @implementation ViewController
24 |
25 | - (void)viewDidLoad {
26 | [super viewDidLoad];
27 | _array = [[NSMutableArray alloc] init];
28 | [self setData];
29 | [self setupUI];
30 | }
31 |
32 | - (void)setData {
33 | {
34 | DSSettingGroup *group = [[DSSettingGroup alloc] init];
35 |
36 | {
37 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeSwitch title:@"打卡补签" icon:@"打卡补签"];
38 | item.didSelectBlock = ^{
39 | NSLog(@"打卡补签");
40 | };
41 | item.isSwitchOn = YES;
42 | item.switchClick = ^(BOOL on) {
43 | NSLog(@"switch %d",on);
44 | };
45 | [group.items addObject:item];
46 |
47 | }
48 | {
49 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeDetial title:@"休假申请" icon:@"休假申请"];
50 | item.details = @"请假、调休";
51 | item.didSelectBlock = ^{
52 | NSLog(@"休假申请");
53 | };
54 | [group.items addObject:item];
55 |
56 | }
57 | {
58 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeNone title:@"人事申请" icon:@"人事申请"];
59 | item.didSelectBlock = ^{
60 | NSLog(@"人事申请");
61 | };
62 | [group.items addObject:item];
63 |
64 | }
65 | group.headTitle = @"人力资源部";
66 | group.footTitle = @"为您提供便利服务";
67 | [_array addObject:group];
68 | }
69 |
70 | {
71 | DSSettingGroup *group = [[DSSettingGroup alloc] init];
72 |
73 | {
74 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeNone title:@"付款申请" icon:@"付款申请"];
75 | item.didSelectBlock = ^{
76 | NSLog(@"付款申请");
77 | };
78 | [group.items addObject:item];
79 |
80 | }
81 | {
82 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeNone title:@"交通报销" icon:@"交通报销"];
83 |
84 | item.didSelectBlock = ^{
85 | NSLog(@"交通报销");
86 | };
87 | [group.items addObject:item];
88 |
89 | }
90 | {
91 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeDetial title:@"借款申请" icon:@"借款申请"];
92 | item.details = @"额度50000元";
93 | item.isForbidSelect = YES; //禁止点击
94 | item.didSelectBlock = ^{
95 | NSLog(@"借款申请");
96 | };
97 | [group.items addObject:item];
98 |
99 | }
100 | group.headTitle = @"财务部";
101 | group.footTitle = @"为您提供便利服务";
102 | [_array addObject:group];
103 | }
104 |
105 | {
106 | DSSettingGroup *group = [[DSSettingGroup alloc] init];
107 | {
108 | DSSettingItem *item = [DSSettingItem itemWithtype:DSSettingItemTypeNone title:@"电脑故障" icon:@"电脑故障"];
109 | item.cellActionName = @"computerFailure";
110 | item.rowHeight = 60;
111 | [group.items addObject:item];
112 | }
113 |
114 | group.headTitle = @"技术支持";
115 | [_array addObject:group];
116 | }
117 | self.dataSource = [[DSSettingDataSource alloc] initWithItems:_array];
118 |
119 |
120 | }
121 |
122 | - (void)setupUI {
123 |
124 | self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
125 | self.tableView.dataSource = self.dataSource;
126 | self.tableView.delegate = self.dataSource;
127 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
128 | [self.view addSubview:self.tableView];
129 |
130 | UILabel *headView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 100)];
131 | headView.backgroundColor = [UIColor whiteColor];
132 | headView.text = @"HeadView";
133 | headView.font = [UIFont boldSystemFontOfSize:30.0f];
134 | headView.textAlignment = NSTextAlignmentCenter;
135 | self.tableView.tableHeaderView = headView;
136 |
137 | }
138 |
139 | #pragma mark -- Cell Action --
140 |
141 | //电脑故障点击
142 | - (void)computerFailure {
143 | NSLog(@"电脑故障");
144 | }
145 |
146 | @end
147 |
148 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource/DSSettingDataSource.m:
--------------------------------------------------------------------------------
1 | //
2 | // DSSettingDataSource.m
3 | // DSSettingDataSource
4 | //
5 | // Created by HelloAda on 2018/4/24.
6 | // Copyright © 2018年 HelloAda. All rights reserved.
7 | //
8 |
9 | #import "DSSettingDataSource.h"
10 |
11 | #define D_SuppressPerformSelectorLeakWarning(Stuff) \
12 | do { \
13 | _Pragma("clang diagnostic push") \
14 | _Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
15 | Stuff; \
16 | _Pragma("clang diagnostic pop") \
17 | } while (0)
18 |
19 | @interface DSSettingDataSource ()
20 | //数据源
21 | @property (nonatomic, strong) NSArray *items;
22 |
23 | @end
24 | //默认的Cell类名
25 | static NSString *DefaultTableCell = @"DSSettingCell";
26 |
27 | @implementation DSSettingDataSource
28 |
29 | - (instancetype)initWithItems:(NSArray *)items{
30 | self = [super init];
31 | if (self) {
32 | self.items = items;
33 | }
34 | return self;
35 | }
36 |
37 | #pragma mark --- UITableViewDataSource
38 |
39 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
40 | return [self itemCountAtIndexPath:section tableView:tableView];
41 | }
42 |
43 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
44 | if (tableView.style == UITableViewStyleGrouped) {
45 | return self.items.count;
46 | } else {
47 | return 1;
48 | }
49 | }
50 |
51 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
52 | DSSettingItem *item = [self itemAtIndexPath:indexPath tableView:tableView];
53 | UITableViewCell *cell = [self configCellWithItem:item cellForRowAtIndexPath:indexPath tableView:tableView];
54 | return cell;
55 | }
56 |
57 | #pragma mark --- UITableViewDelegate
58 |
59 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
60 | DSSettingItem *item = [self itemAtIndexPath:indexPath tableView:tableView];
61 | //允许点击
62 | if (!item.isForbidSelect) {
63 | //优先执行block
64 | if (item.didSelectBlock) {
65 | item.didSelectBlock();
66 | } else {
67 | UIViewController *vc = [self findViewControllerWithTableView:tableView];
68 | NSString *actionName = item.cellActionName;
69 | if (actionName.length) {
70 | SEL sel = NSSelectorFromString(actionName);
71 | UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
72 | D_SuppressPerformSelectorLeakWarning([vc performSelector:sel withObject:cell]);
73 | }
74 | }
75 | }
76 | }
77 |
78 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
79 | DSSettingItem *item = [self itemAtIndexPath:indexPath tableView:tableView];
80 | return item.rowHeight;
81 | }
82 |
83 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
84 | if (tableView.style == UITableViewStyleGrouped) {
85 | DSSettingGroup *group = self.items[section];
86 | return group.headTitle;
87 | }
88 | return nil;
89 | }
90 |
91 | - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {
92 | if (tableView.style == UITableViewStyleGrouped) {
93 | DSSettingGroup *group = self.items[section];
94 | return group.footTitle;
95 | }
96 | return nil;
97 | }
98 |
99 |
100 | #pragma mark --- 私有方法 ---
101 |
102 | //获取数据源
103 | - (id)itemAtIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView {
104 | if (tableView.style == UITableViewStyleGrouped) {
105 | DSSettingGroup *group = self.items[indexPath.section];
106 | return group.items[indexPath.row];
107 | } else {
108 | return self.items[indexPath.row];
109 | }
110 | }
111 |
112 | //每个组里cell的数量
113 | - (NSInteger)itemCountAtIndexPath:(NSInteger)section tableView:(UITableView *)tableView {
114 | if (tableView.style == UITableViewStyleGrouped) {
115 | DSSettingGroup *group = self.items[section];
116 | return group.items.count;
117 | } else {
118 | return self.items.count;
119 | }
120 | }
121 |
122 | //配置cell
123 | - (UITableViewCell *)configCellWithItem:(DSSettingItem *)item cellForRowAtIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView{
124 | //唯一标识用类名表示
125 | NSString *identifier = item.cellClassName.length ? item.cellClassName : DefaultTableCell;
126 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
127 | if (!cell) {
128 | Class class = NSClassFromString(identifier);
129 | cell = [[class alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
130 |
131 | //自己实现下划线,要把系统的隐藏了
132 | //第一行要有顶部的分割线
133 | if (indexPath.row == 0) {
134 | UIView *sep = [[UIView alloc] initWithFrame:CGRectMake(0, 0, cell.frame.size.width, 0.5)];
135 | sep.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth;
136 | sep.backgroundColor = [UIColor lightGrayColor];
137 | [cell addSubview:sep];
138 | }
139 | CGFloat sepWidth;
140 | if (indexPath.row == ([self itemCountAtIndexPath:indexPath.section tableView:tableView] - 1)) {
141 | //最后一行全部显示
142 | sepWidth = cell.frame.size.width;
143 | } else {
144 | //分割线宽度
145 | sepWidth = cell.frame.size.width - item.sepLeftEdge;
146 | }
147 | UIView *sep = [[UIView alloc] initWithFrame:CGRectMake(cell.frame.size.width - sepWidth, cell.frame.size.height, sepWidth, 0.5)];
148 | sep.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
149 | sep.backgroundColor = [UIColor lightGrayColor];
150 | [cell addSubview:sep];
151 | }
152 | //设置数据
153 | if ([cell respondsToSelector:@selector(refreshData:tableView:)]) {
154 | [(id)cell refreshData:item tableView:tableView];
155 | }
156 | cell.accessoryType = item.isShowAccessory ? UITableViewCellAccessoryDisclosureIndicator : UITableViewCellAccessoryNone;
157 | return cell;
158 | }
159 |
160 | //找到tableView的VC
161 | - (UIViewController *)findViewControllerWithTableView:(UITableView *)tableView{
162 | for (UIView *next = tableView; next; next = next.superview) {
163 | UIResponder *nextResponder = [next nextResponder];
164 | if ([nextResponder isKindOfClass:[UIViewController class]]) {
165 | return (UIViewController *)nextResponder;
166 | }
167 | }
168 | return nil;
169 | }
170 | @end
171 |
--------------------------------------------------------------------------------
/DSSettingDataSource/DSSettingDataSource.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0EF0CAF2208F541100F161FF /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CAF1208F541100F161FF /* AppDelegate.m */; };
11 | 0EF0CAF5208F541100F161FF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CAF4208F541100F161FF /* ViewController.m */; };
12 | 0EF0CAF8208F541100F161FF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0EF0CAF6208F541100F161FF /* Main.storyboard */; };
13 | 0EF0CAFA208F541700F161FF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0EF0CAF9208F541700F161FF /* Assets.xcassets */; };
14 | 0EF0CAFD208F541700F161FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0EF0CAFB208F541700F161FF /* LaunchScreen.storyboard */; };
15 | 0EF0CB00208F541700F161FF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CAFF208F541700F161FF /* main.m */; };
16 | 0EF0CB0A208F541700F161FF /* DSSettingDataSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CB09208F541700F161FF /* DSSettingDataSourceTests.m */; };
17 | 0EF0CB15208F541700F161FF /* DSSettingDataSourceUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CB14208F541700F161FF /* DSSettingDataSourceUITests.m */; };
18 | 0EF0CB25208F545900F161FF /* DSSettingItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CB24208F545900F161FF /* DSSettingItem.m */; };
19 | 0EF0CB28208F546C00F161FF /* DSSettingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CB27208F546C00F161FF /* DSSettingCell.m */; };
20 | 0EF0CB2B208F548D00F161FF /* DSSettingDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EF0CB2A208F548D00F161FF /* DSSettingDataSource.m */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXContainerItemProxy section */
24 | 0EF0CB06208F541700F161FF /* PBXContainerItemProxy */ = {
25 | isa = PBXContainerItemProxy;
26 | containerPortal = 0EF0CAE5208F541100F161FF /* Project object */;
27 | proxyType = 1;
28 | remoteGlobalIDString = 0EF0CAEC208F541100F161FF;
29 | remoteInfo = DSSettingDataSource;
30 | };
31 | 0EF0CB11208F541700F161FF /* PBXContainerItemProxy */ = {
32 | isa = PBXContainerItemProxy;
33 | containerPortal = 0EF0CAE5208F541100F161FF /* Project object */;
34 | proxyType = 1;
35 | remoteGlobalIDString = 0EF0CAEC208F541100F161FF;
36 | remoteInfo = DSSettingDataSource;
37 | };
38 | /* End PBXContainerItemProxy section */
39 |
40 | /* Begin PBXFileReference section */
41 | 0E41A31D20BE4F3E00D7F171 /* DSSettingCellProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DSSettingCellProtocol.h; sourceTree = ""; };
42 | 0EF0CAED208F541100F161FF /* DSSettingDataSource.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DSSettingDataSource.app; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 0EF0CAF0208F541100F161FF /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
44 | 0EF0CAF1208F541100F161FF /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
45 | 0EF0CAF3208F541100F161FF /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
46 | 0EF0CAF4208F541100F161FF /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
47 | 0EF0CAF7208F541100F161FF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
48 | 0EF0CAF9208F541700F161FF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
49 | 0EF0CAFC208F541700F161FF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
50 | 0EF0CAFE208F541700F161FF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
51 | 0EF0CAFF208F541700F161FF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
52 | 0EF0CB05208F541700F161FF /* DSSettingDataSourceTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DSSettingDataSourceTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 0EF0CB09208F541700F161FF /* DSSettingDataSourceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DSSettingDataSourceTests.m; sourceTree = ""; };
54 | 0EF0CB0B208F541700F161FF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | 0EF0CB10208F541700F161FF /* DSSettingDataSourceUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DSSettingDataSourceUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
56 | 0EF0CB14208F541700F161FF /* DSSettingDataSourceUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DSSettingDataSourceUITests.m; sourceTree = ""; };
57 | 0EF0CB16208F541700F161FF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | 0EF0CB23208F545900F161FF /* DSSettingItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DSSettingItem.h; sourceTree = ""; };
59 | 0EF0CB24208F545900F161FF /* DSSettingItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DSSettingItem.m; sourceTree = ""; };
60 | 0EF0CB26208F546C00F161FF /* DSSettingCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DSSettingCell.h; sourceTree = ""; };
61 | 0EF0CB27208F546C00F161FF /* DSSettingCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DSSettingCell.m; sourceTree = ""; };
62 | 0EF0CB29208F548D00F161FF /* DSSettingDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DSSettingDataSource.h; sourceTree = ""; };
63 | 0EF0CB2A208F548D00F161FF /* DSSettingDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DSSettingDataSource.m; sourceTree = ""; };
64 | /* End PBXFileReference section */
65 |
66 | /* Begin PBXFrameworksBuildPhase section */
67 | 0EF0CAEA208F541100F161FF /* Frameworks */ = {
68 | isa = PBXFrameworksBuildPhase;
69 | buildActionMask = 2147483647;
70 | files = (
71 | );
72 | runOnlyForDeploymentPostprocessing = 0;
73 | };
74 | 0EF0CB02208F541700F161FF /* Frameworks */ = {
75 | isa = PBXFrameworksBuildPhase;
76 | buildActionMask = 2147483647;
77 | files = (
78 | );
79 | runOnlyForDeploymentPostprocessing = 0;
80 | };
81 | 0EF0CB0D208F541700F161FF /* Frameworks */ = {
82 | isa = PBXFrameworksBuildPhase;
83 | buildActionMask = 2147483647;
84 | files = (
85 | );
86 | runOnlyForDeploymentPostprocessing = 0;
87 | };
88 | /* End PBXFrameworksBuildPhase section */
89 |
90 | /* Begin PBXGroup section */
91 | 0EF0CAE4208F541100F161FF = {
92 | isa = PBXGroup;
93 | children = (
94 | 0EF0CAEF208F541100F161FF /* DSSettingDataSource */,
95 | 0EF0CB08208F541700F161FF /* DSSettingDataSourceTests */,
96 | 0EF0CB13208F541700F161FF /* DSSettingDataSourceUITests */,
97 | 0EF0CAEE208F541100F161FF /* Products */,
98 | );
99 | sourceTree = "";
100 | };
101 | 0EF0CAEE208F541100F161FF /* Products */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 0EF0CAED208F541100F161FF /* DSSettingDataSource.app */,
105 | 0EF0CB05208F541700F161FF /* DSSettingDataSourceTests.xctest */,
106 | 0EF0CB10208F541700F161FF /* DSSettingDataSourceUITests.xctest */,
107 | );
108 | name = Products;
109 | sourceTree = "";
110 | };
111 | 0EF0CAEF208F541100F161FF /* DSSettingDataSource */ = {
112 | isa = PBXGroup;
113 | children = (
114 | 0EF0CB22208F544000F161FF /* DSSettingDataSource */,
115 | 0EF0CAF0208F541100F161FF /* AppDelegate.h */,
116 | 0EF0CAF1208F541100F161FF /* AppDelegate.m */,
117 | 0EF0CAF3208F541100F161FF /* ViewController.h */,
118 | 0EF0CAF4208F541100F161FF /* ViewController.m */,
119 | 0EF0CAF6208F541100F161FF /* Main.storyboard */,
120 | 0EF0CAF9208F541700F161FF /* Assets.xcassets */,
121 | 0EF0CAFB208F541700F161FF /* LaunchScreen.storyboard */,
122 | 0EF0CAFE208F541700F161FF /* Info.plist */,
123 | 0EF0CAFF208F541700F161FF /* main.m */,
124 | );
125 | path = DSSettingDataSource;
126 | sourceTree = "";
127 | };
128 | 0EF0CB08208F541700F161FF /* DSSettingDataSourceTests */ = {
129 | isa = PBXGroup;
130 | children = (
131 | 0EF0CB09208F541700F161FF /* DSSettingDataSourceTests.m */,
132 | 0EF0CB0B208F541700F161FF /* Info.plist */,
133 | );
134 | path = DSSettingDataSourceTests;
135 | sourceTree = "";
136 | };
137 | 0EF0CB13208F541700F161FF /* DSSettingDataSourceUITests */ = {
138 | isa = PBXGroup;
139 | children = (
140 | 0EF0CB14208F541700F161FF /* DSSettingDataSourceUITests.m */,
141 | 0EF0CB16208F541700F161FF /* Info.plist */,
142 | );
143 | path = DSSettingDataSourceUITests;
144 | sourceTree = "";
145 | };
146 | 0EF0CB22208F544000F161FF /* DSSettingDataSource */ = {
147 | isa = PBXGroup;
148 | children = (
149 | 0EF0CB23208F545900F161FF /* DSSettingItem.h */,
150 | 0EF0CB24208F545900F161FF /* DSSettingItem.m */,
151 | 0EF0CB26208F546C00F161FF /* DSSettingCell.h */,
152 | 0EF0CB27208F546C00F161FF /* DSSettingCell.m */,
153 | 0EF0CB29208F548D00F161FF /* DSSettingDataSource.h */,
154 | 0EF0CB2A208F548D00F161FF /* DSSettingDataSource.m */,
155 | 0E41A31D20BE4F3E00D7F171 /* DSSettingCellProtocol.h */,
156 | );
157 | path = DSSettingDataSource;
158 | sourceTree = "";
159 | };
160 | /* End PBXGroup section */
161 |
162 | /* Begin PBXNativeTarget section */
163 | 0EF0CAEC208F541100F161FF /* DSSettingDataSource */ = {
164 | isa = PBXNativeTarget;
165 | buildConfigurationList = 0EF0CB19208F541700F161FF /* Build configuration list for PBXNativeTarget "DSSettingDataSource" */;
166 | buildPhases = (
167 | 0EF0CAE9208F541100F161FF /* Sources */,
168 | 0EF0CAEA208F541100F161FF /* Frameworks */,
169 | 0EF0CAEB208F541100F161FF /* Resources */,
170 | );
171 | buildRules = (
172 | );
173 | dependencies = (
174 | );
175 | name = DSSettingDataSource;
176 | productName = DSSettingDataSource;
177 | productReference = 0EF0CAED208F541100F161FF /* DSSettingDataSource.app */;
178 | productType = "com.apple.product-type.application";
179 | };
180 | 0EF0CB04208F541700F161FF /* DSSettingDataSourceTests */ = {
181 | isa = PBXNativeTarget;
182 | buildConfigurationList = 0EF0CB1C208F541700F161FF /* Build configuration list for PBXNativeTarget "DSSettingDataSourceTests" */;
183 | buildPhases = (
184 | 0EF0CB01208F541700F161FF /* Sources */,
185 | 0EF0CB02208F541700F161FF /* Frameworks */,
186 | 0EF0CB03208F541700F161FF /* Resources */,
187 | );
188 | buildRules = (
189 | );
190 | dependencies = (
191 | 0EF0CB07208F541700F161FF /* PBXTargetDependency */,
192 | );
193 | name = DSSettingDataSourceTests;
194 | productName = DSSettingDataSourceTests;
195 | productReference = 0EF0CB05208F541700F161FF /* DSSettingDataSourceTests.xctest */;
196 | productType = "com.apple.product-type.bundle.unit-test";
197 | };
198 | 0EF0CB0F208F541700F161FF /* DSSettingDataSourceUITests */ = {
199 | isa = PBXNativeTarget;
200 | buildConfigurationList = 0EF0CB1F208F541700F161FF /* Build configuration list for PBXNativeTarget "DSSettingDataSourceUITests" */;
201 | buildPhases = (
202 | 0EF0CB0C208F541700F161FF /* Sources */,
203 | 0EF0CB0D208F541700F161FF /* Frameworks */,
204 | 0EF0CB0E208F541700F161FF /* Resources */,
205 | );
206 | buildRules = (
207 | );
208 | dependencies = (
209 | 0EF0CB12208F541700F161FF /* PBXTargetDependency */,
210 | );
211 | name = DSSettingDataSourceUITests;
212 | productName = DSSettingDataSourceUITests;
213 | productReference = 0EF0CB10208F541700F161FF /* DSSettingDataSourceUITests.xctest */;
214 | productType = "com.apple.product-type.bundle.ui-testing";
215 | };
216 | /* End PBXNativeTarget section */
217 |
218 | /* Begin PBXProject section */
219 | 0EF0CAE5208F541100F161FF /* Project object */ = {
220 | isa = PBXProject;
221 | attributes = {
222 | LastUpgradeCheck = 0930;
223 | ORGANIZATIONNAME = HelloAda;
224 | TargetAttributes = {
225 | 0EF0CAEC208F541100F161FF = {
226 | CreatedOnToolsVersion = 9.3;
227 | };
228 | 0EF0CB04208F541700F161FF = {
229 | CreatedOnToolsVersion = 9.3;
230 | TestTargetID = 0EF0CAEC208F541100F161FF;
231 | };
232 | 0EF0CB0F208F541700F161FF = {
233 | CreatedOnToolsVersion = 9.3;
234 | TestTargetID = 0EF0CAEC208F541100F161FF;
235 | };
236 | };
237 | };
238 | buildConfigurationList = 0EF0CAE8208F541100F161FF /* Build configuration list for PBXProject "DSSettingDataSource" */;
239 | compatibilityVersion = "Xcode 9.3";
240 | developmentRegion = en;
241 | hasScannedForEncodings = 0;
242 | knownRegions = (
243 | en,
244 | Base,
245 | );
246 | mainGroup = 0EF0CAE4208F541100F161FF;
247 | productRefGroup = 0EF0CAEE208F541100F161FF /* Products */;
248 | projectDirPath = "";
249 | projectRoot = "";
250 | targets = (
251 | 0EF0CAEC208F541100F161FF /* DSSettingDataSource */,
252 | 0EF0CB04208F541700F161FF /* DSSettingDataSourceTests */,
253 | 0EF0CB0F208F541700F161FF /* DSSettingDataSourceUITests */,
254 | );
255 | };
256 | /* End PBXProject section */
257 |
258 | /* Begin PBXResourcesBuildPhase section */
259 | 0EF0CAEB208F541100F161FF /* Resources */ = {
260 | isa = PBXResourcesBuildPhase;
261 | buildActionMask = 2147483647;
262 | files = (
263 | 0EF0CAFD208F541700F161FF /* LaunchScreen.storyboard in Resources */,
264 | 0EF0CAFA208F541700F161FF /* Assets.xcassets in Resources */,
265 | 0EF0CAF8208F541100F161FF /* Main.storyboard in Resources */,
266 | );
267 | runOnlyForDeploymentPostprocessing = 0;
268 | };
269 | 0EF0CB03208F541700F161FF /* Resources */ = {
270 | isa = PBXResourcesBuildPhase;
271 | buildActionMask = 2147483647;
272 | files = (
273 | );
274 | runOnlyForDeploymentPostprocessing = 0;
275 | };
276 | 0EF0CB0E208F541700F161FF /* Resources */ = {
277 | isa = PBXResourcesBuildPhase;
278 | buildActionMask = 2147483647;
279 | files = (
280 | );
281 | runOnlyForDeploymentPostprocessing = 0;
282 | };
283 | /* End PBXResourcesBuildPhase section */
284 |
285 | /* Begin PBXSourcesBuildPhase section */
286 | 0EF0CAE9208F541100F161FF /* Sources */ = {
287 | isa = PBXSourcesBuildPhase;
288 | buildActionMask = 2147483647;
289 | files = (
290 | 0EF0CAF5208F541100F161FF /* ViewController.m in Sources */,
291 | 0EF0CB00208F541700F161FF /* main.m in Sources */,
292 | 0EF0CB2B208F548D00F161FF /* DSSettingDataSource.m in Sources */,
293 | 0EF0CB25208F545900F161FF /* DSSettingItem.m in Sources */,
294 | 0EF0CAF2208F541100F161FF /* AppDelegate.m in Sources */,
295 | 0EF0CB28208F546C00F161FF /* DSSettingCell.m in Sources */,
296 | );
297 | runOnlyForDeploymentPostprocessing = 0;
298 | };
299 | 0EF0CB01208F541700F161FF /* Sources */ = {
300 | isa = PBXSourcesBuildPhase;
301 | buildActionMask = 2147483647;
302 | files = (
303 | 0EF0CB0A208F541700F161FF /* DSSettingDataSourceTests.m in Sources */,
304 | );
305 | runOnlyForDeploymentPostprocessing = 0;
306 | };
307 | 0EF0CB0C208F541700F161FF /* Sources */ = {
308 | isa = PBXSourcesBuildPhase;
309 | buildActionMask = 2147483647;
310 | files = (
311 | 0EF0CB15208F541700F161FF /* DSSettingDataSourceUITests.m in Sources */,
312 | );
313 | runOnlyForDeploymentPostprocessing = 0;
314 | };
315 | /* End PBXSourcesBuildPhase section */
316 |
317 | /* Begin PBXTargetDependency section */
318 | 0EF0CB07208F541700F161FF /* PBXTargetDependency */ = {
319 | isa = PBXTargetDependency;
320 | target = 0EF0CAEC208F541100F161FF /* DSSettingDataSource */;
321 | targetProxy = 0EF0CB06208F541700F161FF /* PBXContainerItemProxy */;
322 | };
323 | 0EF0CB12208F541700F161FF /* PBXTargetDependency */ = {
324 | isa = PBXTargetDependency;
325 | target = 0EF0CAEC208F541100F161FF /* DSSettingDataSource */;
326 | targetProxy = 0EF0CB11208F541700F161FF /* PBXContainerItemProxy */;
327 | };
328 | /* End PBXTargetDependency section */
329 |
330 | /* Begin PBXVariantGroup section */
331 | 0EF0CAF6208F541100F161FF /* Main.storyboard */ = {
332 | isa = PBXVariantGroup;
333 | children = (
334 | 0EF0CAF7208F541100F161FF /* Base */,
335 | );
336 | name = Main.storyboard;
337 | sourceTree = "";
338 | };
339 | 0EF0CAFB208F541700F161FF /* LaunchScreen.storyboard */ = {
340 | isa = PBXVariantGroup;
341 | children = (
342 | 0EF0CAFC208F541700F161FF /* Base */,
343 | );
344 | name = LaunchScreen.storyboard;
345 | sourceTree = "";
346 | };
347 | /* End PBXVariantGroup section */
348 |
349 | /* Begin XCBuildConfiguration section */
350 | 0EF0CB17208F541700F161FF /* Debug */ = {
351 | isa = XCBuildConfiguration;
352 | buildSettings = {
353 | ALWAYS_SEARCH_USER_PATHS = NO;
354 | CLANG_ANALYZER_NONNULL = YES;
355 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
356 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
357 | CLANG_CXX_LIBRARY = "libc++";
358 | CLANG_ENABLE_MODULES = YES;
359 | CLANG_ENABLE_OBJC_ARC = YES;
360 | CLANG_ENABLE_OBJC_WEAK = YES;
361 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
362 | CLANG_WARN_BOOL_CONVERSION = YES;
363 | CLANG_WARN_COMMA = YES;
364 | CLANG_WARN_CONSTANT_CONVERSION = YES;
365 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
366 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
367 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
368 | CLANG_WARN_EMPTY_BODY = YES;
369 | CLANG_WARN_ENUM_CONVERSION = YES;
370 | CLANG_WARN_INFINITE_RECURSION = YES;
371 | CLANG_WARN_INT_CONVERSION = YES;
372 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
373 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
374 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
376 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
377 | CLANG_WARN_STRICT_PROTOTYPES = YES;
378 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
379 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
380 | CLANG_WARN_UNREACHABLE_CODE = YES;
381 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
382 | CODE_SIGN_IDENTITY = "iPhone Developer";
383 | COPY_PHASE_STRIP = NO;
384 | DEBUG_INFORMATION_FORMAT = dwarf;
385 | ENABLE_STRICT_OBJC_MSGSEND = YES;
386 | ENABLE_TESTABILITY = YES;
387 | GCC_C_LANGUAGE_STANDARD = gnu11;
388 | GCC_DYNAMIC_NO_PIC = NO;
389 | GCC_NO_COMMON_BLOCKS = YES;
390 | GCC_OPTIMIZATION_LEVEL = 0;
391 | GCC_PREPROCESSOR_DEFINITIONS = (
392 | "DEBUG=1",
393 | "$(inherited)",
394 | );
395 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
396 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
397 | GCC_WARN_UNDECLARED_SELECTOR = YES;
398 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
399 | GCC_WARN_UNUSED_FUNCTION = YES;
400 | GCC_WARN_UNUSED_VARIABLE = YES;
401 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
402 | MTL_ENABLE_DEBUG_INFO = YES;
403 | ONLY_ACTIVE_ARCH = YES;
404 | SDKROOT = iphoneos;
405 | };
406 | name = Debug;
407 | };
408 | 0EF0CB18208F541700F161FF /* Release */ = {
409 | isa = XCBuildConfiguration;
410 | buildSettings = {
411 | ALWAYS_SEARCH_USER_PATHS = NO;
412 | CLANG_ANALYZER_NONNULL = YES;
413 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
414 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
415 | CLANG_CXX_LIBRARY = "libc++";
416 | CLANG_ENABLE_MODULES = YES;
417 | CLANG_ENABLE_OBJC_ARC = YES;
418 | CLANG_ENABLE_OBJC_WEAK = YES;
419 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
420 | CLANG_WARN_BOOL_CONVERSION = YES;
421 | CLANG_WARN_COMMA = YES;
422 | CLANG_WARN_CONSTANT_CONVERSION = YES;
423 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
424 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
425 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
426 | CLANG_WARN_EMPTY_BODY = YES;
427 | CLANG_WARN_ENUM_CONVERSION = YES;
428 | CLANG_WARN_INFINITE_RECURSION = YES;
429 | CLANG_WARN_INT_CONVERSION = YES;
430 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
431 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
432 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
433 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
434 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
435 | CLANG_WARN_STRICT_PROTOTYPES = YES;
436 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
437 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
438 | CLANG_WARN_UNREACHABLE_CODE = YES;
439 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
440 | CODE_SIGN_IDENTITY = "iPhone Developer";
441 | COPY_PHASE_STRIP = NO;
442 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
443 | ENABLE_NS_ASSERTIONS = NO;
444 | ENABLE_STRICT_OBJC_MSGSEND = YES;
445 | GCC_C_LANGUAGE_STANDARD = gnu11;
446 | GCC_NO_COMMON_BLOCKS = YES;
447 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
448 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
449 | GCC_WARN_UNDECLARED_SELECTOR = YES;
450 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
451 | GCC_WARN_UNUSED_FUNCTION = YES;
452 | GCC_WARN_UNUSED_VARIABLE = YES;
453 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
454 | MTL_ENABLE_DEBUG_INFO = NO;
455 | SDKROOT = iphoneos;
456 | VALIDATE_PRODUCT = YES;
457 | };
458 | name = Release;
459 | };
460 | 0EF0CB1A208F541700F161FF /* Debug */ = {
461 | isa = XCBuildConfiguration;
462 | buildSettings = {
463 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
464 | CODE_SIGN_STYLE = Automatic;
465 | INFOPLIST_FILE = DSSettingDataSource/Info.plist;
466 | LD_RUNPATH_SEARCH_PATHS = (
467 | "$(inherited)",
468 | "@executable_path/Frameworks",
469 | );
470 | PRODUCT_BUNDLE_IDENTIFIER = "---.DSSettingDataSource";
471 | PRODUCT_NAME = "$(TARGET_NAME)";
472 | TARGETED_DEVICE_FAMILY = "1,2";
473 | };
474 | name = Debug;
475 | };
476 | 0EF0CB1B208F541700F161FF /* Release */ = {
477 | isa = XCBuildConfiguration;
478 | buildSettings = {
479 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
480 | CODE_SIGN_STYLE = Automatic;
481 | INFOPLIST_FILE = DSSettingDataSource/Info.plist;
482 | LD_RUNPATH_SEARCH_PATHS = (
483 | "$(inherited)",
484 | "@executable_path/Frameworks",
485 | );
486 | PRODUCT_BUNDLE_IDENTIFIER = "---.DSSettingDataSource";
487 | PRODUCT_NAME = "$(TARGET_NAME)";
488 | TARGETED_DEVICE_FAMILY = "1,2";
489 | };
490 | name = Release;
491 | };
492 | 0EF0CB1D208F541700F161FF /* Debug */ = {
493 | isa = XCBuildConfiguration;
494 | buildSettings = {
495 | BUNDLE_LOADER = "$(TEST_HOST)";
496 | CODE_SIGN_STYLE = Automatic;
497 | INFOPLIST_FILE = DSSettingDataSourceTests/Info.plist;
498 | LD_RUNPATH_SEARCH_PATHS = (
499 | "$(inherited)",
500 | "@executable_path/Frameworks",
501 | "@loader_path/Frameworks",
502 | );
503 | PRODUCT_BUNDLE_IDENTIFIER = "---.DSSettingDataSourceTests";
504 | PRODUCT_NAME = "$(TARGET_NAME)";
505 | TARGETED_DEVICE_FAMILY = "1,2";
506 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DSSettingDataSource.app/DSSettingDataSource";
507 | };
508 | name = Debug;
509 | };
510 | 0EF0CB1E208F541700F161FF /* Release */ = {
511 | isa = XCBuildConfiguration;
512 | buildSettings = {
513 | BUNDLE_LOADER = "$(TEST_HOST)";
514 | CODE_SIGN_STYLE = Automatic;
515 | INFOPLIST_FILE = DSSettingDataSourceTests/Info.plist;
516 | LD_RUNPATH_SEARCH_PATHS = (
517 | "$(inherited)",
518 | "@executable_path/Frameworks",
519 | "@loader_path/Frameworks",
520 | );
521 | PRODUCT_BUNDLE_IDENTIFIER = "---.DSSettingDataSourceTests";
522 | PRODUCT_NAME = "$(TARGET_NAME)";
523 | TARGETED_DEVICE_FAMILY = "1,2";
524 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DSSettingDataSource.app/DSSettingDataSource";
525 | };
526 | name = Release;
527 | };
528 | 0EF0CB20208F541700F161FF /* Debug */ = {
529 | isa = XCBuildConfiguration;
530 | buildSettings = {
531 | CODE_SIGN_STYLE = Automatic;
532 | INFOPLIST_FILE = DSSettingDataSourceUITests/Info.plist;
533 | LD_RUNPATH_SEARCH_PATHS = (
534 | "$(inherited)",
535 | "@executable_path/Frameworks",
536 | "@loader_path/Frameworks",
537 | );
538 | PRODUCT_BUNDLE_IDENTIFIER = "---.DSSettingDataSourceUITests";
539 | PRODUCT_NAME = "$(TARGET_NAME)";
540 | TARGETED_DEVICE_FAMILY = "1,2";
541 | TEST_TARGET_NAME = DSSettingDataSource;
542 | };
543 | name = Debug;
544 | };
545 | 0EF0CB21208F541700F161FF /* Release */ = {
546 | isa = XCBuildConfiguration;
547 | buildSettings = {
548 | CODE_SIGN_STYLE = Automatic;
549 | INFOPLIST_FILE = DSSettingDataSourceUITests/Info.plist;
550 | LD_RUNPATH_SEARCH_PATHS = (
551 | "$(inherited)",
552 | "@executable_path/Frameworks",
553 | "@loader_path/Frameworks",
554 | );
555 | PRODUCT_BUNDLE_IDENTIFIER = "---.DSSettingDataSourceUITests";
556 | PRODUCT_NAME = "$(TARGET_NAME)";
557 | TARGETED_DEVICE_FAMILY = "1,2";
558 | TEST_TARGET_NAME = DSSettingDataSource;
559 | };
560 | name = Release;
561 | };
562 | /* End XCBuildConfiguration section */
563 |
564 | /* Begin XCConfigurationList section */
565 | 0EF0CAE8208F541100F161FF /* Build configuration list for PBXProject "DSSettingDataSource" */ = {
566 | isa = XCConfigurationList;
567 | buildConfigurations = (
568 | 0EF0CB17208F541700F161FF /* Debug */,
569 | 0EF0CB18208F541700F161FF /* Release */,
570 | );
571 | defaultConfigurationIsVisible = 0;
572 | defaultConfigurationName = Release;
573 | };
574 | 0EF0CB19208F541700F161FF /* Build configuration list for PBXNativeTarget "DSSettingDataSource" */ = {
575 | isa = XCConfigurationList;
576 | buildConfigurations = (
577 | 0EF0CB1A208F541700F161FF /* Debug */,
578 | 0EF0CB1B208F541700F161FF /* Release */,
579 | );
580 | defaultConfigurationIsVisible = 0;
581 | defaultConfigurationName = Release;
582 | };
583 | 0EF0CB1C208F541700F161FF /* Build configuration list for PBXNativeTarget "DSSettingDataSourceTests" */ = {
584 | isa = XCConfigurationList;
585 | buildConfigurations = (
586 | 0EF0CB1D208F541700F161FF /* Debug */,
587 | 0EF0CB1E208F541700F161FF /* Release */,
588 | );
589 | defaultConfigurationIsVisible = 0;
590 | defaultConfigurationName = Release;
591 | };
592 | 0EF0CB1F208F541700F161FF /* Build configuration list for PBXNativeTarget "DSSettingDataSourceUITests" */ = {
593 | isa = XCConfigurationList;
594 | buildConfigurations = (
595 | 0EF0CB20208F541700F161FF /* Debug */,
596 | 0EF0CB21208F541700F161FF /* Release */,
597 | );
598 | defaultConfigurationIsVisible = 0;
599 | defaultConfigurationName = Release;
600 | };
601 | /* End XCConfigurationList section */
602 | };
603 | rootObject = 0EF0CAE5208F541100F161FF /* Project object */;
604 | }
605 |
--------------------------------------------------------------------------------