jeremy 5 éve
szülő
commit
deb392218c

+ 14 - 2
RainbowPlanet/RainbowPlanet/Manager/AppStoreManager/AppStoreManager.swift

@@ -21,12 +21,24 @@ class AppStoreManager: NSObject {
     
     /// 跳转到AppStore
     func appStore() {
-        UIApplication.shared.openURL(URL(string: kAppStore)!)
+        if let appStoreURL:URL = URL(string: kAppStore) {
+            if #available(iOS 10, *) {
+                UIApplication.shared.open(appStoreURL, options: [:], completionHandler: nil)
+            } else {
+                UIApplication.shared.openURL(appStoreURL)
+            }
+        }
     }
     
     /// 跳转到AppStore评论
     func appStoreReview() {
-        UIApplication.shared.openURL(URL(string: kAppStoreReview)!)
+        if let appStoreReviewURL:URL = URL(string: kAppStoreReview) {
+            if #available(iOS 10, *) {
+                UIApplication.shared.open(appStoreReviewURL, options: [:], completionHandler: nil)
+            } else {
+                UIApplication.shared.openURL(appStoreReviewURL)
+            }
+        }
     }
     
     ///只能评分,且一年只能使用三次弹框。

+ 3 - 3
RainbowPlanet/RainbowPlanet/Model/WVJBModel/WVJBModel.swift

@@ -32,7 +32,7 @@ class WVJBModel:NSObject,Mappable{
     var modelType : WVJBModelType?
     var type : String? {
         didSet {
-           modelType = WVJBModelType(rawValue: type ?? "") ?? .none
+            modelType = WVJBModelType(rawValue: type ?? "") ?? WVJBModelType.none
         }
     }
     var params : WVJBParamsModel?
@@ -98,7 +98,7 @@ class WVJBParamsModel:NSObject,Mappable {
     var paramsModelType : WVJBParamsModelType?
     var type : String? {
         didSet {
-            paramsModelType = WVJBParamsModelType(rawValue: type ?? "") ?? .none
+            paramsModelType = WVJBParamsModelType(rawValue: type ?? "") ?? WVJBParamsModelType.none
             
         }
     }
@@ -106,7 +106,7 @@ class WVJBParamsModel:NSObject,Mappable {
     var paramsModelPage : WVJBParamsModelPage?
     var page :String? {
         didSet {
-            paramsModelPage = WVJBParamsModelPage(rawValue: page ?? "") ?? .none
+            paramsModelPage = WVJBParamsModelPage(rawValue: page ?? "") ?? WVJBParamsModelPage.none
         }
     }
     

+ 5 - 1
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/CommunityPlanetViewController.swift

@@ -95,7 +95,11 @@ extension CommunityPlanetViewController : WKNavigationDelegate {
                 decisionHandler(.cancel);
                 //用openURL 这个API打电话
                 if let mobileURL:URL = URL(string: requestURL) {
-                    UIApplication.shared.openURL(mobileURL)
+                    if #available(iOS 10, *) {
+                        UIApplication.shared.open(mobileURL, options: [:], completionHandler: nil)
+                    } else {
+                        UIApplication.shared.openURL(mobileURL)
+                    }
                 }
             }
             

+ 5 - 1
RainbowPlanet/RainbowPlanet/Modules/H5Modules/H5Common/ViewController/H5CommonViewController.swift

@@ -95,7 +95,11 @@ extension H5CommonViewController : WKNavigationDelegate  {
                 decisionHandler(.cancel);
                 //用openURL 这个API打电话
                 if let mobileURL:URL = URL(string: requestURL) {
-                    UIApplication.shared.openURL(mobileURL)
+                    if #available(iOS 10, *) {
+                        UIApplication.shared.open(mobileURL, options: [:], completionHandler: nil)
+                    } else {
+                        UIApplication.shared.openURL(mobileURL)
+                    }
                 }
             }
             

+ 5 - 1
RainbowPlanet/RainbowPlanet/Tools/WKWebView/WebView.swift

@@ -228,7 +228,11 @@ extension WebView: WKNavigationDelegate{
                 decisionHandler(.cancel);
                 //用openURL 这个API打电话
                 if let mobileURL:URL = URL(string: requestURL) {
-                    UIApplication.shared.openURL(mobileURL)
+                    if #available(iOS 10, *) {
+                        UIApplication.shared.open(mobileURL, options: [:], completionHandler: nil)
+                    } else {
+                        UIApplication.shared.openURL(mobileURL)
+                    }
                 }
             }