|
@@ -123,142 +123,142 @@ public class Nexilis: NSObject {
|
|
}
|
|
}
|
|
|
|
|
|
public static func connect(apiKey: String, delegate: ConnectDelegate, showButton: Bool = true, fromMAB: Bool = false) {
|
|
public static func connect(apiKey: String, delegate: ConnectDelegate, showButton: Bool = true, fromMAB: Bool = false) {
|
|
- do {
|
|
|
|
- showFB = showButton
|
|
|
|
-
|
|
|
|
- Nexilis.shared.createDelegate()
|
|
|
|
-
|
|
|
|
- Nexilis.sAPIKey = apiKey
|
|
|
|
-
|
|
|
|
- Nexilis.showButtonFB = showButton
|
|
|
|
-
|
|
|
|
- Database.shared.openDatabase()
|
|
|
|
-
|
|
|
|
- IncomingThread.default.run()
|
|
|
|
-
|
|
|
|
- imageCache.countLimit = 100
|
|
|
|
- imageCache.totalCostLimit = 1024 * 1024 * 200
|
|
|
|
-
|
|
|
|
- let address = Nexilis.getAddressNew(apiKey:apiKey)
|
|
|
|
-// print("ADDRESS \(address)")
|
|
|
|
- if address.isEmpty {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-// UserDefaults.standard.set(address, forKey: "address")
|
|
|
|
-// UserDefaults.standard.set(address[0], forKey: "server")
|
|
|
|
-//
|
|
|
|
- Nexilis.dispatch = DispatchGroup()
|
|
|
|
- Nexilis.dispatch?.enter()
|
|
|
|
-// var server = UserDefaults.standard.string(forKey: "server")
|
|
|
|
-// if let s = server, let a = UserDefaults.standard.stringArray(forKey: "address"), s != a[0] {
|
|
|
|
-// server = a[0]
|
|
|
|
-// UserDefaults.standard.set(server, forKey: "server")
|
|
|
|
-// }
|
|
|
|
-// var ip = ""
|
|
|
|
-// var port = 0
|
|
|
|
-// if let s = server {
|
|
|
|
-// let data = s.split(separator: ":")
|
|
|
|
-// ip = String(data[0])
|
|
|
|
-// if let p = Int(data[1]) {
|
|
|
|
-// port = p
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
- Nexilis.ADDRESS = address.components(separatedBy: ":")[0]
|
|
|
|
- Nexilis.PORT = Int(address.components(separatedBy: ":")[1]) ?? 0
|
|
|
|
-// print("IP PORT \(Nexilis.ADDRESS) <> \(Nexilis.PORT)")
|
|
|
|
- var id = ""
|
|
|
|
- if let device_id = UserDefaults.standard.string(forKey: "device_id") {
|
|
|
|
- try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: device_id, sStartWH: "09:00")
|
|
|
|
- } else if let me = UserDefaults.standard.string(forKey: "me") {
|
|
|
|
- try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: me, sStartWH: "09:00")
|
|
|
|
- } else {
|
|
|
|
- let uuid = UIDevice.current.identifierForVendor?.uuidString ?? "UNK-DEVICE"
|
|
|
|
- try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: uuid, sStartWH: "09:00")
|
|
|
|
- id = uuid
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // wait until connection true
|
|
|
|
- Nexilis.dispatch?.wait()
|
|
|
|
- Nexilis.dispatch = nil
|
|
|
|
-
|
|
|
|
-// Nexilis.initiateAudio()
|
|
|
|
- if(!id.isEmpty && (UserDefaults.standard.string(forKey: "me") == nil)){
|
|
|
|
- if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getSignUpApi(api: apiKey, p_pin: id), timeout: 30 * 1000){
|
|
|
|
- id = response.getBody(key: CoreMessage_TMessageKey.F_PIN, default_value: "")
|
|
|
|
- let enable_signup = (response.getBody(key: CoreMessage_TMessageKey.IS_ENABLED_ANONYMOUS, default_value: "0")) == "1"
|
|
|
|
- Utils.setForceAnonymous(value: enable_signup)
|
|
|
|
- if(!id.isEmpty) {
|
|
|
|
- Nexilis.changeUser(f_pin: id)
|
|
|
|
- UserDefaults.standard.setValue(id, forKey: "me")
|
|
|
|
|
|
+ showFB = showButton
|
|
|
|
+
|
|
|
|
+ Nexilis.shared.createDelegate()
|
|
|
|
+
|
|
|
|
+ Nexilis.sAPIKey = apiKey
|
|
|
|
+
|
|
|
|
+ Nexilis.showButtonFB = showButton
|
|
|
|
+
|
|
|
|
+ Database.shared.openDatabase()
|
|
|
|
+
|
|
|
|
+ IncomingThread.default.run()
|
|
|
|
+
|
|
|
|
+ imageCache.countLimit = 100
|
|
|
|
+ imageCache.totalCostLimit = 1024 * 1024 * 200
|
|
|
|
+
|
|
|
|
+ DispatchQueue.global().async {
|
|
|
|
+ do {
|
|
|
|
+ let address = Nexilis.getAddressNew(apiKey:apiKey)
|
|
|
|
+ // print("ADDRESS \(address)")
|
|
|
|
+ if address.isEmpty {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // UserDefaults.standard.set(address, forKey: "address")
|
|
|
|
+ // UserDefaults.standard.set(address[0], forKey: "server")
|
|
|
|
+ //
|
|
|
|
+ Nexilis.dispatch = DispatchGroup()
|
|
|
|
+ Nexilis.dispatch?.enter()
|
|
|
|
+ // var server = UserDefaults.standard.string(forKey: "server")
|
|
|
|
+ // if let s = server, let a = UserDefaults.standard.stringArray(forKey: "address"), s != a[0] {
|
|
|
|
+ // server = a[0]
|
|
|
|
+ // UserDefaults.standard.set(server, forKey: "server")
|
|
|
|
+ // }
|
|
|
|
+ // var ip = ""
|
|
|
|
+ // var port = 0
|
|
|
|
+ // if let s = server {
|
|
|
|
+ // let data = s.split(separator: ":")
|
|
|
|
+ // ip = String(data[0])
|
|
|
|
+ // if let p = Int(data[1]) {
|
|
|
|
+ // port = p
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ Nexilis.ADDRESS = address.components(separatedBy: ":")[0]
|
|
|
|
+ Nexilis.PORT = Int(address.components(separatedBy: ":")[1]) ?? 0
|
|
|
|
+ // print("IP PORT \(Nexilis.ADDRESS) <> \(Nexilis.PORT)")
|
|
|
|
+ var id = ""
|
|
|
|
+ if let device_id = UserDefaults.standard.string(forKey: "device_id") {
|
|
|
|
+ try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: device_id, sStartWH: "09:00")
|
|
|
|
+ } else if let me = UserDefaults.standard.string(forKey: "me") {
|
|
|
|
+ try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: me, sStartWH: "09:00")
|
|
|
|
+ } else {
|
|
|
|
+ let uuid = UIDevice.current.identifierForVendor?.uuidString ?? "UNK-DEVICE"
|
|
|
|
+ try API.initConnection(bSwitchIP: false, sAPIK: apiKey, aAppMain: nil, cbiI: Callback(), sTCPAddr: Nexilis.ADDRESS, nTCPPort: Nexilis.PORT, sUserID: uuid, sStartWH: "09:00")
|
|
|
|
+ id = uuid
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // wait until connection true
|
|
|
|
+ Nexilis.dispatch?.wait()
|
|
|
|
+ Nexilis.dispatch = nil
|
|
|
|
+
|
|
|
|
+ // Nexilis.initiateAudio()
|
|
|
|
+ if(!id.isEmpty && (UserDefaults.standard.string(forKey: "me") == nil)){
|
|
|
|
+ if let response = Nexilis.writeSync(message: CoreMessage_TMessageBank.getSignUpApi(api: apiKey, p_pin: id), timeout: 30 * 1000){
|
|
|
|
+ id = response.getBody(key: CoreMessage_TMessageKey.F_PIN, default_value: "")
|
|
|
|
+ let enable_signup = (response.getBody(key: CoreMessage_TMessageKey.IS_ENABLED_ANONYMOUS, default_value: "0")) == "1"
|
|
|
|
+ Utils.setForceAnonymous(value: enable_signup)
|
|
|
|
+ if(!id.isEmpty) {
|
|
|
|
+ Nexilis.changeUser(f_pin: id)
|
|
|
|
+ UserDefaults.standard.setValue(id, forKey: "me")
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- if UserDefaults.standard.string(forKey: "apiKey") == nil {
|
|
|
|
- UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if let me = UserDefaults.standard.string(forKey: "me") {
|
|
|
|
- if Utils.getForceAnonymous() || (!Utils.getForceAnonymous() && Utils.getSetProfile()) {
|
|
|
|
- Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
|
|
- if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT * FROM BUDDY where f_pin = '\(me)' ") {
|
|
|
|
- if !cursorData.next() {
|
|
|
|
- _ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: me))
|
|
|
|
|
|
+ if UserDefaults.standard.string(forKey: "apiKey") == nil {
|
|
|
|
+ UserDefaults.standard.setValue(apiKey, forKey: "apiKey")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if let me = UserDefaults.standard.string(forKey: "me") {
|
|
|
|
+ if Utils.getForceAnonymous() || (!Utils.getForceAnonymous() && Utils.getSetProfile()) {
|
|
|
|
+ Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
|
|
+ if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT * FROM BUDDY where f_pin = '\(me)' ") {
|
|
|
|
+ if !cursorData.next() {
|
|
|
|
+ _ = Nexilis.write(message: CoreMessage_TMessageBank.getPostRegistration(p_pin: me))
|
|
|
|
+ }
|
|
|
|
+ cursorData.close()
|
|
}
|
|
}
|
|
- cursorData.close()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
|
|
- if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT image_id FROM GROUPZ where group_type = 1 AND official = 1"), cursorData.next() {
|
|
|
|
- do {
|
|
|
|
- let documentDir = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
|
|
|
|
- let file = documentDir.appendingPathComponent(cursorData.string(forColumnIndex: 0)!)
|
|
|
|
- if !FileManager().fileExists(atPath: file.path) {
|
|
|
|
- Download().startHTTP(forKey: cursorData.string(forColumnIndex: 0)!) { (name, progress) in}
|
|
|
|
|
|
+ })
|
|
|
|
+ Database.shared.database?.inTransaction({ (fmdb, rollback) in
|
|
|
|
+ if let cursorData = Database.shared.getRecords(fmdb: fmdb, query: "SELECT image_id FROM GROUPZ where group_type = 1 AND official = 1"), cursorData.next() {
|
|
|
|
+ do {
|
|
|
|
+ let documentDir = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
|
|
|
|
+ let file = documentDir.appendingPathComponent(cursorData.string(forColumnIndex: 0)!)
|
|
|
|
+ if !FileManager().fileExists(atPath: file.path) {
|
|
|
|
+ Download().startHTTP(forKey: cursorData.string(forColumnIndex: 0)!) { (name, progress) in}
|
|
|
|
+ }
|
|
|
|
+ } catch {}
|
|
|
|
+ cursorData.close()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ getServiceBank()
|
|
|
|
+ getPullWorkingArea()
|
|
|
|
+ getPullGroupNoMember()
|
|
|
|
+ delegate.onSuccess(userId: me)
|
|
|
|
+ getPullDefaultCC()
|
|
|
|
+ if showButton {
|
|
|
|
+ DispatchQueue.main.async {
|
|
|
|
+ var viewController = UIApplication.shared.windows.first?.rootViewController
|
|
|
|
+ var notNull = false
|
|
|
|
+ while !notNull {
|
|
|
|
+ viewController = UIApplication.shared.windows.first?.rootViewController
|
|
|
|
+ if viewController != nil && Utils.getFinishInitPrefsr() {
|
|
|
|
+ notNull = true
|
|
}
|
|
}
|
|
- } catch {}
|
|
|
|
- cursorData.close()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- getServiceBank()
|
|
|
|
- getPullWorkingArea()
|
|
|
|
- getPullGroupNoMember()
|
|
|
|
- delegate.onSuccess(userId: me)
|
|
|
|
- getPullDefaultCC()
|
|
|
|
- if showButton {
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- var viewController = UIApplication.shared.windows.first?.rootViewController
|
|
|
|
- var notNull = false
|
|
|
|
- while !notNull {
|
|
|
|
- viewController = UIApplication.shared.windows.first?.rootViewController
|
|
|
|
- if viewController != nil && Utils.getFinishInitPrefsr() {
|
|
|
|
- notNull = true
|
|
|
|
}
|
|
}
|
|
|
|
+ addFB(viewController: viewController!, fromMAB: fromMAB)
|
|
}
|
|
}
|
|
- addFB(viewController: viewController!, fromMAB: fromMAB)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ Nexilis.destroyAll()
|
|
|
|
+ OutgoingThread.default.run()
|
|
|
|
+
|
|
|
|
+ InquiryThread.default.run()
|
|
|
|
+
|
|
|
|
+ if UIFont.systemFont(ofSize: 12).familyName == ".AppleSystemUIFont" {
|
|
|
|
+ UIFont.libOverrideInitialize()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Utils.getSetProfile() && !Utils.getFinishInitPrefsr()) || (!Utils.getForceAnonymous() && !Utils.getFinishInitPrefsr()) {
|
|
|
|
+ Utils.setFinishInitPrefs(value: true)
|
|
|
|
+ }
|
|
|
|
+ } catch {
|
|
|
|
+ delegate.onFailed(error: "99:Something went wrong")
|
|
}
|
|
}
|
|
- Nexilis.destroyAll()
|
|
|
|
- OutgoingThread.default.run()
|
|
|
|
-
|
|
|
|
- InquiryThread.default.run()
|
|
|
|
-
|
|
|
|
- if UIFont.systemFont(ofSize: 12).familyName == ".AppleSystemUIFont" {
|
|
|
|
- UIFont.libOverrideInitialize()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (Utils.getSetProfile() && !Utils.getFinishInitPrefsr()) || (!Utils.getForceAnonymous() && !Utils.getFinishInitPrefsr()) {
|
|
|
|
- Utils.setFinishInitPrefs(value: true)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //print("MANIA \(UIFont.systemFont(ofSize: 12)) <> \(UIFont.italicSystemFont(ofSize: 12)) <> \(UIFont.boldSystemFont(ofSize: 12))")
|
|
|
|
- }
|
|
|
|
- catch {
|
|
|
|
- //print(error)
|
|
|
|
- delegate.onFailed(error: "99:Something went wrong")
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //print("MANIA \(UIFont.systemFont(ofSize: 12)) <> \(UIFont.italicSystemFont(ofSize: 12)) <> \(UIFont.boldSystemFont(ofSize: 12))")
|
|
}
|
|
}
|
|
|
|
|
|
public static func addFB(viewController: UIViewController, fromMAB: Bool) {
|
|
public static func addFB(viewController: UIViewController, fromMAB: Bool) {
|
|
@@ -852,7 +852,7 @@ public class Nexilis: NSObject {
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -860,7 +860,7 @@ public class Nexilis: NSObject {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
} else {
|
|
} else {
|
|
@@ -896,7 +896,7 @@ public class Nexilis: NSObject {
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -904,7 +904,7 @@ public class Nexilis: NSObject {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
} else {
|
|
} else {
|
|
@@ -967,7 +967,7 @@ public class Nexilis: NSObject {
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -975,7 +975,7 @@ public class Nexilis: NSObject {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
let rootVC = UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController
|
|
let rootVC = UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController
|
|
if rootVC?.presentedViewController == nil {
|
|
if rootVC?.presentedViewController == nil {
|
|
rootVC?.present(navigationController, animated: true, completion: nil)
|
|
rootVC?.present(navigationController, animated: true, completion: nil)
|
|
@@ -2491,7 +2491,7 @@ extension Nexilis: MessageDelegate {
|
|
let navigationController = UINavigationController(rootViewController: editorPersonalVC)
|
|
let navigationController = UINavigationController(rootViewController: editorPersonalVC)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -2499,7 +2499,7 @@ extension Nexilis: MessageDelegate {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
} else {
|
|
} else {
|
|
@@ -2888,7 +2888,7 @@ extension Nexilis: MessageDelegate {
|
|
let navigationController = UINavigationController(rootViewController: editorPersonalVC)
|
|
let navigationController = UINavigationController(rootViewController: editorPersonalVC)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -2896,7 +2896,7 @@ extension Nexilis: MessageDelegate {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
} else {
|
|
} else {
|
|
@@ -3329,7 +3329,7 @@ extension Nexilis: MessageDelegate {
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
let navigationController = UINavigationController(rootViewController: controller)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -3337,7 +3337,7 @@ extension Nexilis: MessageDelegate {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
} else {
|
|
} else {
|
|
@@ -3372,7 +3372,7 @@ extension Nexilis: MessageDelegate {
|
|
let navigationController = UINavigationController(rootViewController: editorPersonalVC)
|
|
let navigationController = UINavigationController(rootViewController: editorPersonalVC)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -3380,7 +3380,7 @@ extension Nexilis: MessageDelegate {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
} else {
|
|
} else {
|
|
@@ -3465,7 +3465,7 @@ extension Nexilis: MessageDelegate {
|
|
let navigationController = UINavigationController(rootViewController: editorGroupVC)
|
|
let navigationController = UINavigationController(rootViewController: editorGroupVC)
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.modalPresentationStyle = .fullScreen
|
|
navigationController.navigationBar.tintColor = .white
|
|
navigationController.navigationBar.tintColor = .white
|
|
- navigationController.navigationBar.barTintColor = .mainColor
|
|
|
|
|
|
+ navigationController.navigationBar.barTintColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.isTranslucent = false
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.overrideUserInterfaceStyle = .dark
|
|
navigationController.navigationBar.barStyle = .black
|
|
navigationController.navigationBar.barStyle = .black
|
|
@@ -3473,7 +3473,7 @@ extension Nexilis: MessageDelegate {
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
navigationController.navigationBar.titleTextAttributes = textAttributes
|
|
- navigationController.view.backgroundColor = .mainColor
|
|
|
|
|
|
+ navigationController.view.backgroundColor = UIApplication.shared.visibleViewController?.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
if UIApplication.shared.visibleViewController?.navigationController != nil {
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
UIApplication.shared.visibleViewController?.navigationController?.present(navigationController, animated: true, completion: nil)
|
|
} else {
|
|
} else {
|