Explorar o código

SwiftWebVC modify

Marino Faggiana %!s(int64=8) %!d(string=hai) anos
pai
achega
9b4736a430

+ 4 - 13
iOSClient/Library/SwiftWebVC/SwiftModalWebVC.swift

@@ -19,7 +19,7 @@ public class SwiftModalWebVC: UINavigationController {
     public weak var delegateWeb: SwiftModalWebVCDelegate?
     
     public enum SwiftModalWebVCTheme {
-        case lightBlue, lightBlack, dark, customLoginWeb
+        case lightBlue, lightBlack, dark, loginWeb
     }
     
     weak var webViewDelegate: UIWebViewDelegate? = nil
@@ -32,10 +32,6 @@ public class SwiftModalWebVC: UINavigationController {
         self.init(pageURL: URL(string: urlString)!, theme: theme)
     }
     
-    public convenience init(urlString: String, theme: SwiftModalWebVCTheme, color : UIColor) {
-        self.init(pageURL: URL(string: urlString)!, theme: theme, color: color)
-    }
-    
     public convenience init(pageURL: URL) {
         self.init(request: URLRequest(url: pageURL))
     }
@@ -44,10 +40,6 @@ public class SwiftModalWebVC: UINavigationController {
         self.init(request: URLRequest(url: pageURL), theme: theme)
     }
    
-    public convenience init(pageURL: URL, theme: SwiftModalWebVCTheme, color : UIColor) {
-        self.init(request: URLRequest(url: pageURL), theme: theme, color: color)
-    }
-    
     public init(request: URLRequest, theme: SwiftModalWebVCTheme = .dark, color : UIColor = UIColor.clear) {
         
         let webViewController = SwiftWebVC(aRequest: request)
@@ -57,7 +49,7 @@ public class SwiftModalWebVC: UINavigationController {
                                          style: UIBarButtonItemStyle.plain,
                                          target: webViewController,
                                          action: #selector(SwiftWebVC.doneButtonTapped))
-        
+    
         switch theme {
         case .lightBlue:
             doneButton.tintColor = nil
@@ -74,13 +66,12 @@ public class SwiftModalWebVC: UINavigationController {
             webViewController.buttonColor = UIColor.white
             webViewController.titleColor = UIColor.groupTableViewBackground
             UINavigationBar.appearance().barStyle = UIBarStyle.black
-        case .customLoginWeb:
+        case .loginWeb:
             webViewController.buttonColor = UIColor.white
             UINavigationBar.appearance().barStyle = UIBarStyle.default
-            UINavigationBar.appearance().tintColor = color
         }
         
-        if (theme != .customLoginWeb) {
+        if (theme != .loginWeb) {
             if (UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad) {
                 webViewController.navigationItem.leftBarButtonItem = doneButton
             }

+ 1 - 1
iOSClient/Login/CCLoginWeb.swift

@@ -20,7 +20,7 @@ class CCLoginWeb: UIViewController {
     
     func presentModalWithDefaultTheme(_ vc: UIViewController) {
                 
-        let webVC = SwiftModalWebVC(urlString: k_loginBaseUrl, theme: .customLoginWeb, color: UIColor.red)
+        let webVC = SwiftModalWebVC(urlString: k_loginBaseUrl, theme: .loginWeb)
         webVC.delegateWeb = self
         vc.present(webVC, animated: true, completion: nil)
     }