概要
macOSアプリをノッチ時代にスムーズに対応させます。
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルDynamicNotchKit
DynamicNotchKit provides a set of tools to help you integrate your macOS app with the new notch on modern MacBooks. It attempts to provide a similar experience to iOS's Dynamic Island, allowing you to display notifications and updates in a visually appealing way. It handles the complexities of managing the notch area, such as drawing a custom window, ensuring proper content insets and safe areas. This enables you to create a polished user experience that feels native to the platform, while still feeling innovative and fresh.
Installation
Compatibility: macOS 13+
Add https://github.com/MrKai77/DynamicNotchKit in the “Swift Package Manager” tab in Xcode.
Usage
It's really easy! All the UI is handled by SwiftUI. That means that you can use your existing views directly in DynamicNotchKit!
Here's an example:
let notch = DynamicNotch {
ContentView()
}
await notch.expand()
Where ContentView conforms to View.
DynamicNotchKit also supports Macs without a notch, meaning that this package supports all Mac styles! You will see an example of that below.
DynamicNotchInfo
In addition, there is also a DynamicNotchInfo, which is a fine-tuned version of the DynamicNotch specifically tailored to show general information:
let notch = DynamicNotchInfo(
icon: .init(systemName: "figure"),
title: "Figure",
description: "Looks like a person"
)
await notch.expand()
This will result in a popover as so:

Furthermore, there is a .floating style, which will automatically be used on Macs without a notch:

This is only a basic glimpse into this framework's capabilities. Documentation is available for all public methods and properties, so I encourage you to take a look at it for more advanced usage. Alternatively, you can take a look at the unit tests for this package, where I have added some usage examples as well.
Feel free to ask questions/report issues in the Issues tab!
License
This project is licensed under the MIT license.
関連プロジェクトを探す
読み込み中…