diff --git a/Note.xcodeproj/project.pbxproj b/Note.xcodeproj/project.pbxproj index d08cd62..0587a4a 100644 --- a/Note.xcodeproj/project.pbxproj +++ b/Note.xcodeproj/project.pbxproj @@ -150,7 +150,6 @@ INFOPLIST_FILE = Note/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; IPHONEOS_DEPLOYMENT_TARGET = 26.0; @@ -183,7 +182,6 @@ INFOPLIST_FILE = Note/Info.plist; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; IPHONEOS_DEPLOYMENT_TARGET = 26.0; diff --git a/Note/FormatLogViewController.swift b/Note/FormatLogViewController.swift new file mode 100644 index 0000000..4075d9e --- /dev/null +++ b/Note/FormatLogViewController.swift @@ -0,0 +1,17 @@ +// +// FormatLogViewController.swift +// Note +// +// Created by fish on 2026/7/12. +// + +import UIKit + +class FormatLogViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + title = "格式化日志" + view.backgroundColor = .systemBackground + } +} diff --git a/Note/Info.plist b/Note/Info.plist index dd3c9af..08e167d 100644 --- a/Note/Info.plist +++ b/Note/Info.plist @@ -15,8 +15,7 @@ Default Configuration UISceneDelegateClassName $(PRODUCT_MODULE_NAME).SceneDelegate - UISceneStoryboardFile - Main + diff --git a/Note/SceneDelegate.swift b/Note/SceneDelegate.swift index 9b94645..f40f6c0 100644 --- a/Note/SceneDelegate.swift +++ b/Note/SceneDelegate.swift @@ -13,10 +13,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). - guard let _ = (scene as? UIWindowScene) else { return } + guard let windowScene = (scene as? UIWindowScene) else { return } + + window = UIWindow(windowScene: windowScene) + let rootViewController = ViewController() + let navigationController = UINavigationController(rootViewController: rootViewController) + window?.rootViewController = navigationController + window?.makeKeyAndVisible() } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Note/ViewController.swift b/Note/ViewController.swift index 717555f..7b810df 100644 --- a/Note/ViewController.swift +++ b/Note/ViewController.swift @@ -81,8 +81,14 @@ extension ViewController: UITableViewDelegate { tableView.deselectRow(at: indexPath, animated: true) let item = menuItems[indexPath.section][indexPath.row] - if item.title == "打开备忘录" { + switch item.title { + case "打开备忘录": openSystemNotesApp() + case "格式化日志": + let viewController = FormatLogViewController() + navigationController?.pushViewController(viewController, animated: true) + default: + break } }