Demonstration of using UIWindowScene and SwiftUI to provide a native-looking Mac preferences window in Catalyst

Overview

CatalystPrefsWindow

Ever wondered how to create a more Mac-like preferences window for Catalyst? Perhaps Settings Bundles are too limiting for the kind of settings UI you want to present?

This is an example of how to use multiple window scenes and SwiftUI to build a very native-looking Mac preferences window that can display your own views and view controllers as you wish.

Screenshot

You might also like...
📱 Guideo - Native iOS App crafted with Swift and SwiftUI
📱 Guideo - Native iOS App crafted with Swift and SwiftUI

Guideo An awesome iOS Native App 📱 About Guideo App wire-framed and crafted from scratch by a team of 4. Our final project of the  Apple Foundation

A completely native Discord client for macOS built 100% in Swift and SwiftUI

Swiftcord A completely native Discord client for macOS built 100% in Swift and SwiftUI This project aims to create a fully functional native Discord c

A native SoundCloud app for macOS, written in SwiftUI
A native SoundCloud app for macOS, written in SwiftUI

Nuage A native SoundCloud app for macOS, written in SwiftUI About Nuage is an independent and open-source project to build a native SoundCloud client

VerticalTabView is a native way to display paged vertical content in SwiftUI.

VerticalTabView 🔝 VTabView is a native way to display paged vertical content in SwiftUI. To work it makes use of the new iOS 14 TabView PageTabViewSt

Native iOS app built in SwiftUI, displays a collection of user's books.

Native iOS app built in SwiftUI, displays a collection of user's books.

A native, customizable SwiftUI refresh control
A native, customizable SwiftUI refresh control

Refresher A customizable, native Swift UI refresh control for iOS 14+ Why? the native SwiftUI refresh control only works on iOS 15+ the native UIKit r

An example project to demonstrate the new scripting capabilities of Shortcuts For Mac.
An example project to demonstrate the new scripting capabilities of Shortcuts For Mac.

Scripting Shortcuts Test Project This simple project is designed to test the new scripting capabilities introduced in the Shortcuts app in macOS Monte

The missing Apple Weather App for Mac.
The missing Apple Weather App for Mac.

BetterWeather The missing Weather App for your Mac and iPad. Installation for mac. Download the notarized, universal binary from here Click the curren

iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.
iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.

iCloud Drive is Apple's essential connection between all your devices, Mac, iPhone, iPad, even your Windows PC.While the cost of storage seems expensive in comparison to other online storage services, its advantage is that it works natively across all your devices.

Comments
  • Add workaround for identifier inconsistency on macOS 12

    Add workaround for identifier inconsistency on macOS 12

    Really appreciate that you've opened source this solution. I'm using it in one of my upcoming Catalyst apps 😃

    I ran into a small issue on macOS 12. It appears that the scene identifier differs between windowScene.session.persistentIdentifier and the identifier included in the UISBHSDidCreateWindowForSceneNotification notification.

    Here's an example between the two:

    • windowScene.session.persistentIdentifier: 1013C9AC-9C0C-493C-AE24-0AE09303B465
    • UISBHSDidCreateWindowForSceneNotification: FUScene|com.highcaffeinecontent.CatalystPrefsWindow(23541)|1013C9AC-9C0C-493C-AE24-0AE09303B465

    Therefore the fullscreen options wouldn't be disabled for the preferences window.

    The last part of the identifier is the same. I modified AppKitController so it only looks at the latter part of the scene identifier when comparing the scene identifier to the one provided from UIKit. It's not that pretty but it does the job.

    Tested on macOS 12 beta 3.

    opened by simonbs 2
Owner
Steven Troughton-Smith
Steven Troughton-Smith
QuickLook Preview for SwiftUI on Mac Catalyst

QuickLook Preview for SwiftUI on Mac Catalyst According to the documentation for

Tom Dai 9 Dec 31, 2022
Grid-based app for macOS Catalyst (Mac Idiom) with navigation stack

Catalyst Grid App Simple Catalyst example (Mac idiom) of a grid-based app with a push/pop navigation stack. Includes back button in toolbar that auto-

Steven Troughton-Smith 120 Nov 14, 2022
Window preview app for MacOS (on the dock) using AltTab.

DockAltTab The #1 Window manager/Task switcher & Companion for AltTab v1.1 download link https://github.com/steventheworker/DockAltTab/releases/downlo

Steven G. 40 Jan 2, 2023
A realistic reflective shimmer to SwiftUI Views that uses device orientation. Position any View relative to device orientation to appear as if through a window or reflected by the screen.

A 3d rotation effect that uses Core Motion to allow SwiftUI views to appear projected in a specific direction and distance relative to the device in r

Ryan Lintott 235 Dec 30, 2022
A simple clean application to provide you with weather forecast data as well as currency rates, all with beautiful melodies and sounds

A simple clean application to provide you with weather forecast data as well as currency rates, all with beautiful melodies and sounds.

Sergey 1 Jan 21, 2022
Mac-asksec - Test Mac Permissions from the Terminal

asksec A simple CLI to test permissions from any macOS terminal app. Building ru

Christian Zangl 1 Jan 18, 2022
Exposing macOS Services through a Catalyst app

CatalystServices This is a simple example to show how you can implement the macOS Services system in your Catalyst app. The services you expose are pr

Steven Troughton-Smith 33 Oct 26, 2022
A weather app developed in React Native. It is the React Native version of SwiftWeather.

ReactNativeWeather A weather app developed in React Native. It is the React Native version of SwiftWeather How to run the app Install react-native If

Jake Lin 22 Jun 7, 2022
Riddler is a riddle game built as a native iOS app in Swift using SwiftUI

Riddler is a riddle game built as a native iOS app in Swift using SwiftUI. It includes 50 challenging riddles with hints for when you get stuck. The game tracks your stats so you can compare your performance against your friends, and see who can answer all 50 riddles the quickest.

Oliver Stenning 3 Nov 23, 2022
Native iOS app using the exposure notification framework from Apple.

Corona Warn App - iOS Development • Documentation • Contribute • Support • Changelog • Licensing The goal of this project is to develop the official C

Corona-Warn-App 1.7k Dec 18, 2022