Procházet zdrojové kódy

1.修改iOS Apex Drivers Setting,增加Change Password和About。

Pen Li před 7 roky
rodič
revize
d21ee2ddf1
39 změnil soubory, kde provedl 441 přidání a 20 odebrání
  1. 12 0
      Redant Drivers/Apex And Drivers.xcodeproj/project.pbxproj
  2. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo.png
  3. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-1.png
  4. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-2.png
  5. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-3.png
  6. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x.png
  7. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-1.png
  8. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-2.png
  9. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-3.png
  10. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x.png
  11. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Apex & Drivers Logo.png
  12. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Apex & Drivers Logo@2x.png
  13. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Apex & Drivers Logo@3x.png
  14. 23 0
      Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Contents.json
  15. 23 0
      Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/Contents.json
  16. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/redant_logo.png
  17. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/redant_logo@2x.png
  18. binární
      Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/redant_logo@3x.png
  19. 7 0
      Redant Drivers/Apex And Drivers/Camera/RACameraViewController.m
  20. 1 1
      Redant Drivers/Apex And Drivers/Info.plist
  21. 13 0
      Redant Drivers/Apex And Drivers/Setting/Cell/RASettingAboutCell.h
  22. 49 0
      Redant Drivers/Apex And Drivers/Setting/Cell/RASettingAboutCell.m
  23. 2 0
      Redant Drivers/Apex And Drivers/Setting/Cell/RASettingActionCell.m
  24. 12 3
      Redant Drivers/Apex And Drivers/Setting/Data/setting.json
  25. 20 0
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingAboutModel.h
  26. 68 0
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingAboutModel.m
  27. 2 1
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingActionModel.h
  28. 4 0
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingActionModel.m
  29. 4 1
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingBaseModel.h
  30. 12 2
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingOptionModel.m
  31. 5 0
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingSectionModel.m
  32. 4 0
      Redant Drivers/Apex And Drivers/Setting/Model/RASettingSwitchModel.m
  33. 2 0
      Redant Drivers/Apex And Drivers/Setting/Option/RAOptionViewController.h
  34. 4 0
      Redant Drivers/Apex And Drivers/Setting/Option/RAOptionViewController.m
  35. 5 0
      Redant Drivers/Apex And Drivers/Setting/RASettingViewController+TableDataSource.m
  36. 55 10
      Redant Drivers/Apex And Drivers/Setting/RASettingViewController+TableDelegate.m
  37. 6 1
      Redant Drivers/Apex And Drivers/Setting/RASettingViewController.m
  38. 107 0
      Redant Drivers/Apex And Drivers/Setting/setting.storyboard
  39. 1 1
      Redant Drivers/Apex And Drivers/UIImage+RedAnt.m

+ 12 - 0
Redant Drivers/Apex And Drivers.xcodeproj/project.pbxproj

@@ -162,6 +162,8 @@
 		42DFE266213F80AF000213C2 /* UIScrollView+Empty.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFE264213F80AF000213C2 /* UIScrollView+Empty.m */; };
 		42DFE26A213F821E000213C2 /* RAEmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFE269213F821E000213C2 /* RAEmptyView.m */; };
 		42DFE26F213FC1B8000213C2 /* RAHomeSectionHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFE26E213FC1B7000213C2 /* RAHomeSectionHeaderView.m */; };
+		42ECE182214A04BE00AD8283 /* RASettingAboutModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 42ECE181214A04BE00AD8283 /* RASettingAboutModel.m */; };
+		42ECE185214A08A900AD8283 /* RASettingAboutCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42ECE184214A08A900AD8283 /* RASettingAboutCell.m */; };
 		42ED62D920F85ADB00E08CCB /* NotificationService.m in Sources */ = {isa = PBXBuildFile; fileRef = 42ED62D820F85ADB00E08CCB /* NotificationService.m */; };
 		42ED62DD20F85ADB00E08CCB /* RADriversNotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 42ED62D520F85ADB00E08CCB /* RADriversNotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
 		42F0C5D720E20B3F00922442 /* RACameraViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42F0C5D620E20B3E00922442 /* RACameraViewController.m */; };
@@ -486,6 +488,10 @@
 		42DFE269213F821E000213C2 /* RAEmptyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAEmptyView.m; sourceTree = "<group>"; };
 		42DFE26D213FC1B7000213C2 /* RAHomeSectionHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAHomeSectionHeaderView.h; sourceTree = "<group>"; };
 		42DFE26E213FC1B7000213C2 /* RAHomeSectionHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAHomeSectionHeaderView.m; sourceTree = "<group>"; };
+		42ECE180214A04BE00AD8283 /* RASettingAboutModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RASettingAboutModel.h; sourceTree = "<group>"; };
+		42ECE181214A04BE00AD8283 /* RASettingAboutModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RASettingAboutModel.m; sourceTree = "<group>"; };
+		42ECE183214A08A900AD8283 /* RASettingAboutCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RASettingAboutCell.h; sourceTree = "<group>"; };
+		42ECE184214A08A900AD8283 /* RASettingAboutCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RASettingAboutCell.m; sourceTree = "<group>"; };
 		42ED62D520F85ADB00E08CCB /* RADriversNotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = RADriversNotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
 		42ED62D720F85ADB00E08CCB /* NotificationService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationService.h; sourceTree = "<group>"; };
 		42ED62D820F85ADB00E08CCB /* NotificationService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NotificationService.m; sourceTree = "<group>"; };
@@ -858,6 +864,8 @@
 				425959792148F38000F7DD41 /* RASettingSwitchModel.m */,
 				4259597B2148F39300F7DD41 /* RASettingActionModel.h */,
 				4259597C2148F39300F7DD41 /* RASettingActionModel.m */,
+				42ECE180214A04BE00AD8283 /* RASettingAboutModel.h */,
+				42ECE181214A04BE00AD8283 /* RASettingAboutModel.m */,
 			);
 			path = Model;
 			sourceTree = "<group>";
@@ -873,6 +881,8 @@
 				425959852148F85100F7DD41 /* RASettingSwitchCell.m */,
 				425959872148F85E00F7DD41 /* RASettingActionCell.h */,
 				425959882148F85F00F7DD41 /* RASettingActionCell.m */,
+				42ECE183214A08A900AD8283 /* RASettingAboutCell.h */,
+				42ECE184214A08A900AD8283 /* RASettingAboutCell.m */,
 			);
 			path = Cell;
 			sourceTree = "<group>";
@@ -1428,6 +1438,7 @@
 				4255EC6820C4E27700E5DA24 /* RADetailActionSelectionViewController+TableDataSource.m in Sources */,
 				4255EC9C20C5286D00E5DA24 /* RAEditMultInputModel.m in Sources */,
 				4255EC7420C5096400E5DA24 /* RAOrderEditViewController.m in Sources */,
+				42ECE182214A04BE00AD8283 /* RASettingAboutModel.m in Sources */,
 				4280034420C0F146004D4F50 /* NSData+CommonCrypto.m in Sources */,
 				420D111B2133F07B00149B37 /* RAOrderFilterInputCell.m in Sources */,
 				4205FD6120C135CF00DB42B4 /* RAHomeViewController.m in Sources */,
@@ -1445,6 +1456,7 @@
 				42D8B8B420C2463D001C125F /* RADetailLocationCell.m in Sources */,
 				4281100520E4D47000315156 /* UIView+JLExtension.m in Sources */,
 				423C6A4E20C909FC00455E27 /* RANotificationNameCenter.m in Sources */,
+				42ECE185214A08A900AD8283 /* RASettingAboutCell.m in Sources */,
 				4259597D2148F39300F7DD41 /* RASettingActionModel.m in Sources */,
 				42D7B0792147946D0046FE89 /* RAMessageViewController.m in Sources */,
 				42529D3A20C0EA3F000C0F4D /* mztools.c in Sources */,

binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-1.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-2.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-3.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-1.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-2.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-3.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Apex & Drivers Logo.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Apex & Drivers Logo@2x.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Apex & Drivers Logo@3x.png


+ 23 - 0
Redant Drivers/Apex And Drivers/Assets.xcassets/icon_50.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "Apex & Drivers Logo.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "Apex & Drivers Logo@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "Apex & Drivers Logo@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 23 - 0
Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "redant_logo.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "redant_logo@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "redant_logo@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

binární
Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/redant_logo.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/redant_logo@2x.png


binární
Redant Drivers/Apex And Drivers/Assets.xcassets/redant_40.imageset/redant_logo@3x.png


+ 7 - 0
Redant Drivers/Apex And Drivers/Camera/RACameraViewController.m

@@ -141,6 +141,13 @@
         _captureSession.sessionPreset = AVCaptureSessionPresetHigh;
     }
     
+    if ([self.captureDevice isFlashAvailable] && [_captureDevice isFlashModeSupported:AVCaptureFlashModeAuto]) {
+        NSError *configErr;
+        [self.captureDevice lockForConfiguration:&configErr];
+        [self.captureDevice setFlashMode:AVCaptureFlashModeAuto];
+        [self.captureDevice unlockForConfiguration];
+    }
+    
     if ([self.captureSession canAddInput:self.captureInput]) {
         
         

+ 1 - 1
Redant Drivers/Apex And Drivers/Info.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>1.0</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>180913</string>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>comgooglemaps</string>

+ 13 - 0
Redant Drivers/Apex And Drivers/Setting/Cell/RASettingAboutCell.h

@@ -0,0 +1,13 @@
+//
+//  RASettingAboutCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/13.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RASettingBaseCell.h"
+
+@interface RASettingAboutCell : RASettingBaseCell
+
+@end

+ 49 - 0
Redant Drivers/Apex And Drivers/Setting/Cell/RASettingAboutCell.m

@@ -0,0 +1,49 @@
+//
+//  RASettingAboutCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/13.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RASettingAboutCell.h"
+#import "RASettingAboutModel.h"
+
+@interface RASettingAboutCell ()
+
+@property (nonatomic,strong) IBOutlet UIImageView *appIconView;
+@property (nonatomic,strong) IBOutlet UIImageView *redantLogoView;
+@property (nonatomic,strong) IBOutlet UILabel *appNameLabel;
+@property (nonatomic,strong) IBOutlet UILabel *appVerLabel;
+@property (nonatomic,strong) IBOutlet UILabel *copyrightLabel;
+@property (nonatomic,strong) IBOutlet UITextView *supportLabel;
+
+@end
+
+@implementation RASettingAboutCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    
+    self.model = nil;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)refreshUI {
+    
+    RASettingAboutModel *aboutModel = (RASettingAboutModel *)self.model;
+    self.appIconView.image = aboutModel.appIcon;
+    self.redantLogoView.image = aboutModel.redantLogo;
+    self.appNameLabel.text = aboutModel.appName;
+    self.appVerLabel.text = aboutModel.appVer;
+//    self.copyrightLabel.text = aboutModel.appCopyright;
+    self.supportLabel.text = aboutModel.appSupport;
+}
+
+@end

+ 2 - 0
Redant Drivers/Apex And Drivers/Setting/Cell/RASettingActionCell.m

@@ -21,6 +21,8 @@
 - (void)awakeFromNib {
     [super awakeFromNib];
     // Initialization code
+    
+    self.activityIndicator.tintColor = ApexDriverOrangeColor;
 }
 
 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {

+ 12 - 3
Redant Drivers/Apex And Drivers/Setting/Data/setting.json

@@ -26,9 +26,9 @@
                  {
                  "settings": [
                               {
-                              "type": 1,
-                              "keyPath": "notification",
-                              "title": "Notification"
+                              "type": 2,
+                              "actionType": 1,
+                              "title": "Change Password"
                               }
                               ]
                  },
@@ -36,9 +36,18 @@
                  "settings": [
                               {
                               "type": 2,
+                              "actionType": 0,
                               "title": "Clean Cache"
                               }
                               ]
+                 },
+                 {
+                 "settings": [
+                              {
+                              "type": 3,
+                              "title": "About"
+                              }
+                              ]
                  }
                  ]
 }

+ 20 - 0
Redant Drivers/Apex And Drivers/Setting/Model/RASettingAboutModel.h

@@ -0,0 +1,20 @@
+//
+//  RASettingAboutModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/13.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RASettingBaseModel.h"
+
+@interface RASettingAboutModel : RASettingBaseModel
+
+@property (nonatomic,copy) NSString *appName;
+@property (nonatomic,copy) NSString *appVer;
+@property (nonatomic,copy) NSString *appCopyright;
+@property (nonatomic,copy) NSString *appSupport;
+@property (nonatomic,strong) UIImage *appIcon;
+@property (nonatomic,strong) UIImage *redantLogo;
+
+@end

+ 68 - 0
Redant Drivers/Apex And Drivers/Setting/Model/RASettingAboutModel.m

@@ -0,0 +1,68 @@
+//
+//  RASettingAboutModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/13.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RASettingAboutModel.h"
+
+@interface RASettingAboutModel ()
+
+
+@end
+
+@implementation RASettingAboutModel
+
+- (CGFloat)height {
+    return 130.0f;
+}
+
+- (NSString *)appName {
+    if (!_appName) {
+        NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
+        _appName = [infoDic objectForKey:@"CFBundleDisplayName"];
+    }
+    return _appName;
+}
+
+- (NSString *)appVer {
+    if (!_appVer) {
+        NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
+        NSString *ver = [infoDic objectForKey:@"CFBundleShortVersionString"];
+        NSString *build = [infoDic objectForKey:@"CFBundleVersion"];
+        _appVer = [NSString stringWithFormat:@"Ver:%@ build %@",ver,build];
+    }
+    return _appVer;
+}
+
+- (NSString *)appCopyright {
+    if (!_appCopyright) {
+        _appCopyright = @"Copyright © 2014 United Software Applications, Inc.";
+    }
+    return _appCopyright;
+}
+
+- (NSString *)appSupport {
+    if (!_appSupport) {
+        _appSupport = @"redantsupport@united-us.net";
+    }
+    return _appSupport;
+}
+
+- (UIImage *)appIcon {
+    if (!_appIcon) {
+        _appIcon = [UIImage imageNamed:@"icon_50"];
+    }
+    return _appIcon;
+}
+
+- (UIImage *)redantLogo {
+    if (!_redantLogo) {
+        _redantLogo = [UIImage imageNamed:@"redant_40"];
+    }
+    return _redantLogo;
+}
+
+@end

+ 2 - 1
Redant Drivers/Apex And Drivers/Setting/Model/RASettingActionModel.h

@@ -10,7 +10,8 @@
 
 typedef enum {
     
-    RASettingActionTypeCleanCache = 0
+    RASettingActionTypeCleanCache = 0,
+    RASettingActionTypeChangePassword = 1
     
 } RASettingActionType;
 

+ 4 - 0
Redant Drivers/Apex And Drivers/Setting/Model/RASettingActionModel.m

@@ -10,6 +10,10 @@
 
 @implementation RASettingActionModel
 
+- (CGFloat)height {
+    return 60.0f;
+}
+
 - (void)setActive:(BOOL)active{
     _active = active;
     

+ 4 - 1
Redant Drivers/Apex And Drivers/Setting/Model/RASettingBaseModel.h

@@ -12,7 +12,8 @@ typedef enum {
     
     RASettingTypeOption = 0,
     RASettingTypeSwitch = 1,
-    RASettingTypeAction = 2
+    RASettingTypeAction = 2,
+    RASettingTypeAbout = 3
     
 } RASettingType;
 
@@ -29,4 +30,6 @@ typedef enum {
 @property (nonatomic,copy) NSString *title;
 @property (nonatomic,weak) id<RASettingModelDelegate> delegate;
 
+@property (nonatomic,assign,readonly) CGFloat height;
+
 @end

+ 12 - 2
Redant Drivers/Apex And Drivers/Setting/Model/RASettingOptionModel.m

@@ -18,12 +18,20 @@
 
 @implementation RASettingOptionModel
 
+- (CGFloat)height {
+    return 60.0f;
+}
+
 - (void)setOption:(RASettingOption *)option {
     _option = option;
     
     if (self.delegate && [self.delegate respondsToSelector:@selector(refreshUI)]) {
         [self.delegate refreshUI];
     }
+    
+    if (option && self.keyPath.length > 0) {
+        [RASingleton.sharedInstance setValue:@(option.option) forKeyPath:self.keyPath];
+    }
 }
 
 - (void)setKeyPath:(NSString *)keyPath {
@@ -72,8 +80,10 @@
 }
 
 - (void)setSelectedIndex:(int)selectedIndex {
-    
-    self.option = [self.options objectAtIndex:self.selectedIndex];
+    if (selectedIndex >= self.options.count) {
+        return;
+    }
+    self.option = [self.options objectAtIndex:selectedIndex];
 }
 
 @end

+ 5 - 0
Redant Drivers/Apex And Drivers/Setting/Model/RASettingSectionModel.m

@@ -10,6 +10,7 @@
 #import "RASettingOptionModel.h"
 #import "RASettingSwitchModel.h"
 #import "RASettingActionModel.h"
+#import "RASettingAboutModel.h"
 
 @implementation RASettingSectionModel
 
@@ -42,6 +43,10 @@
                 model = [RASettingActionModel new];
             }
                 break;
+            case RASettingTypeAbout: {
+                model = [RASettingAboutModel new];
+            }
+                break;
                 
             default:
                 break;

+ 4 - 0
Redant Drivers/Apex And Drivers/Setting/Model/RASettingSwitchModel.m

@@ -10,6 +10,10 @@
 
 @implementation RASettingSwitchModel
 
+- (CGFloat)height {
+    return 60.0f;
+}
+
 - (void)setSwitchValue:(BOOL)switchValue {
     _switchValue = switchValue;
     

+ 2 - 0
Redant Drivers/Apex And Drivers/Setting/Option/RAOptionViewController.h

@@ -15,4 +15,6 @@
 
 @property (nonatomic,copy) NSString *optionTitle;
 
+@property (nonatomic,copy) void(^selectBlk)(NSInteger index);
+
 @end

+ 4 - 0
Redant Drivers/Apex And Drivers/Setting/Option/RAOptionViewController.m

@@ -104,6 +104,10 @@
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     self.selectedIndex = indexPath.row;
     
+    if (self.selectBlk) {
+        self.selectBlk(self.selectedIndex);
+    }
+    
     [tableView reloadData];
 }
 

+ 5 - 0
Redant Drivers/Apex And Drivers/Setting/RASettingViewController+TableDataSource.m

@@ -15,6 +15,7 @@
 #import "RASettingOptionCell.h"
 #import "RASettingSwitchCell.h"
 #import "RASettingActionCell.h"
+#import "RASettingAboutCell.h"
 
 @implementation RASettingViewController (TableDataSource)
 
@@ -50,6 +51,10 @@
             cell = [tableView dequeueReusableCellWithIdentifier:@"RASettingActionCell" forIndexPath:indexPath];
         }
             break;
+        case RASettingTypeAbout: {
+            cell = [tableView dequeueReusableCellWithIdentifier:@"RASettingAboutCell" forIndexPath:indexPath];
+        }
+            break;
         default: {
             cell = [RASettingBaseCell new];
         }

+ 55 - 10
Redant Drivers/Apex And Drivers/Setting/RASettingViewController+TableDelegate.m

@@ -17,7 +17,9 @@
 @implementation RASettingViewController (TableDelegate)
 
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
-    return 60.0f;
+    RASettingSectionModel *sectionModel = [self.sections objectAtIndex:indexPath.section];
+    RASettingBaseModel *model = [sectionModel.settings objectAtIndex:indexPath.row];
+    return model.height;
 }
 
 - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
@@ -46,15 +48,7 @@
             break;
         case RASettingTypeAction: {
             RASettingActionModel *actionModel = (RASettingActionModel *)model;
-            switch (actionModel.actionType) {
-                case RASettingActionTypeCleanCache: {
-                    
-                }
-                    break;
-                    
-                default:
-                    break;
-            }
+            [self clickAction:actionModel];
         }
             break;
         default: {
@@ -64,6 +58,54 @@
     
 }
 
+#pragma mark - Private Action
+
+- (void)clickAction:(RASettingActionModel *)model {
+    
+    switch (model.actionType) {
+        case RASettingActionTypeCleanCache: {
+            [self cleanDiskCache:model];
+        }
+            break;
+            
+        default:
+            break;
+    }
+}
+
+- (void)cleanDiskCache:(RASettingActionModel *)model {
+    model.active = YES;
+    
+    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"are you sure to clean cached file" preferredStyle:UIAlertControllerStyleAlert];
+    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+        model.active = NO;
+    }];
+    
+    UIAlertAction *yesAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        
+        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+            
+            NSFileManager *defaultManager = [NSFileManager defaultManager];
+            NSString *cacheDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
+            if ([defaultManager fileExistsAtPath:cacheDir]) {
+                [defaultManager removeItemAtPath:cacheDir error:nil];
+            }
+            sleep(1.0);
+            dispatch_async(dispatch_get_main_queue(), ^{
+                model.active = NO;
+            });
+        });
+        
+    }];
+    
+    
+    [alertVC addAction:cancelAction];
+    [alertVC addAction:yesAction];
+    
+    [self presentViewController:alertVC animated:YES completion:nil];
+}
+
 #pragma mark - Show Option
 
 - (void)showOption:(RASettingOptionModel *)model {
@@ -74,6 +116,9 @@
     
     RAOptionViewController *optionVC = [RAOptionViewController optionViewControllerWith:model.options selectedIndex:model.selectedIndex];
     optionVC.optionTitle = model.title;
+    optionVC.selectBlk = ^(NSInteger index) {
+        [model setSelectedIndex:(int)index];
+    };
     
     [self.navigationController pushViewController:optionVC animated:YES];
 }

+ 6 - 1
Redant Drivers/Apex And Drivers/Setting/RASettingViewController.m

@@ -41,7 +41,12 @@
 
 - (void)configTableView {
     
-    self.tableView.tableFooterView = [UIView new];
+    if (@available(iOS 11,*)) {
+        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+    } else {
+        self.automaticallyAdjustsScrollViewInsets = NO;
+    }
+    
     self.tableView.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1];
 }
 

+ 107 - 0
Redant Drivers/Apex And Drivers/Setting/setting.storyboard

@@ -21,6 +21,26 @@
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="bt6-9g-1Sc">
                                 <rect key="frame" x="0.0" y="20" width="375" height="647"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <view key="tableFooterView" contentMode="scaleToFill" id="JQO-83-Rit">
+                                    <rect key="frame" x="0.0" y="343" width="375" height="40"/>
+                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                    <subviews>
+                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="© 2014 United Software Applications, Inc." textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="n2h-5Z-NBM">
+                                            <rect key="frame" x="5" y="5" width="365" height="30"/>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                            <nil key="textColor"/>
+                                            <nil key="highlightedColor"/>
+                                        </label>
+                                    </subviews>
+                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    <constraints>
+                                        <constraint firstItem="n2h-5Z-NBM" firstAttribute="centerY" secondItem="JQO-83-Rit" secondAttribute="centerY" id="QOe-nO-Ihq"/>
+                                        <constraint firstItem="n2h-5Z-NBM" firstAttribute="leading" secondItem="JQO-83-Rit" secondAttribute="leading" constant="5" id="abW-kJ-dex"/>
+                                        <constraint firstAttribute="trailing" secondItem="n2h-5Z-NBM" secondAttribute="trailing" constant="5" id="qy5-Jc-qfr"/>
+                                        <constraint firstItem="n2h-5Z-NBM" firstAttribute="top" secondItem="JQO-83-Rit" secondAttribute="top" constant="5" id="zj2-8C-MjL"/>
+                                    </constraints>
+                                </view>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="RASettingOptionCell" rowHeight="60" id="S3b-rg-Apb" customClass="RASettingOptionCell">
                                         <rect key="frame" x="0.0" y="28" width="375" height="60"/>
@@ -122,6 +142,89 @@
                                             <outlet property="titleLabel" destination="rXI-of-ag8" id="vGF-n3-dC6"/>
                                         </connections>
                                     </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="RASettingAboutCell" rowHeight="135" id="vBr-qI-FKj" customClass="RASettingAboutCell">
+                                        <rect key="frame" x="0.0" y="208" width="375" height="135"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="vBr-qI-FKj" id="Tm1-Oc-7El">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="134.5"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_50" translatesAutoresizingMaskIntoConstraints="NO" id="Fjp-Bc-dUh">
+                                                    <rect key="frame" x="10" y="15" width="50" height="50"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="50" id="9Wc-23-pxR"/>
+                                                        <constraint firstAttribute="height" constant="50" id="qQc-UR-Wdf"/>
+                                                    </constraints>
+                                                </imageView>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Apex &amp; Drivers 1.0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Rt-Xa-P59">
+                                                    <rect key="frame" x="70" y="15" width="295" height="21"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="21" id="I4Z-WS-ohs"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="redant_40" translatesAutoresizingMaskIntoConstraints="NO" id="Dil-4Z-rVN">
+                                                    <rect key="frame" x="10" y="75" width="40" height="40"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="40" id="HgH-qQ-Zgv"/>
+                                                        <constraint firstAttribute="width" constant="40" id="o14-AU-INB"/>
+                                                    </constraints>
+                                                </imageView>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Ver:1.0 build 180913" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gMo-mB-JAI">
+                                                    <rect key="frame" x="70" y="41" width="295" height="21"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="21" id="oz7-pl-nM7"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" editable="NO" text="redantsupport@united-us.net" translatesAutoresizingMaskIntoConstraints="NO" id="PVK-zg-HWg">
+                                                    <rect key="frame" x="65" y="89.5" width="300" height="25"/>
+                                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="25" id="ccc-3X-Q0i"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                    <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+                                                    <dataDetectorType key="dataDetectorTypes" link="YES"/>
+                                                </textView>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Support:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wiy-uj-wOO">
+                                                    <rect key="frame" x="70" y="75" width="295" height="19.5"/>
+                                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="0Rt-Xa-P59" firstAttribute="top" secondItem="Fjp-Bc-dUh" secondAttribute="top" id="58E-tE-iL2"/>
+                                                <constraint firstItem="Dil-4Z-rVN" firstAttribute="top" secondItem="Fjp-Bc-dUh" secondAttribute="bottom" constant="10" id="8nh-5g-Bcy"/>
+                                                <constraint firstItem="gMo-mB-JAI" firstAttribute="trailing" secondItem="0Rt-Xa-P59" secondAttribute="trailing" id="AFf-9L-m16"/>
+                                                <constraint firstItem="PVK-zg-HWg" firstAttribute="trailing" secondItem="Wiy-uj-wOO" secondAttribute="trailing" id="E6r-yq-qJQ"/>
+                                                <constraint firstItem="gMo-mB-JAI" firstAttribute="top" secondItem="0Rt-Xa-P59" secondAttribute="bottom" constant="5" id="IDJ-3L-ym9"/>
+                                                <constraint firstItem="Fjp-Bc-dUh" firstAttribute="leading" secondItem="Tm1-Oc-7El" secondAttribute="leading" constant="10" id="LO4-zF-m0K"/>
+                                                <constraint firstAttribute="trailing" secondItem="0Rt-Xa-P59" secondAttribute="trailing" constant="10" id="O7Y-qk-rIU"/>
+                                                <constraint firstItem="PVK-zg-HWg" firstAttribute="top" secondItem="Wiy-uj-wOO" secondAttribute="bottom" constant="-5" id="Sge-bw-DDc"/>
+                                                <constraint firstItem="Wiy-uj-wOO" firstAttribute="leading" secondItem="gMo-mB-JAI" secondAttribute="leading" id="U7y-uf-WQP"/>
+                                                <constraint firstItem="0Rt-Xa-P59" firstAttribute="leading" secondItem="Fjp-Bc-dUh" secondAttribute="trailing" constant="10" id="Wy3-bY-364"/>
+                                                <constraint firstItem="Dil-4Z-rVN" firstAttribute="leading" secondItem="Fjp-Bc-dUh" secondAttribute="leading" id="ay3-Gs-u4L"/>
+                                                <constraint firstItem="Fjp-Bc-dUh" firstAttribute="top" secondItem="Tm1-Oc-7El" secondAttribute="top" constant="15" id="fan-pT-DB5"/>
+                                                <constraint firstItem="gMo-mB-JAI" firstAttribute="leading" secondItem="0Rt-Xa-P59" secondAttribute="leading" id="mly-Rf-Kdt"/>
+                                                <constraint firstItem="Wiy-uj-wOO" firstAttribute="top" secondItem="Dil-4Z-rVN" secondAttribute="top" id="n0f-ZA-t3t"/>
+                                                <constraint firstItem="Wiy-uj-wOO" firstAttribute="trailing" secondItem="gMo-mB-JAI" secondAttribute="trailing" id="wbU-Bz-G0R"/>
+                                                <constraint firstItem="PVK-zg-HWg" firstAttribute="leading" secondItem="Wiy-uj-wOO" secondAttribute="leading" constant="-5" id="zSk-dw-QdC"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="appIconView" destination="Fjp-Bc-dUh" id="WGr-ek-Xjx"/>
+                                            <outlet property="appNameLabel" destination="0Rt-Xa-P59" id="QbG-eT-auD"/>
+                                            <outlet property="appVerLabel" destination="gMo-mB-JAI" id="9hr-C3-Z6w"/>
+                                            <outlet property="redantLogoView" destination="Dil-4Z-rVN" id="07N-Rd-aUa"/>
+                                            <outlet property="supportLabel" destination="PVK-zg-HWg" id="tcj-pA-y90"/>
+                                        </connections>
+                                    </tableViewCell>
                                 </prototypes>
                                 <connections>
                                     <outlet property="dataSource" destination="K1Z-ea-fUh" id="17k-2P-W4r"/>
@@ -207,4 +310,8 @@
             <point key="canvasLocation" x="658" y="54"/>
         </scene>
     </scenes>
+    <resources>
+        <image name="icon_50" width="50" height="50"/>
+        <image name="redant_40" width="40" height="40"/>
+    </resources>
 </document>

+ 1 - 1
Redant Drivers/Apex And Drivers/UIImage+RedAnt.m

@@ -64,7 +64,7 @@ static dispatch_semaphore_t _lock;
 }
 
 + (NSString *)imageCacheDir {
-    return [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"ra_image"];
+    return [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"ImageCache"];
 }
 
 + (nullable NSString *)md5:(nullable NSString *)str {