KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#claude-code
#codex
#cli
#developer-tools
#react
#windows
RxTheme
★ 377
Open GitHub ↗
Theme management based on Rx
Download README (.md)
Explore Similar Repositories
awesome-AI-system
:
paper and its code for AI System
dapper
:
Docker build wrapper
Vanilla-DataTables
:
A lightweight, dependency-free javascript HTML table plugin
ngrx-forms
:
Enhance your forms in Angular applications with the power of ngrx
zephyr-nvim
:
A dark neovim colorscheme written in lua
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
RxTheme
?
Download (.md)
# RxTheme [](https://travis-ci.org/RxSwiftCommunity/RxTheme) [](http://cocoapods.org/pods/RxTheme) [](https://github.com/Carthage/Carthage) [](http://cocoapods.org/pods/RxTheme) [](http://cocoapods.org/pods/RxTheme) ## Manual ### Define theme service ```swift import RxTheme protocol Theme { var backgroundColor: UIColor { get } var textColor: UIColor { get } } struct LightTheme: Theme { let backgroundColor = .white let textColor = .black } struct DarkTheme: Theme { let backgroundColor = .black let textColor = .white } enum ThemeType: ThemeProvider { case light, dark var associatedObject: Theme { switch self { case .light: return LightTheme() case .dark: return DarkTheme() } } } let themeService = ThemeType.service(initial: .light) ``` ### Apply theme to UI ```swift // Bind stream to a single attribute // RxTheme would automatically manage the lifecycle of the binded stream view.theme.backgroundColor = themeService.attribute { $0.backgroundColor } ``` ### Switch themes ```swift themeService.switch(.dark) // When this is triggered by some signal, you can use: someSignal.bind(to: themeService.switcher) ``` ### Other APIs ```swift // Current theme type themeService.type // Theme type stream themeService.typeStream ``` ## Examples You can run the example project, clone the repo, run `pod install` from the Example directory first, and open up the workspace file. ## Installation ### SPM 1. File > Swift Packages > Add Package Dependency 2. Add https://github.com/RxSwiftCommunity/RxTheme ### Cocoapods ```ruby pod 'RxTheme', '~> 6.0' ``` ### Carthage ``` github "RxSwiftCommunity/RxTheme" ~> 6.0.0 ``` ## Author duan, wddwyss@gmail.com ## License RxTheme is available under the MIT license. See the LICENSE file for more info.