Forráskód Böngészése

引导页启动页面完成

南鑫林 5 éve
szülő
commit
b43052b114
30 módosított fájl, 402 hozzáadás és 22 törlés
  1. 20 4
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 13 2
      RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift
  3. 1 1
      RainbowPlanet/RainbowPlanet/Manager/AliyunVodManager/AliyunVodUpToyoPublishManager/AliyunVodupToyoPublishManager.swift
  4. 1 2
      RainbowPlanet/RainbowPlanet/Manager/PathManager/PathManager.swift
  5. 1 1
      RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift
  6. 4 4
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListController.swift
  7. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneApp_60pt@2x.png
  8. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneApp_60pt@3x.png
  9. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneNotification_20pt@2x.png
  10. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneNotification_20pt@3x.png
  11. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight5_29pt@2x.png
  12. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight5_29pt@3x.png
  13. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight7_40pt@2x.png
  14. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight7_40pt@3x.png
  15. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconstore_1024pt.png
  16. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/default_logo.imageset/Contents.json
  17. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/default_logo.imageset/default_logo@2x.png
  18. 6 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/Contents.json
  19. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_1.imageset/Contents.json
  20. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_1.imageset/guide_1@2x.jpg
  21. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_2.imageset/Contents.json
  22. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_2.imageset/guide_2@2x.jpg
  23. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_3.imageset/Contents.json
  24. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_3.imageset/guide_3@2x.jpg
  25. 21 0
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_4.imageset/Contents.json
  26. BIN
      RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_4.imageset/guide_4@2x.jpg
  27. 16 7
      RainbowPlanet/RainbowPlanet/Supporting Files/Launch Screen.storyboard
  28. 131 0
      RainbowPlanet/RainbowPlanet/Tools/GuidePageView/GuidePageView.swift
  29. 103 0
      RainbowPlanet/RainbowPlanet/Tools/GuidePageView/GuidePageViewCell.swift
  30. 1 1
      RainbowPlanet/RainbowPlanet/Tools/SwViewCapture/UIScrollView+SwCapture.swift

+ 20 - 4
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -440,6 +440,9 @@
 		A7E19FB122BA3A0D009BCCE1 /* SearchTopicListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E19FB022BA3A0D009BCCE1 /* SearchTopicListTableViewCell.swift */; };
 		A7EF3E0C23013EDE001E4D26 /* CommunityImageAuthModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7EF3E0B23013EDE001E4D26 /* CommunityImageAuthModel.swift */; };
 		A7EF3E0E2302D031001E4D26 /* CommunityVideoBottomActionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7EF3E0D2302D031001E4D26 /* CommunityVideoBottomActionView.swift */; };
+		A7EF3E102303DAEE001E4D26 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7EF3E0F2303DAEE001E4D26 /* Launch Screen.storyboard */; };
+		A7EF3E132303EB7C001E4D26 /* GuidePageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7EF3E122303EB7C001E4D26 /* GuidePageView.swift */; };
+		A7EF3E152303EC09001E4D26 /* GuidePageViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7EF3E142303EC09001E4D26 /* GuidePageViewCell.swift */; };
 		A7F2D6BD22B09F930093000B /* CommunityNavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6BC22B09F930093000B /* CommunityNavigationBarView.swift */; };
 		A7F2D6C122B0D1CB0093000B /* CommunityFollowTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6C022B0D1CB0093000B /* CommunityFollowTableHeaderView.swift */; };
 		A7F2D6C622B0DC7B0093000B /* CommunityCommonSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F2D6C522B0DC7B0093000B /* CommunityCommonSectionHeaderView.swift */; };
@@ -458,7 +461,6 @@
 		A7F577C322FD894F00E2D757 /* ATAuthSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7F577C022FD894F00E2D757 /* ATAuthSDK.framework */; };
 		A7F577C422FD894F00E2D757 /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A7F577C122FD894F00E2D757 /* ATAuthSDK.bundle */; };
 		A7F577C522FD894F00E2D757 /* TYRZResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = A7F577C222FD894F00E2D757 /* TYRZResource.bundle */; };
-		A7F577C822FE96C600E2D757 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A7F577C722FE96C600E2D757 /* Launch Screen.storyboard */; };
 		A7F577CD22FECD7C00E2D757 /* AliyunVodupToyoPublishManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F577CC22FECD7C00E2D757 /* AliyunVodupToyoPublishManager.swift */; };
 		A7F577D122FECE8700E2D757 /* AliyunVodUpToYoPublishModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F577D022FECE8700E2D757 /* AliyunVodUpToYoPublishModel.swift */; };
 		A7F577D722FED3A100E2D757 /* PathManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F577D622FED3A100E2D757 /* PathManager.swift */; };
@@ -1168,6 +1170,9 @@
 		A7E19FB022BA3A0D009BCCE1 /* SearchTopicListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTopicListTableViewCell.swift; sourceTree = "<group>"; };
 		A7EF3E0B23013EDE001E4D26 /* CommunityImageAuthModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityImageAuthModel.swift; sourceTree = "<group>"; };
 		A7EF3E0D2302D031001E4D26 /* CommunityVideoBottomActionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityVideoBottomActionView.swift; sourceTree = "<group>"; };
+		A7EF3E0F2303DAEE001E4D26 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
+		A7EF3E122303EB7C001E4D26 /* GuidePageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidePageView.swift; sourceTree = "<group>"; };
+		A7EF3E142303EC09001E4D26 /* GuidePageViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuidePageViewCell.swift; sourceTree = "<group>"; };
 		A7F2D6BC22B09F930093000B /* CommunityNavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityNavigationBarView.swift; sourceTree = "<group>"; };
 		A7F2D6C022B0D1CB0093000B /* CommunityFollowTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityFollowTableHeaderView.swift; sourceTree = "<group>"; };
 		A7F2D6C522B0DC7B0093000B /* CommunityCommonSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityCommonSectionHeaderView.swift; sourceTree = "<group>"; };
@@ -1187,7 +1192,6 @@
 		A7F577C022FD894F00E2D757 /* ATAuthSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ATAuthSDK.framework; path = "../../../../../../../Downloads/号码认证及一键登录iOS SDK v2.6.5_demo工程代码/Release/ATAuthSDK.framework"; sourceTree = "<group>"; };
 		A7F577C122FD894F00E2D757 /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; };
 		A7F577C222FD894F00E2D757 /* TYRZResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TYRZResource.bundle; sourceTree = "<group>"; };
-		A7F577C722FE96C600E2D757 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
 		A7F577CC22FECD7C00E2D757 /* AliyunVodupToyoPublishManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AliyunVodupToyoPublishManager.swift; sourceTree = "<group>"; };
 		A7F577D022FECE8700E2D757 /* AliyunVodUpToYoPublishModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AliyunVodUpToYoPublishModel.swift; sourceTree = "<group>"; };
 		A7F577D622FED3A100E2D757 /* PathManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PathManager.swift; sourceTree = "<group>"; };
@@ -3358,7 +3362,7 @@
 				A7BF202622B3930100396DB3 /* MessageModule.xcassets */,
 				BD24FABA22B509CF00C7AA3B /* PublishModule.xcassets */,
 				A76068E322E47E0E008DF18F /* RegisterLoginModule.xcassets */,
-				A7F577C722FE96C600E2D757 /* Launch Screen.storyboard */,
+				A7EF3E0F2303DAEE001E4D26 /* Launch Screen.storyboard */,
 				A77F2C6C2231FB4A001BD3F6 /* Info.plist */,
 				A7F577BB22FD7A9B00E2D757 /* RainbowPlanet.entitlements */,
 			);
@@ -3368,6 +3372,7 @@
 		A77F2CBC2232022A001BD3F6 /* Tools */ = {
 			isa = PBXGroup;
 			children = (
+				A7EF3E112303EB6C001E4D26 /* GuidePageView */,
 				A76068F122E4B0ED008DF18F /* UImage+Gif */,
 				BD5CA89322DDA27000364A67 /* CustomSlider */,
 				A7297C6422D72F7F001A7AE6 /* KeyBoardCommentView */,
@@ -4473,6 +4478,15 @@
 			path = View;
 			sourceTree = "<group>";
 		};
+		A7EF3E112303EB6C001E4D26 /* GuidePageView */ = {
+			isa = PBXGroup;
+			children = (
+				A7EF3E122303EB7C001E4D26 /* GuidePageView.swift */,
+				A7EF3E142303EC09001E4D26 /* GuidePageViewCell.swift */,
+			);
+			path = GuidePageView;
+			sourceTree = "<group>";
+		};
 		A7F2D6C322B0DBBB0093000B /* Header */ = {
 			isa = PBXGroup;
 			children = (
@@ -5910,7 +5924,7 @@
 				BDD5483422C31752005BBE19 /* AlivcShortVideoImage.bundle in Resources */,
 				A7CC74DE22703B4A003C4F38 /* MineModule.xcassets in Resources */,
 				A7BF202422B392D600396DB3 /* CommunityModule.xcassets in Resources */,
-				A7F577C822FE96C600E2D757 /* Launch Screen.storyboard in Resources */,
+				A7EF3E102303DAEE001E4D26 /* Launch Screen.storyboard in Resources */,
 				BDD54A2522C31D5F005BBE19 /* music.json in Resources */,
 				A76068E922E4922F008DF18F /* Skittles.json in Resources */,
 				A71AF0BE226F1792001730FE /* ShoppingMallModule.xcassets in Resources */,
@@ -6108,6 +6122,7 @@
 				A7A98DFF227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift in Sources */,
 				A71CAB3B22C9F21100D908A8 /* CommunityMemberFollowTopicListModel.swift in Sources */,
 				BDE376D922C22A260055E2EA /* UIColor+AlivcHelper.m in Sources */,
+				A7EF3E152303EC09001E4D26 /* GuidePageViewCell.swift in Sources */,
 				BD0FAA3722C465B900DDFB37 /* AliyunEditViewController.m in Sources */,
 				BDDF3B28228EBB72003A7D16 /* ProductRefundReasonModel.swift in Sources */,
 				BDD4FB1222840597006FE833 /* ShoppingCartPayOrderController.swift in Sources */,
@@ -6539,6 +6554,7 @@
 				BD61229722C3605C00D3F513 /* AliyunEffectPrestoreManager.m in Sources */,
 				A70B2C3E228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift in Sources */,
 				A7DAB33322D881F5005B964E /* H5RouterModuleType.swift in Sources */,
+				A7EF3E132303EB7C001E4D26 /* GuidePageView.swift in Sources */,
 				A79057022276C9770037F823 /* SetPasswordModel.swift in Sources */,
 				BD12B68022B4EF2600AEB10B /* KSMediaPickerViewImageCell.swift in Sources */,
 				A7274C5A228EE636000E3A07 /* LBXScanView.swift in Sources */,

+ 13 - 2
RainbowPlanet/RainbowPlanet/AppDelegate/AppDelegate+Window.swift

@@ -15,14 +15,19 @@ extension AppDelegate {
         
         window = UIWindow.init(frame: UIScreen.main.bounds)
         window?.backgroundColor = UIColor.white
+        window?.makeKeyAndVisible()
         let vc = UIViewController()
         vc.view.backgroundColor = UIColor.clear
         window?.rootViewController = vc
+
+        /// 城市转换
         setBaiduToCityFactory()
         /// 设置全局的tabbar
         setTabbarAppearence()
         /// 设置全局的navigation
         setNavBarAppearence()
+        /// 设置全局的TableView
+        setTableViewAppearance()
         /// 设置默认为快递
         let deliveryMethodTypeModel = DeliveryMethodTypeModel.shared()
         deliveryMethodTypeModel.deliveryMethodType = "2"
@@ -33,7 +38,6 @@ extension AppDelegate {
         setTabbarController()
         /// 引导页
         setGuidePageView()
-        window?.makeKeyAndVisible()
 
     }
     
@@ -104,6 +108,13 @@ extension AppDelegate {
         UITabBar.appearance().backgroundColor = UIColor.white
         UITabBar.appearance().shadowImage = UIImage(named: "tab_top_line")
     }
+    
+    /// UITableView全局
+    func setTableViewAppearance() {
+        UITableView.appearance().estimatedRowHeight = 0
+        UITableView.appearance().estimatedSectionHeaderHeight = 0
+        UITableView.appearance().estimatedSectionFooterHeight = 0
+    }
 
     
     ///设置百度city转
@@ -113,7 +124,7 @@ extension AppDelegate {
 
     //设置引导页
     func setGuidePageView() {
-        
+        GuidePageView.guidePageView(images: ["guide_1","guide_2","guide_3","guide_4"])
     }
     
 }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Manager/AliyunVodManager/AliyunVodUpToyoPublishManager/AliyunVodupToyoPublishManager.swift

@@ -144,8 +144,8 @@ extension AliyunVodUpToyoPublishManager {
         if !(aliyunVodUpToYoPublishModel?.images?.isEmpty ?? true) {
             var imageUrlPaths = Array<String>()
             for image in (aliyunVodUpToYoPublishModel?.images)! {
-                let imagePath: String = (AliyunPathManager.compositionRootDir()?.appending(AliyunPathManager.randomString()))!
 
+                let imagePath: String = (PathManager.tmpPath() ?? "") + (PathManager.randomString() ?? "")
                 let imgData: Data? = UIImage.pngData(image)()
                 do {
                     try imgData?.write(to: URL(fileURLWithPath: imagePath))

+ 1 - 2
RainbowPlanet/RainbowPlanet/Manager/PathManager/PathManager.swift

@@ -41,7 +41,7 @@ class PathManager: NSObject {
     /// 获取tmp目录  ./tmp
     ///
     /// - Returns: 获取tmp目录
-    private class func tmpPath() -> String? {
+    class func tmpPath() -> String? {
         return NSTemporaryDirectory()
     }
 }
@@ -145,7 +145,6 @@ extension PathManager {
     class func projectRelativeDocumentPath() -> String? {
         return "Documents/" + Bundle.main.bundleIdentifier! + "/.project"
     }
-
 }
 
 extension PathManager {

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Follow/CommunityFollowViewController.swift

@@ -313,7 +313,7 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
         }else  if !(communityFollowDataModels?.isEmpty ?? true) && (cmsMemberModels?.isEmpty ?? true){
             return (communityFollowDataModels?.isEmpty ?? true) ? 0 : communityFollowDataModels?.count ?? 0
         }else {
-            return communityFollowDataModels?.count ?? 0 + 1
+            return (communityFollowDataModels?.count ?? 0) + 1
         }
     }
     

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListController.swift

@@ -66,9 +66,9 @@ class PublishMusicListController: BaseViewController {
         tableView.backgroundColor = UIColor.clear
         tableView.dataSource = self
         tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
+        tableView.estimatedRowHeight = 0
+        tableView.estimatedSectionFooterHeight = 0
+        tableView.estimatedSectionHeaderHeight = 0
         return tableView
     }()
     
@@ -117,7 +117,7 @@ extension PublishMusicListController : UITableViewDelegate, UITableViewDataSourc
     }
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 0
+        return 0.000001
     }
     
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneApp_60pt@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneApp_60pt@3x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneNotification_20pt@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneNotification_20pt@3x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight5_29pt@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight5_29pt@3x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight7_40pt@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconiPhoneSpootlight7_40pt@3x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/AppIcon.appiconset/AppIconstore_1024pt.png


+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/default_logo.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/default_logo.imageset/default_logo@2x.png


+ 6 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_1.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_1.imageset/guide_1@2x.jpg


+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_2.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_2.imageset/guide_2@2x.jpg


+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_3.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_3.imageset/guide_3@2x.jpg


+ 21 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_4.imageset/Contents.json

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

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/Assets.xcassets/guide/guide_4.imageset/guide_4@2x.jpg


+ 16 - 7
RainbowPlanet/RainbowPlanet/Supporting Files/Launch Screen.storyboard

@@ -18,18 +18,27 @@
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="news_logo" translatesAutoresizingMaskIntoConstraints="NO" id="qwh-gD-Vh3">
-                                <rect key="frame" x="157" y="403" width="100" height="100"/>
+                            <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 由你 版权所有" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
+                                <rect key="frame" x="0.0" y="837.5" width="414" height="14.5"/>
+                                <fontDescription key="fontDescription" type="system" weight="thin" pointSize="12"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_logo" translatesAutoresizingMaskIntoConstraints="NO" id="xvS-ua-mvp">
+                                <rect key="frame" x="127.5" y="278" width="159" height="83"/>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="100" id="eAl-ha-OR3"/>
-                                    <constraint firstAttribute="width" constant="100" id="wpH-Vd-Obu"/>
+                                    <constraint firstAttribute="width" constant="159" id="Vfh-8p-ezm"/>
+                                    <constraint firstAttribute="height" constant="83" id="ZXR-zb-Khl"/>
                                 </constraints>
                             </imageView>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
-                            <constraint firstItem="qwh-gD-Vh3" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="AUz-BA-Kgm"/>
-                            <constraint firstItem="qwh-gD-Vh3" firstAttribute="centerY" secondItem="Bcu-3y-fUS" secondAttribute="centerY" id="bFv-s3-gy0"/>
+                            <constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
+                            <constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="SfN-ll-jLj"/>
+                            <constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="44" id="Y44-ml-fuU"/>
+                            <constraint firstItem="xvS-ua-mvp" firstAttribute="top" secondItem="Bcu-3y-fUS" secondAttribute="top" multiplier="16:9" constant="200" id="msg-sb-ZkI"/>
+                            <constraint firstItem="xvS-ua-mvp" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="sS8-sQ-56x"/>
                         </constraints>
                         <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
                     </view>
@@ -40,6 +49,6 @@
         </scene>
     </scenes>
     <resources>
-        <image name="news_logo" width="19" height="19"/>
+        <image name="default_logo" width="159" height="83"/>
     </resources>
 </document>

+ 131 - 0
RainbowPlanet/RainbowPlanet/Tools/GuidePageView/GuidePageView.swift

@@ -0,0 +1,131 @@
+//
+//  GuidePageView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/8/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import FSPagerView
+
+class GuidePageView: UIView {
+    
+    deinit {
+        NXLLog("deinit")
+    }
+
+    /// 图片数组
+    private var images : Array<String>?
+    
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    init(frame:CGRect,images:Array<String>?) {
+        self.init()
+        self.images = images
+        self.frame = frame
+        setupViews()
+        setupLayouts()
+    }
+    
+    
+    func setupViews() {
+        addSubview(pagerView)
+        addSubview(pageControl)
+    }
+    
+    func setupLayouts() {
+        pagerView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+        
+        let pageControlWidth = CGFloat((self.images?.count)! - 1) * 8 +  CGFloat((self.images?.count)! - 1) * 15 + 24
+        
+        pageControl.snp.makeConstraints { (make) in
+            make.centerX.equalToSuperview()
+            make.bottom.equalTo(-50)
+            make.height.equalTo(8)
+            make.width.equalTo(pageControlWidth)
+        }
+    }
+    
+    private lazy var pagerView: FSPagerView = {
+        let pagerView = FSPagerView(frame: CGRect.zero)
+        pagerView.backgroundColor = kf7f8faColor
+        pagerView.delegate = self
+        pagerView.dataSource = self
+        pagerView.scrollDirection = .horizontal
+        pagerView.bounces = false
+        pagerView.isInfinite = false
+        pagerView.automaticSlidingInterval = 0
+        return pagerView
+    }()
+    
+    private lazy var pageControl: NXLPageControl = {
+        let pageControl = NXLPageControl()
+        pageControl.numberOfPages = self.images?.count ?? 0
+        pageControl.pointSize = CGSize.init(width: 8, height: 8)
+        pageControl.currentWidthMultiple = 3//当前点的宽度为其他点的3倍
+        pageControl.localPointSpace = 15
+        pageControl.currentColor = UIColor.black
+        pageControl.otherColor = kEDEEF0Color
+        pageControl.clickPoint { _ in }
+        return pageControl
+    }()
+    
+    //MARK: - 移除所有的View
+    private func removeGuideViewFromSupview() {
+        UIView.animate(withDuration: 1.0, delay: 0, options: UIView.AnimationOptions.curveEaseOut, animations: { [weak self] in
+            self?.alpha = 0.0
+        }) { [weak self] (_) in
+            self?.removeFromSuperview()
+        }
+    }
+    
+    class func guidePageView(images:Array<String>?) {
+        if UserDefaults.isFirstLaunchOfNewVersion() {
+            let window = UIApplication.shared.windows.last
+            let guidePageView = GuidePageView.init(frame:UIScreen.main.bounds,images: images)
+            window?.addSubview(guidePageView)
+        }
+    }
+    
+}
+
+extension GuidePageView :FSPagerViewDataSource,FSPagerViewDelegate {
+    func numberOfItems(in pagerView: FSPagerView) -> Int {
+        return images?.count ?? 0
+    }
+    func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
+        let cell  = GuidePageViewCell.cellWith(pagerView: pagerView, index: index)
+        cell.images = images
+        cell.startClosure = {
+            [weak self] in
+            self?.removeGuideViewFromSupview()
+        }
+
+        return cell
+    }
+
+    func pagerView(_ pagerView: FSPagerView, didSelectItemAt index: Int) {
+        pagerView.deselectItem(at: index, animated: true)
+    }
+    
+    func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
+        self.pageControl.currentPage = targetIndex
+        if targetIndex == (images?.count ?? 1) - 1 {
+            self.pageControl.isHidden = true
+        }else {
+            self.pageControl.isHidden = false
+        }
+    }
+    func pagerViewDidEndScrollAnimation(_ pagerView: FSPagerView) {
+        self.pageControl.currentPage = pagerView.currentIndex
+    }
+}

+ 103 - 0
RainbowPlanet/RainbowPlanet/Tools/GuidePageView/GuidePageViewCell.swift

@@ -0,0 +1,103 @@
+//
+//  File.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/8/14.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+import FSPagerView
+import RxSwift
+
+class GuidePageViewCell: FSPagerViewCell {
+    deinit {
+        NXLLog("deinint")
+    }
+    
+    class func cellWith(pagerView:FSPagerView,index:Int) -> GuidePageViewCell {
+        let ID = "GuidePageViewCell"
+        pagerView.register(GuidePageViewCell.self, forCellWithReuseIdentifier: ID)
+        let cell : GuidePageViewCell =
+            pagerView.dequeueReusableCell(withReuseIdentifier: ID, at: index) as! GuidePageViewCell
+        cell.index = index
+        return cell
+    }
+    
+    let disposeBag = DisposeBag()
+    
+    typealias StartClosure = () -> Void
+    var startClosure : StartClosure?
+    
+    //MARK: - indexPath
+    var index: Int?
+    //MARK: - 初始化
+    override init(frame: CGRect) {
+        super.init(frame: frame)
+        setupViews()
+        setupLayouts()
+        setupdata()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    //MARK: - 设置view
+    private func setupViews() {
+        addSubview(bgImageView)
+        addSubview(startButton)
+    }
+    
+    private func setupLayouts() {
+        bgImageView.snp.makeConstraints { (make) in
+            make.top.bottom.left.right.equalToSuperview()
+        }
+        startButton.snp.makeConstraints { (make) in
+            make.bottom.equalTo(-50)
+            make.height.equalTo(44)
+            make.left.equalTo(52.5)
+            make.right.equalTo(-52.5)
+        }
+    }
+    
+    private func setupdata() {
+        startButton.rx.tap.subscribe(onNext: { [weak self] _ in
+            if let startClosure = self?.startClosure {
+                startClosure()
+            }
+        }).disposed(by: disposeBag)
+    }
+    
+    private lazy var bgImageView: UIImageView = {
+        let bgImageView = UIImageView()
+        bgImageView.isUserInteractionEnabled = true
+        bgImageView.contentMode = .scaleAspectFill
+        bgImageView.clipsToBounds = true
+        return bgImageView
+    }()
+    
+    private lazy var startButton: UIButton = {
+        let startButton = UIButton(type: UIButton.ButtonType.custom)
+        startButton.backgroundColor = UIColor.black
+        startButton.setTitle("开启由你", for: UIControl.State.normal)
+        startButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        startButton.titleLabel?.font = kBoldFont20
+        startButton.isHidden = true
+        startButton.cornerRadius = 22
+        startButton.masksToBounds = true
+        return startButton
+    }()
+    
+    var images : Array<String>? {
+        didSet{
+            bgImageView.image = kImage(name: images?[index!] ?? "default_pic")
+            if index == (images?.count ?? 1) - 1 {
+                startButton.isHidden = false
+            }else {
+                startButton.isHidden = true
+            }
+        }
+    }
+    
+}

+ 1 - 1
RainbowPlanet/RainbowPlanet/Tools/SwViewCapture/UIScrollView+SwCapture.swift

@@ -61,7 +61,7 @@ public extension UIScrollView {
         
         // Swizzling setFrame
         let method: Method = class_getInstanceMethod(object_getClass(self), #selector(setter: UIView.frame))!
-        let swizzledMethod: Method = class_getInstanceMethod(object_getClass(self), Selector(("swSetFrame:")))!
+        let swizzledMethod: Method = class_getInstanceMethod(object_getClass(self), #selector(UIView.swSetFrame(_:)))!
         method_exchangeImplementations(method, swizzledMethod)
         
         // Sometimes ScrollView will Capture nothing without defer;