NCBrand.swift 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. //
  2. // NCBrandColor.swift
  3. // Nextcloud
  4. //
  5. // Created by Marino Faggiana on 24/04/17.
  6. // Copyright (c) 2017 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. import UIKit
  24. //MARK: - Configuration
  25. @objc class NCBrandConfiguration: NSObject {
  26. @objc static let shared: NCBrandConfiguration = {
  27. let instance = NCBrandConfiguration()
  28. return instance
  29. }()
  30. @objc public let configuration_bundleId: String = "it.twsweb.Nextcloud"
  31. @objc public let configuration_serverUrl: String = "serverUrl"
  32. @objc public let configuration_username: String = "username"
  33. @objc public let configuration_password: String = "password"
  34. }
  35. //MARK: - Options
  36. @objc class NCBrandOptions: NSObject {
  37. @objc static let shared: NCBrandOptions = {
  38. let instance = NCBrandOptions()
  39. return instance
  40. }()
  41. @objc public var brand: String = "Nextcloud"
  42. @objc public var mailMe: String = "ios@nextcloud.com"
  43. @objc public var textCopyrightNextcloudiOS: String = "Nextcloud Coherence for iOS %@ © 2021"
  44. @objc public var textCopyrightNextcloudServer: String = "Nextcloud Server %@"
  45. @objc public var loginBaseUrl: String = "https://cloud.nextcloud.com"
  46. @objc public var pushNotificationServerProxy: String = "https://push-notifications.nextcloud.com"
  47. @objc public var linkLoginHost: String = "https://nextcloud.com/install"
  48. @objc public var linkloginPreferredProviders: String = "https://nextcloud.com/signup";
  49. @objc public var webLoginAutenticationProtocol: String = "nc://" // example "abc://"
  50. // Personalized
  51. @objc public var webCloseViewProtocolPersonalized: String = "" // example "abc://change/plan" Don't touch me !!
  52. @objc public var folderBrandAutoUpload: String = "" // example "_auto_upload_folder_" Don't touch me !!
  53. // Auto Upload default folder
  54. @objc public var folderDefaultAutoUpload: String = "Photos"
  55. // Capabilities Group
  56. @objc public var capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
  57. // User Agent
  58. @objc public var userAgent: String = "Nextcloud-iOS" // Don't touch me !!
  59. // Options
  60. @objc public var use_login_web_personalized: Bool = false // Don't touch me !!
  61. @objc public var use_default_auto_upload: Bool = false
  62. @objc public var use_themingColor: Bool = true
  63. //@objc public var use_themingBackground: Bool = true // Deprecated
  64. @objc public var use_themingLogo: Bool = false
  65. @objc public var use_storeLocalAutoUploadAll: Bool = false
  66. @objc public var use_configuration: Bool = false // Don't touch me !!
  67. @objc public var use_loginflowv2: Bool = false // Don't touch me !!
  68. @objc public var disable_intro: Bool = false
  69. @objc public var disable_request_login_url: Bool = false
  70. @objc public var disable_multiaccount: Bool = false
  71. @objc public var disable_manage_account: Bool = false
  72. @objc public var disable_more_external_site: Bool = false
  73. @objc public var disable_openin_file: Bool = false // Don't touch me !!
  74. @objc public var disable_crash_service: Bool = false
  75. override init() {
  76. if folderBrandAutoUpload != "" {
  77. folderDefaultAutoUpload = folderBrandAutoUpload
  78. }
  79. }
  80. }
  81. //MARK: - Color
  82. class NCBrandColor: NSObject {
  83. @objc static let shared: NCBrandColor = {
  84. let instance = NCBrandColor()
  85. instance.setDarkMode()
  86. return instance
  87. }()
  88. // Color
  89. @objc public let customer: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0) // BLU NC : #0082c9
  90. @objc public var customerText: UIColor = .white
  91. @objc public var brand: UIColor // don't touch me
  92. @objc public var brandElement: UIColor // don't touch me
  93. @objc public var brandText: UIColor // don't touch me
  94. @objc public var connectionNo: UIColor = UIColor(red: 204.0/255.0, green: 204.0/255.0, blue: 204.0/255.0, alpha: 1.0)
  95. @objc public var encrypted: UIColor = .red
  96. @objc public var backgroundView: UIColor = .white
  97. @objc public var backgroundCell: UIColor = .white
  98. @objc public var backgroundForm: UIColor = UIColor(red: 244.0/255.0, green: 244.0/255.0, blue: 244.0/255.0, alpha: 1.0)
  99. @objc public var textView: UIColor = .black
  100. @objc public var separator: UIColor = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.0/255.0, alpha: 1.0)
  101. @objc public var tabBar: UIColor = .white
  102. @objc public let nextcloud: UIColor = UIColor(red: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)
  103. @objc public let nextcloudSoft: UIColor = UIColor(red: 90.0/255.0, green: 160.0/255.0, blue: 210.0/255.0, alpha: 1.0)
  104. @objc public let icon: UIColor = UIColor(red: 104.0/255.0, green: 104.0/255.0, blue: 104.0/255.0, alpha: 1.0)
  105. @objc public let optionItem: UIColor = UIColor(red: 178.0/255.0, green: 178.0/255.0, blue: 178.0/255.0, alpha: 1.0)
  106. @objc public let graySoft: UIColor = UIColor(red: 162.0/255.0, green: 162.0/255.0, blue: 162.0/255.0, alpha: 0.5)
  107. @objc public let yellowFavorite: UIColor = UIColor(red: 248.0/255.0, green: 205.0/255.0, blue: 70.0/255.0, alpha: 1.0)
  108. @objc public let textInfo: UIColor = UIColor(red: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 1.0)
  109. @objc public var select: UIColor = .white
  110. @objc public var avatarBorder: UIColor = .white
  111. override init() {
  112. self.brand = self.customer
  113. self.brandElement = self.customer
  114. self.brandText = self.customerText
  115. }
  116. @objc public func setDarkMode() {
  117. let darkMode = CCUtility.getDarkMode()
  118. if darkMode {
  119. tabBar = UIColor(red: 25.0/255.0, green: 25.0/255.0, blue: 25.0/255.0, alpha: 1.0)
  120. backgroundView = .black
  121. backgroundCell = UIColor(red: 25.0/255.0, green: 25.0/255.0, blue: 25.0/255.0, alpha: 1.0)
  122. backgroundForm = .black
  123. textView = .white
  124. separator = UIColor(red: 60.0/255.0, green: 60.0/255.0, blue: 60.0/255.0, alpha: 1.0)
  125. select = UIColor.white.withAlphaComponent(0.2)
  126. avatarBorder = .black
  127. } else {
  128. tabBar = .white
  129. backgroundView = .white
  130. backgroundCell = .white
  131. backgroundForm = UIColor(red: 247.0/255.0, green: 247.0/255.0, blue: 247.0/255.0, alpha: 1.0)
  132. textView = .black
  133. separator = UIColor(red: 235.0/255.0, green: 235.0/255.0, blue: 235.0/255.0, alpha: 1.0)
  134. select = self.brandElement.withAlphaComponent(0.1)
  135. avatarBorder = .white
  136. }
  137. }
  138. #if !EXTENSION
  139. @objc public func settingThemingColor(account: String) {
  140. let darker: CGFloat = 30 // %
  141. let lighter: CGFloat = 30 // %
  142. if NCBrandOptions.shared.use_themingColor {
  143. let themingColor = NCManageDatabase.shared.getCapabilitiesServerString(account: account, elements: NCElementsJSON.shared.capabilitiesThemingColor)
  144. let themingColorElement = NCManageDatabase.shared.getCapabilitiesServerString(account: account, elements: NCElementsJSON.shared.capabilitiesThemingColorElement)
  145. let themingColorText = NCManageDatabase.shared.getCapabilitiesServerString(account: account, elements: NCElementsJSON.shared.capabilitiesThemingColorText)
  146. settingBrandColor(themingColor, themingColorElement: themingColorElement, themingColorText: themingColorText)
  147. if NCBrandColor.shared.brandElement.isTooLight() {
  148. if let color = NCBrandColor.shared.brandElement.darker(by: darker) {
  149. NCBrandColor.shared.brandElement = color
  150. }
  151. } else if NCBrandColor.shared.brandElement.isTooDark() {
  152. if let color = NCBrandColor.shared.brandElement.lighter(by: lighter) {
  153. NCBrandColor.shared.brandElement = color
  154. }
  155. }
  156. } else {
  157. if NCBrandColor.shared.customer.isTooLight() {
  158. if let color = NCBrandColor.shared.customer.darker(by: darker) {
  159. NCBrandColor.shared.brandElement = color
  160. }
  161. } else if NCBrandColor.shared.customer.isTooDark() {
  162. if let color = NCBrandColor.shared.customer.lighter(by: lighter) {
  163. NCBrandColor.shared.brandElement = color
  164. }
  165. } else {
  166. NCBrandColor.shared.brandElement = NCBrandColor.shared.customer
  167. }
  168. NCBrandColor.shared.brand = NCBrandColor.shared.customer
  169. NCBrandColor.shared.brandText = NCBrandColor.shared.customerText
  170. }
  171. setDarkMode()
  172. DispatchQueue.main.async {
  173. NCCollectionCommon.shared.createImagesThemingColor()
  174. NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterChangeTheming)
  175. }
  176. }
  177. #endif
  178. @objc func settingBrandColor(_ themingColor: String?, themingColorElement: String?, themingColorText: String?) {
  179. // COLOR
  180. if themingColor?.first == "#" {
  181. if let color = UIColor(hex: themingColor!) {
  182. NCBrandColor.shared.brand = color
  183. } else {
  184. NCBrandColor.shared.brand = NCBrandColor.shared.customer
  185. }
  186. } else {
  187. NCBrandColor.shared.brand = NCBrandColor.shared.customer
  188. }
  189. // COLOR TEXT
  190. if themingColorText?.first == "#" {
  191. if let color = UIColor(hex: themingColorText!) {
  192. NCBrandColor.shared.brandText = color
  193. } else {
  194. NCBrandColor.shared.brandText = NCBrandColor.shared.customerText
  195. }
  196. } else {
  197. NCBrandColor.shared.brandText = NCBrandColor.shared.customerText
  198. }
  199. // COLOR ELEMENT
  200. if themingColorElement?.first == "#" {
  201. if let color = UIColor(hex: themingColorElement!) {
  202. NCBrandColor.shared.brandElement = color
  203. } else {
  204. NCBrandColor.shared.brandElement = NCBrandColor.shared.brand
  205. }
  206. } else {
  207. NCBrandColor.shared.brandElement = NCBrandColor.shared.brand
  208. }
  209. }
  210. }
  211. //MARK: - Global
  212. @objc class NCBrandGlobal: NSObject {
  213. @objc static let shared: NCBrandGlobal = {
  214. let instance = NCBrandGlobal()
  215. return instance
  216. }()
  217. // Directory on Group
  218. @objc let appDatabaseNextcloud = "Library/Application Support/Nextcloud"
  219. @objc let appApplicationSupport = "Library/Application Support"
  220. @objc let appUserData = "Library/Application Support/UserData"
  221. @objc let appCertificates = "Library/Application Support/Certificates"
  222. @objc let appScan = "Library/Application Support/Scan"
  223. @objc let directoryProviderStorage = "File Provider Storage"
  224. // Service
  225. @objc let serviceShareKeyChain = "Crypto Cloud"
  226. @objc let metadataKeyedUnarchiver = "it.twsweb.nextcloud.metadata"
  227. @objc let refreshTask = "com.nextcloud.refreshTask"
  228. @objc let processingTask = "com.nextcloud.processingTask"
  229. // Nextcloud version
  230. @objc let nextcloudVersion12: Int = 12
  231. let nextcloudVersion15: Int = 15
  232. let nextcloudVersion17: Int = 17
  233. let nextcloudVersion18: Int = 18
  234. let nextcloudVersion20: Int = 20
  235. // Database Realm
  236. let databaseDefault = "nextcloud.realm"
  237. let databaseSchemaVersion: UInt64 = 162
  238. // Intro selector
  239. @objc let introLogin: Int = 0
  240. @objc let introSignup: Int = 1
  241. // Avatar & Preview
  242. let avatarSize: CGFloat = 512
  243. @objc let sizePreview: CGFloat = 1024
  244. @objc let sizeIcon: CGFloat = 512
  245. // E2EE
  246. let e2eeMaxFileSize: UInt64 = 524288000 // 500 MB
  247. let e2eePassphraseTest = "more over television factory tendency independence international intellectual impress interest sentence pony"
  248. @objc let e2eeVersion = "1.1"
  249. // Max Size Upload
  250. let uploadMaxFileSize: UInt64 = 524288000 // 500 MB
  251. // Max Cache Proxy Video
  252. let maxHTTPCache: Int64 = 10737418240 // 10 GB
  253. // NCSharePaging
  254. let indexPageActivity: Int = 0
  255. let indexPageComments: Int = 1
  256. let indexPageSharing: Int = 2
  257. // NCViewerProviderContextMenu
  258. let maxAutoDownload: UInt64 = 104857600 // 100MB
  259. let maxAutoDownloadCellular: UInt64 = 10485760 // 10MB
  260. // Nextcloud unsupported
  261. let nextcloud_unsupported_version: Int = 13
  262. // Layout
  263. let layoutList = "typeLayoutList"
  264. let layoutGrid = "typeLayoutGrid"
  265. let layoutViewMove = "LayoutMove"
  266. let layoutViewTrash = "LayoutTrash"
  267. let layoutViewOffline = "LayoutOffline"
  268. let layoutViewFavorite = "LayoutFavorite"
  269. let layoutViewFiles = "LayoutFiles"
  270. let layoutViewViewInFolder = "ViewInFolder"
  271. let layoutViewTransfers = "LayoutTransfers"
  272. let layoutViewRecent = "LayoutRecent"
  273. let layoutViewShares = "LayoutShares"
  274. // Button Type in Cell list/grid
  275. let buttonMoreMore = "more"
  276. let buttonMoreStop = "stop"
  277. // Text - OnlyOffice - Collabora
  278. let editorText = "text"
  279. let editorOnlyoffice = "onlyoffice"
  280. let editorCollabora = "collabora"
  281. let onlyofficeDocx = "onlyoffice_docx"
  282. let onlyofficeXlsx = "onlyoffice_xlsx"
  283. let onlyofficePptx = "onlyoffice_pptx"
  284. // Template
  285. let templateDocument = "document"
  286. let templateSpreadsheet = "spreadsheet"
  287. let templatePresentation = "presentation"
  288. // Rich Workspace
  289. let fileNameRichWorkspace = "Readme.md"
  290. @objc let dismissAfterSecond: TimeInterval = 4
  291. @objc let dismissAfterSecondLong: TimeInterval = 10
  292. // Error
  293. @objc let ErrorBadRequest: Int = 400
  294. @objc let ErrorResourceNotFound: Int = 404
  295. @objc let ErrorConflict: Int = 409
  296. @objc let ErrorBadServerResponse: Int = -1011
  297. @objc let ErrorInternalError: Int = -99999
  298. @objc let ErrorFileNotSaved: Int = -99998
  299. @objc let ErrorDecodeMetadata: Int = -99997
  300. @objc let ErrorE2EENotEnabled: Int = -99996
  301. @objc let ErrorOffline: Int = -99994
  302. @objc let ErrorCharactersForbidden: Int = -99993
  303. @objc let ErrorCreationFile: Int = -99992
  304. // Constants to identify the different permissions of a file
  305. @objc let permissionShared = "S"
  306. @objc let permissionCanShare = "R"
  307. @objc let permissionMounted = "M"
  308. @objc let permissionFileCanWrite = "W"
  309. @objc let permissionCanCreateFile = "C"
  310. @objc let permissionCanCreateFolder = "K"
  311. @objc let permissionCanDelete = "D"
  312. @objc let permissionCanRename = "N"
  313. @objc let permissionCanMove = "V"
  314. //Share permission
  315. //permissions - (int) 1 = read; 2 = update; 4 = create; 8 = delete; 16 = share; 31 = all (default: 31, for public shares: 1)
  316. @objc let permissionReadShare: Int = 1
  317. @objc let permissionUpdateShare: Int = 2
  318. @objc let permissionCreateShare: Int = 4
  319. @objc let permissionDeleteShare: Int = 8
  320. @objc let permissionShareShare: Int = 16
  321. @objc let permissionMinFileShare: Int = 1
  322. @objc let permissionMaxFileShare: Int = 19
  323. @objc let permissionMinFolderShare: Int = 1
  324. @objc let permissionMaxFolderShare: Int = 31
  325. @objc let permissionDefaultFileRemoteShareNoSupportShareOption: Int = 3
  326. @objc let permissionDefaultFolderRemoteShareNoSupportShareOption: Int = 15
  327. // Metadata : FileType
  328. @objc let metadataTypeFileAudio = "audio"
  329. @objc let metadataTypeFileCompress = "compress"
  330. @objc let metadataTypeFileDirectory = "directory"
  331. @objc let metadataTypeFileDocument = "document"
  332. @objc let metadataTypeFileImage = "image"
  333. @objc let metadataTypeFileUnknown = "unknow"
  334. @objc let metadataTypeFileVideo = "video"
  335. @objc let metadataTypeFileImagemeter = "imagemeter"
  336. // Filename Mask and Type
  337. @objc let keyFileNameMask = "fileNameMask"
  338. @objc let keyFileNameType = "fileNameType"
  339. @objc let keyFileNameAutoUploadMask = "fileNameAutoUploadMask"
  340. @objc let keyFileNameAutoUploadType = "fileNameAutoUploadType"
  341. @objc let keyFileNameOriginal = "fileNameOriginal"
  342. @objc let keyFileNameOriginalAutoUpload = "fileNameOriginalAutoUpload"
  343. // Selector
  344. @objc let selectorDownloadFile = "downloadFile"
  345. @objc let selectorDownloadAllFile = "downloadAllFile"
  346. @objc let selectorReadFile = "readFile"
  347. @objc let selectorListingFavorite = "listingFavorite"
  348. @objc let selectorLoadFileView = "loadFileView"
  349. @objc let selectorLoadFileQuickLook = "loadFileQuickLook"
  350. @objc let selectorLoadCopy = "loadCopy"
  351. @objc let selectorLoadOffline = "loadOffline"
  352. @objc let selectorOpenIn = "openIn"
  353. @objc let selectorUploadAutoUpload = "uploadAutoUpload"
  354. @objc let selectorUploadAutoUploadAll = "uploadAutoUploadAll"
  355. @objc let selectorUploadFile = "uploadFile"
  356. @objc let selectorSaveAlbum = "saveAlbum"
  357. @objc let selectorSaveAlbumLivePhotoIMG = "saveAlbumLivePhotoIMG"
  358. @objc let selectorSaveAlbumLivePhotoMOV = "saveAlbumLivePhotoMOV"
  359. // Metadata : Status
  360. //
  361. // 1) wait download/upload
  362. // 2) in download/upload
  363. // 3) downloading/uploading
  364. // 4) done or error
  365. //
  366. @objc let metadataStatusNormal: Int = 0
  367. @objc let metadataStatustypeDownload: Int = 1
  368. @objc let metadataStatusWaitDownload: Int = 2
  369. @objc let metadataStatusInDownload: Int = 3
  370. @objc let metadataStatusDownloading: Int = 4
  371. @objc let metadataStatusDownloadError: Int = 5
  372. @objc let metadataStatusTypeUpload: Int = 6
  373. @objc let metadataStatusWaitUpload: Int = 7
  374. @objc let metadataStatusInUpload: Int = 8
  375. @objc let metadataStatusUploading: Int = 9
  376. @objc let metadataStatusUploadError: Int = 10
  377. @objc let metadataStatusUploadForcedStart: Int = 11
  378. // Notification Center
  379. @objc let notificationCenterApplicationDidEnterBackground = "applicationDidEnterBackground"
  380. @objc let notificationCenterApplicationWillEnterForeground = "applicationWillEnterForeground"
  381. @objc let notificationCenterInitializeMain = "initializeMain"
  382. @objc let notificationCenterChangeTheming = "changeTheming"
  383. @objc let notificationCenterChangeUserProfile = "changeUserProfile"
  384. @objc let notificationCenterRichdocumentGrabFocus = "richdocumentGrabFocus"
  385. @objc let notificationCenterReloadDataNCShare = "reloadDataNCShare"
  386. @objc let notificationCenterCloseRichWorkspaceWebView = "closeRichWorkspaceWebView"
  387. @objc let notificationCenterReloadDataSource = "reloadDataSource" // userInfo: ocId?, serverUrl?
  388. @objc let notificationCenterReloadDataSourceNetworkForced = "reloadDataSourceNetworkForced" // userInfo: serverUrl?
  389. @objc let notificationCenterChangeStatusFolderE2EE = "changeStatusFolderE2EE" // userInfo: serverUrl
  390. @objc let notificationCenterDownloadStartFile = "downloadStartFile" // userInfo: ocId
  391. @objc let notificationCenterDownloadedFile = "downloadedFile" // userInfo: ocId, selector, errorCode, errorDescription
  392. @objc let notificationCenterDownloadCancelFile = "downloadCancelFile" // userInfo: ocId
  393. @objc let notificationCenterUploadStartFile = "uploadStartFile" // userInfo: ocId
  394. @objc let notificationCenterUploadedFile = "uploadedFile" // userInfo: ocId, ocIdTemp, errorCode, errorDescription
  395. @objc let notificationCenterUploadCancelFile = "uploadCancelFile" // userInfo: ocId
  396. @objc let notificationCenterProgressTask = "progressTask" // userInfo: account, ocId, serverUrl, status, progress, totalBytes, totalBytesExpected
  397. @objc let notificationCenterCreateFolder = "createFolder" // userInfo: ocId
  398. @objc let notificationCenterDeleteFile = "deleteFile" // userInfo: ocId, fileNameView, typeFile, onlyLocal
  399. @objc let notificationCenterRenameFile = "renameFile" // userInfo: ocId, errorCode, errorDescription
  400. @objc let notificationCenterMoveFile = "moveFile" // userInfo: ocId, serverUrlTo
  401. @objc let notificationCenterCopyFile = "copyFile" // userInfo: ocId, serverUrlFrom
  402. @objc let notificationCenterFavoriteFile = "favoriteFile" // userInfo: ocId
  403. @objc let notificationCenterMenuSearchTextPDF = "menuSearchTextPDF"
  404. @objc let notificationCenterMenuDetailClose = "menuDetailClose"
  405. @objc let notificationCenterChangedLocation = "changedLocation"
  406. @objc let notificationStatusAuthorizationChangedLocation = "statusAuthorizationChangedLocation"
  407. }
  408. //DispatchQueue.main.async
  409. //DispatchQueue.main.asyncAfter(deadline: .now() + 0.1)
  410. //DispatchQueue.global().async
  411. //DispatchQueue.global(qos: .background).async
  412. //#if targetEnvironment(simulator)
  413. //#endif
  414. //dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
  415. //dispatch_async(dispatch_get_main_queue(), ^{
  416. //dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
  417. //#if TARGET_OS_SIMULATOR
  418. //#endif