Skip to content

Commit

Permalink
修复打开APP默认不显示上次打开的页面的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Sep 18, 2023
1 parent 7c38dba commit c3ecc56
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Bark/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD

self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.backgroundColor = UIColor.black
self.window?.makeKeyAndVisible()

#if !DEBUG
let config = PLCrashReporterConfig(signalHandlerType: .mach, symbolicationStrategy: [])
Expand Down Expand Up @@ -84,6 +83,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
// Purge the report.
crashReporter.purgePendingCrashReport()
self.window?.rootViewController = reportController
self.window?.makeKeyAndVisible()
return true
}
} else {
Expand Down Expand Up @@ -115,7 +115,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
for (index, viewController) in tabBarController.viewControllers!.enumerated() {
viewController.tabBarItem = tabBarItems[index]
}


// 需先配置好 tabBarController 的 viewControllers,显示时会默认显示上次打开的页面
self.window?.makeKeyAndVisible()

UNUserNotificationCenter.current().delegate = self
UNUserNotificationCenter.current().setNotificationCategories([
UNNotificationCategory(identifier: "myNotificationCategory", actions: [
Expand Down

0 comments on commit c3ecc56

Please sign in to comment.