-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91418ea
commit f7eb56b
Showing
9 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import OSLog | ||
import SwiftUI | ||
|
||
let logger = Logger(subsystem: "org.fcitx.Fcitx5", category: "FcitxLog") | ||
|
||
@main | ||
struct Fcitx5App: App { | ||
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate | ||
|
||
// Dummy. Actual Scene in managed by SceneDelegate. | ||
var body: some Scene { | ||
WindowGroup { | ||
ContentView() | ||
EmptyView() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import UIKit | ||
|
||
class AppDelegate: NSObject, UIApplicationDelegate { | ||
func application( | ||
_ application: UIApplication, | ||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | ||
) -> Bool { | ||
return true | ||
} | ||
|
||
func application( | ||
_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, | ||
options: UIScene.ConnectionOptions | ||
) -> UISceneConfiguration { | ||
return UISceneConfiguration( | ||
name: "Default Configuration", sessionRole: connectingSceneSession.role) | ||
} | ||
|
||
func application( | ||
_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession> | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import SwiftUI | ||
|
||
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | ||
var window: UIWindow? | ||
var contentView: ContentView? | ||
|
||
func scene( | ||
_ scene: UIScene, | ||
willConnectTo session: UISceneSession, | ||
options connectionOptions: UIScene.ConnectionOptions | ||
) { | ||
if let windowScene = scene as? UIWindowScene { | ||
let window = UIWindow(windowScene: windowScene) | ||
contentView = ContentView() | ||
window.rootViewController = UIHostingController(rootView: contentView) | ||
self.window = window | ||
window.makeKeyAndVisible() | ||
} | ||
} | ||
|
||
func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) { | ||
guard let url = urlContexts.first?.url else { return } | ||
contentView?.handleURL(url) | ||
} | ||
} |