Skip to content

Commit

Permalink
[App] Refactor in 'AppDelegate'
Browse files Browse the repository at this point in the history
  • Loading branch information
LiarPrincess committed Feb 1, 2022
1 parent a41c650 commit 320146f
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Wroclive/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ public final class AppDelegate: UIResponder, UIApplicationDelegate {
os_log("Adding observers for Apple frameworks", log: self.log, type: .debug)
self.storeUpdater = self.dispatchStoreUpdatesFromAppleFrameworks()

// 'os_log' is inside the function
self.overrideLocaleIfInDebugMode(.pl)
#if DEBUG
let debugLocale = Localizable.Locale.pl
let debugLocaleString = String(describing: debugLocale)
os_log("Setting locale: %{public}@", log: self.log, type: .debug, debugLocaleString)
Localizable.setLocale(debugLocale)
#endif

os_log("Setting up theme", log: self.log, type: .debug)
ColorScheme.initialize()
Expand Down Expand Up @@ -104,15 +108,15 @@ public final class AppDelegate: UIResponder, UIApplicationDelegate {
}

private func logDocumentsDirectoryIfRunningInSimulator() {
#if targetEnvironment(simulator)
#if targetEnvironment(simulator)
let documentDir = self.environment.storage.documentsDirectory.path
os_log(
"Simulator documents directory: %{public}@",
log: self.log,
type: .debug,
documentDir
)
#endif
#endif
}

// MARK: - Redux
Expand Down Expand Up @@ -164,14 +168,6 @@ public final class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: - UI

private func overrideLocaleIfInDebugMode(_ value: Localizable.Locale) {
#if DEBUG
let description = String(describing: value)
os_log("Setting locale: %{public}@", log: self.log, type: .debug, description)
Localizable.setLocale(value)
#endif
}

private func startMapUpdates() -> MapUpdateScheduler {
return MapUpdateScheduler(
store: self.store,
Expand Down

0 comments on commit 320146f

Please sign in to comment.