{"id":18763718,"url":"https://github.com/inloop/inlthemes","last_synced_at":"2025-04-13T04:32:47.587Z","repository":{"id":77722245,"uuid":"52414503","full_name":"inloop/INLThemes","owner":"inloop","description":"An iOS library for supporting multiple UI themes","archived":false,"fork":false,"pushed_at":"2017-11-06T08:13:20.000Z","size":79,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T21:45:57.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/inloop.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-24T04:34:38.000Z","updated_at":"2017-11-06T08:12:36.000Z","dependencies_parsed_at":"2023-02-28T16:30:58.484Z","dependency_job_id":null,"html_url":"https://github.com/inloop/INLThemes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloop%2FINLThemes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloop%2FINLThemes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloop%2FINLThemes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inloop%2FINLThemes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inloop","download_url":"https://codeload.github.com/inloop/INLThemes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248664179,"owners_count":21141909,"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","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":[],"created_at":"2024-11-07T18:27:12.820Z","updated_at":"2025-04-13T04:32:47.573Z","avatar_url":"https://github.com/inloop.png","language":"Objective-C","readme":"# INLThemes\n\n## 1. Overview\nINLThemes is an iOS library for supporting multiple UI themes.\nThe themes are stored in either a plist or a json file.\n\n## 2. Setup\n### 2.1. Set the elementIds\nThe framework maps theme attributes in the configuration file (text, colours, fonts, constraints, images) to objects using `elementId`s that identifies specific views. You can use one `elementId` for multiple views (e.g. all buttons).\nThe `elementId` can be set in storyboards. No subclassing is required - after linking the framework `elementId` will be automatically available for all `UIView`s, `UIBarItem`s and `NSLayoutConstraint`s. See section 3 for details on the configuration files and supported theme attributes.\n\n### 2.2. Apply the theme\nFirst `import INLThemes`.\n\nYou can create a theme with the name of your configuration file and then apply it to the application.\n```\nlet theme = Theme(plist: “MyTheme\")\nThemeService.apply(theme)\n```\n\nFor views that are created dynamically (e.g. `UITableViewCell`) use the `applyTheme(to:)` method when creating them.\n```\nThemeService.applyTheme(to: newView)\n```\n\n### 2.3 Register your view controllers\n```\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    ThemeService.register(self)\n}\n\ndeinit {\n    ThemeService.remove(self)\n}\n```\nThis will automatically apply the theme when it changes. It can be done before or after applying the theme. You can also register a `UIView` (e.g. if you can’t subclass a view controller).\n\n\n## 3. Theme configuration files\nThe library supports two formats: plist and json. The basic structure for both is a dictionary that maps elementIds to dictionaries of theme attributes. For example:\n```\n--------- plist ---------\n\u003cdict\u003e\n\t\u003ckey\u003emainVC.topLabel\u003c/key\u003e\n\t\u003cdict\u003e\n\t\t\u003ckey\u003etextColor\u003c/key\u003e\n\t\t\u003cstring\u003e#ffffff\u003c/string\u003e\n\t\t\u003ckey\u003efont\u003c/key\u003e\n\t\t\u003cstring\u003eHelvetica\u003c/string\u003e\n\t\t\u003ckey\u003efontSize\u003c/key\u003e\n\t\t\u003cinteger\u003e12\u003c/integer\u003e\n\t\u003c/dict\u003e\n\t\u003ckey\u003emainVC.aButton\u003c/key\u003e\n\t\u003cdict\u003e\n\t\t\u003ckey\u003ebackgroundColor\u003c/key\u003e\n\t\t\u003cstring\u003e#888888\u003c/string\u003e\n\t\t\u003ckey\u003ecornerRadius\u003c/key\u003e\n\t\t\u003cinteger\u003e10\u003c/integer\u003e\n\t\u003c/dict\u003e\n\u003c/dict\u003e\n--------- json ---------\n{\n\t\"mainVC.topLabel\": {\n\t\t\"textColor\": \"#ffffff\",\n\t\t\"font\": \"Helvetica”,\n\t\t\"fontSize”: 12\n\t},\n\t\"mainVC.aButton\": {\n\t\t\"backgroundColor\": \"#888888\",\n\t\t\"cornerRadius\": 10\n\t}\n}\n```\n\nThe following theme attributes are supported:\n\n**UIView:** alpha, backgroundColor, cornerRadius, hidden, tintColor\u003cbr\u003e\n**UIButton:** color, font, fontSize, image, text, textColor\u003cbr\u003e\n**UICollectionViewCell:** backgroundColor, selectedBackgroundColor\u003cbr\u003e\n**UIImageView:** image\u003cbr\u003e\n**UILabel:** font, fontSize, text, textColor\u003cbr\u003e\n**UINavigationBar:** barTintColor\u003cbr\u003e\n**UIPageControl:** color, inactiveColor\u003cbr\u003e\n**UIScrollView:** useDarkIndicator\u003cbr\u003e\n**UITabBar:** barTintColor\u003cbr\u003e\n**UITableView:** separatorColor\u003cbr\u003e\n**UITableViewCell:** backgroundColor, selectedBackgroundColor\u003cbr\u003e\n**UITextField:** font, fontSize, placeholderColor, placeholder, text, textColor\u003cbr\u003e\n**UITextView:** font, fontSize, text, textColor\u003cbr\u003e\n**UIBarButtonItem:** color, image\u003cbr\u003e\n**UITabBarItem:** image, selectedImage, title\u003cbr\u003e\n**NSLayoutConstraint:** active, constant, priority\u003cbr\u003e\n\n## 4. Supporting additional properties\n\nIf the framework does not support an attribute you’d like to configure or you’d like to use the library for your custom properties, you can override the `apply` method in a subclass. If the object is not a subclass of `UIView`, `UIBarItem` or `NSLayoutConstraint` your class needs to conform to the `ThemedView` protocol.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finloop%2Finlthemes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finloop%2Finlthemes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finloop%2Finlthemes/lists"}