Skip to content

Commit

Permalink
#1247 (Mac Catalyst edition)
Browse files Browse the repository at this point in the history
- Enabled the Close menu item and window button for the NewsBlur window.
- Closing the window quits the app.
  • Loading branch information
Dejal committed Aug 29, 2024
1 parent a23bb24 commit 06f2a66
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions clients/ios/Classes/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
return
}

if #available(macCatalyst 16.0, *) {
windowScene.windowingBehaviors?.isClosable = false
}
// if #available(macCatalyst 16.0, *) {
// windowScene.windowingBehaviors?.isClosable = false
// }

toolbar.delegate = toolbarDelegate
toolbar.displayMode = .iconOnly
Expand All @@ -56,6 +56,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
appDelegate.prepareViewControllers()
}

#if targetEnvironment(macCatalyst)
func sceneDidDisconnect(_ scene: UIScene) {
appDelegate.window = nil

exit(0)
}
#endif

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
guard let url = URLContexts.first?.url else {
return
Expand Down

0 comments on commit 06f2a66

Please sign in to comment.