Themeable provides easy to setup theme management in your app. It doesn't use NotificationCenter.
- Swift 6.0+
- iOS 13.0+ / macOS 11.0+
- Xcode 16.0+
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.
Once you have your Swift package set up, adding Themeable as a dependency is as easy as adding it to the dependencies value of your Package.swift.
dependencies: [
.package(url: "https://github.com/GianniCarlo/Themeable.git", .upToNextMajor(from: "3.0.0"))
]Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthageTo integrate Themeable into your Xcode project using Carthage, specify it in your Cartfile:
github "GianniCarlo/Themeable" ~> 3.0.0
Run carthage update to build the framework and drag the built Themeable.framework into your Xcode project.
Version 3.0.0 adopts Swift 6 strict concurrency. All core types (ThemeProvider, Themeable, Theme, SubscribableValue) are now @MainActor-isolated.
What you need to change:
- Your
ThemeProviderimplementation must be@MainActor(or already inherit it, e.g. from a UIViewController) - If you were accessing
Themeproperties from a background thread, wrap the access inMainActor.run { ... }
What stays the same:
- All method signatures are unchanged
Themeis still anopen class— subclassing works as beforesetUpTheming()called fromviewDidLoad()works without changes (UIViewControllers are already@MainActor)
- Provide a theme manager that conforms to the protocol
ThemeProvider. - Any object that you want to react to the change of the new theme, should conform to the protocol
Themeable