{"id":19750362,"url":"https://github.com/fredevteam/tkthememanagermodule","last_synced_at":"2026-05-15T13:04:46.908Z","repository":{"id":56922921,"uuid":"384658469","full_name":"FredevTeam/TKThemeManagerModule","owner":"FredevTeam","description":"theme manager module ","archived":false,"fork":false,"pushed_at":"2021-07-11T08:24:41.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-10-10T22:48:10.429Z","etag":null,"topics":["ios","macos","swift","theme"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FredevTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-10T09:19:02.000Z","updated_at":"2021-11-09T02:56:40.000Z","dependencies_parsed_at":"2022-08-21T05:20:22.198Z","dependency_job_id":null,"html_url":"https://github.com/FredevTeam/TKThemeManagerModule","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/FredevTeam/TKThemeManagerModule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredevTeam%2FTKThemeManagerModule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredevTeam%2FTKThemeManagerModule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredevTeam%2FTKThemeManagerModule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredevTeam%2FTKThemeManagerModule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FredevTeam","download_url":"https://codeload.github.com/FredevTeam/TKThemeManagerModule/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FredevTeam%2FTKThemeManagerModule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005460,"owners_count":26083902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","macos","swift","theme"],"created_at":"2024-11-12T02:33:36.740Z","updated_at":"2025-10-10T22:48:11.689Z","avatar_url":"https://github.com/FredevTeam.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TKThemeManagerModule\n\n[![CI Status](https://img.shields.io/travis/playtomandjerry@outlook.com/TKThemeManagerModule.svg?style=flat)](https://travis-ci.org/playtomandjerry@outlook.com/TKThemeManagerModule)\n[![Version](https://img.shields.io/cocoapods/v/TKThemeManagerModule.svg?style=flat)](https://cocoapods.org/pods/TKThemeManagerModule)\n[![License](https://img.shields.io/cocoapods/l/TKThemeManagerModule.svg?style=flat)](https://cocoapods.org/pods/TKThemeManagerModule)\n[![Platform](https://img.shields.io/cocoapods/p/TKThemeManagerModule.svg?style=flat)](https://cocoapods.org/pods/TKThemeManagerModule)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n## Installation\n\nTKThemeManagerModule is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'TKThemeManagerModule'\n```\n\n## example \n### 1. create theme protocl \n\n```\nprotocol ThemeProtocol:Theme  {\n    var textColor: UIColor { get }\n    var labelBackgroudColor: UIColor { get }\n    var backgroudColor: UIColor { get }\n}\n\n```\n### 2. create theme object exmaple: Dark, Light \n\n* Dark Theme \n\n```\n\nstruct DarkTheme : ThemeProtocol{\n    var textColor: UIColor = UIColor.yellow\n    \n    var labelBackgroudColor: UIColor = UIColor.green\n    \n    var backgroudColor: UIColor = UIColor.red\n}\n\n```\n\n* Light Theme\n\n```\nstruct LightTheme: ThemeProtocol {\n    var textColor: UIColor = UIColor.red\n    \n    var labelBackgroudColor: UIColor = UIColor.blue\n    \n    var backgroudColor: UIColor = UIColor.gray\n}\n```\n\nyou can create other theme struct or class \n\nand you can create theme type enum manager theme obj, for example: \n\n```\nenum ThemeType {\n    case light\n    case dark\n}\n\nextension ThemeType {\n    var theme: ThemeProtocol {\n        switch self {\n        case .dark:\n            return DarkTheme.init()\n        default:\n            return LightTheme.init()\n        }\n    }\n}\n\n```\n\n## 3. init manage and set default theme \n\n```\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n        ThemeManager\u003cThemeProtocol\u003e.shared.switch(ThemeType.light.theme)\n        return true\n    }\n\n```\n\n## 4. Operation of theme change \n### use notification \n\nhas two notification , Before the change `themeWillUpdateNotification` and After the change `themeUpdateEndNotification`\n\n```\n1. add notificaton observer \n\n NotificationCenter.default.addObserver(self, selector: #selector(themeChangeNotification), name: .themeUpdateEndNotification, object: nil) \n\n\n\n@objc private func themeChangeNotification() {\n       // TODO: update for theme\n}\n\n```\n### use protocol \n\n```\nlabel.theme.apply(ThemeProtocol.self) { [weak self] view, theme in\n    // TODO: update for theme ,\n    // view is label,\n    // theme is After the change\n}\n\n```\n\n\n## 5. change theme  \n\n```\nThemeManager.shared.switch(ThemeType.dark.theme)\n\n```\n\n\n\n## Author\n\nFredevTeam@outlook.com, playtomandjerry@gmail.com\n\n## License\n\nTKThemeManagerModule is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredevteam%2Ftkthememanagermodule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredevteam%2Ftkthememanagermodule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredevteam%2Ftkthememanagermodule/lists"}