Translucent Window Background Style is a Swift package with a custom SwiftUI window background style that creates a translucent window with a blur effect. This package allows you to add a translucent background style to your SwiftUI app's windows.
The Translucent Window Background Style package provides a TranslucentBackgroundStyle
struct that conforms to the WindowBackgroundStyle
protocol. This style creates a translucent window with a blur effect.
To use the Translucent Window Background Style in your SwiftUI app, follow these steps:
Import the package in your SwiftUI view file:
import TranslucentWindowBackgroundStyle
Apply the presentedWindowBackgroundStyle
modifier to your window view, and pass in an instance of TranslucentBackgroundStyle
:
WindowGroup {
ContentView()
.presentedWindowBackgroundStyle(.hiddenTitleBarTranslucent)
}
The hiddenTitleBarTranslucent
static property of TranslucentBackgroundStyle
provides a convenient method to create a translucent window without a title bar.
TranslucentBackgroundStyle.hiddenTitleBarTranslucent
The Translucent Window Background Style package can be installed via Swift Package Manager. To install, follow these steps:
Open your project in Xcode.
Click on File > Swift Packages > Add Package Dependency.
Enter the following URL in the search bar:
https://github.com/DominatorVbN/TranslucentWindowBackgroundStyle
Replace "your-username" with your GitHub username or the URL of your forked repository if you want to used the foked version in your app.
Choose the version or branch of the package that you want to install.
Click on the Add Package button.
Add TranslucentWindowBackgroundStyle
to the list of dependencies for your target in your project's Package.swift
file:
dependencies: [
.package(url: "https://github.com/DominatorVbN/TranslucentWindowBackgroundStyle", .upToNextMinor(from: "1.0.0"))
]
Replace "your-username" with your GitHub username or the URL of your forked repository if you want to used the foked version in your app., and "1.0.0" with the version or branch that you installed.
Import the package in your SwiftUI view file:
import TranslucentWindowBackgroundStyle
You're now ready to use the Translucent Window Background Style in your SwiftUI app!
Contributions are always welcome, whether it's bug fixes, feature enhancements, or documentation improvements. To contribute, please follow these steps:
git checkout -b feature/your-feature-name
git commit -m 'Add some feature'
git push origin feature/your-feature-name
Thank you for your contributions!
link |
Stars: 9 |
Last commit: 3 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics