|
@@ -14,7 +14,7 @@ import Speech
|
|
import Alamofire
|
|
import Alamofire
|
|
import WebKit
|
|
import WebKit
|
|
|
|
|
|
-class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
|
|
|
|
+class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMABDelegate {
|
|
let playerController = AVPlayerViewController()
|
|
let playerController = AVPlayerViewController()
|
|
static var sURL = "https://www.google.com"
|
|
static var sURL = "https://www.google.com"
|
|
static var tab3 = "0"
|
|
static var tab3 = "0"
|
|
@@ -50,6 +50,8 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
let term = "Terms of Service.".localized()
|
|
let term = "Terms of Service.".localized()
|
|
var firstLoad = true
|
|
var firstLoad = true
|
|
|
|
|
|
|
|
+ var notDoubleCall: Date?
|
|
|
|
+
|
|
public static var def: ViewController?
|
|
public static var def: ViewController?
|
|
|
|
|
|
override func viewDidLoad() {
|
|
override func viewDidLoad() {
|
|
@@ -150,8 +152,6 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
// navigationController?.setNavigationBarHidden(true, animated: false)
|
|
// navigationController?.setNavigationBarHidden(true, animated: false)
|
|
// }
|
|
// }
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
self.setViewControllers(tabs, animated: false)
|
|
self.setViewControllers(tabs, animated: false)
|
|
if(cpaasMode == PrefsUtil.CPAAS_MODE_DOCKED || cpaasMode == PrefsUtil.CPAAS_MODE_MIX){
|
|
if(cpaasMode == PrefsUtil.CPAAS_MODE_DOCKED || cpaasMode == PrefsUtil.CPAAS_MODE_MIX){
|
|
if(customTab.count == 3){
|
|
if(customTab.count == 3){
|
|
@@ -174,6 +174,17 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
tabBar.frame.origin.y = view.frame.height - 65
|
|
tabBar.frame.origin.y = view.frame.height - 65
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ func settingDelegate() {
|
|
|
|
+ if notDoubleCall != nil && Int(Date().timeIntervalSince(notDoubleCall!)) < 1 {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ notDoubleCall = Date()
|
|
|
|
+ if let vc = fourthTab == nil ? storyboard?.instantiateViewController(withIdentifier: "fourthTabVC") as? FourthTabViewController : fourthTab {
|
|
|
|
+ vc.notInTab = true
|
|
|
|
+ self.navigationController?.show(vc, sender: nil)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public static func checkIsChangePerson() -> Bool {
|
|
public static func checkIsChangePerson() -> Bool {
|
|
let isChangeProfile = Utils.getSetProfile()
|
|
let isChangeProfile = Utils.getSetProfile()
|
|
if !isChangeProfile {
|
|
if !isChangeProfile {
|
|
@@ -195,9 +206,19 @@ class ViewController: UITabBarController, UITabBarControllerDelegate {
|
|
ViewController.def?.show(b: false)
|
|
ViewController.def?.show(b: false)
|
|
ViewController.def?.thirdTab?.webView?.evaluateJavaScript("{if(pauseAll){pauseAll();}}")
|
|
ViewController.def?.thirdTab?.webView?.evaluateJavaScript("{if(pauseAll){pauseAll();}}")
|
|
ViewController.def?.firstTab?.webView?.evaluateJavaScript("{if(pauseAll){pauseAll();}}")
|
|
ViewController.def?.firstTab?.webView?.evaluateJavaScript("{if(pauseAll){pauseAll();}}")
|
|
- UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
- }))
|
|
|
|
- UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
|
|
+ let rootVC = UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController
|
|
|
|
+ if rootVC?.presentedViewController == nil {
|
|
|
|
+ rootVC?.present(navigationController, animated: true, completion: nil)
|
|
|
|
+ } else {
|
|
|
|
+ rootVC?.presentedViewController?.present(navigationController, animated: true, completion: nil)
|
|
|
|
+ }
|
|
|
|
+ }))
|
|
|
|
+ let rootVC = UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController
|
|
|
|
+ if rootVC?.presentedViewController == nil {
|
|
|
|
+ rootVC?.present(alert, animated: true, completion: nil)
|
|
|
|
+ } else {
|
|
|
|
+ rootVC?.presentedViewController?.present(alert, animated: true, completion: nil)
|
|
|
|
+ }
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
return true
|