{"id":15086063,"url":"https://github.com/home-assistant/iconic","last_synced_at":"2025-10-05T16:30:27.781Z","repository":{"id":40792968,"uuid":"60936689","full_name":"home-assistant/Iconic","owner":"home-assistant","description":":art: Auto-generated icon font library for iOS, watchOS and tvOS","archived":true,"fork":false,"pushed_at":"2022-06-23T16:06:03.000Z","size":27808,"stargazers_count":1575,"open_issues_count":0,"forks_count":87,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-01-10T12:17:30.455Z","etag":null,"topics":["code-generator","icon-font","interface-builder","ios","swift","tvos","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/home-assistant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-12T02:03:36.000Z","updated_at":"2024-12-30T00:47:35.000Z","dependencies_parsed_at":"2022-08-10T00:52:22.701Z","dependency_job_id":null,"html_url":"https://github.com/home-assistant/Iconic","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/home-assistant%2FIconic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/home-assistant%2FIconic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/home-assistant%2FIconic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/home-assistant%2FIconic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/home-assistant","download_url":"https://codeload.github.com/home-assistant/Iconic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235418239,"owners_count":18987130,"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":["code-generator","icon-font","interface-builder","ios","swift","tvos","watchos"],"created_at":"2024-09-25T07:05:22.945Z","updated_at":"2025-10-05T16:30:24.239Z","avatar_url":"https://github.com/home-assistant.png","language":"Swift","readme":"**This library is no longer maintained due to [underlying issues](https://github.com/SwiftGen/SwiftGen/pull/638).**\n\n---\n\n![Iconic Header](Screenshots/screenshot_iconic_header.png)\n\n[![Travis](https://travis-ci.org/home-assistant/Iconic.svg?branch=master)](https://travis-ci.org/home-assistant/Iconic/builds)\n[![codecov](https://codecov.io/gh/home-assistant/Iconic/badge.svg)](https://codecov.io/gh/home-assistant/Iconic)\n[![Pod Version](http://img.shields.io/cocoapods/v/Iconic.svg)](http://cocoadocs.org/docsets/Iconic/)\n[![Pod Platforms](https://img.shields.io/cocoapods/p/Iconic.svg)](https://cocoapods.org/pods/Iconic)\n[![Swift Version](https://img.shields.io/badge/swift4.2-compatible-brightgreen.svg)]()\n[![License](https://img.shields.io/cocoapods/l/Iconic.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n**Iconic** helps making icon fonts integration effortless on iOS, tvOS and watchOS. Its main component is in charge of auto-generating strongly typed Swift code with [SwiftGen](https://github.com/SwiftGen/SwiftGen), compatible with Objective-C.\n\nYou will interact with an auto-generated class under the name of `{FontName}Icon.swift`, which is a light abstraction of the `IconDrawable.swift` protocol. For more information, have a look at [how to install](#installation) and [how to use](#how-to-use).\n\nGive **Iconic** a test drive by simply doing `pod try Iconic` in your terminal, and pick the `Samples.xcworkspace`.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/home-assistant/Iconic/blob/master/Screenshots/screenshot_scale.gif?raw=true\" alt=\"Scale Example\"/\u003e\n\u003c/p\u003e\n\n\n## Why Icon Fonts?\n- Resolution independent: scale and tint without quality loss\n- Automatically scaled for different screen densities\n- Work with (way) less image files\n- Improve visual consistency\n- Platform agnostic\n- Add better UI accessibility\n- Simple to work with\n\n#### Where can I find awesome icon fonts?\n- Check out the [icon fonts available in this repo](./Fonts)!\n- There are many [open sourced icon fonts](http://fontello.com/) out there (most are available under the [SIL Open Font License](http://scripts.sil.org/OFL)). They are designed for the web but they are still very useful for iOS.\n- You can ask your nearest friendly designer! Making an icon font isn't that hard, specially if you already have the vector assets.\n- You can [read this article](http://rafaltomal.com/how-to-create-and-use-your-own-icon-fonts/) and give [fontastic.me](http://fontastic.me/) a shot.\n\n\n## Key Features\n- [Easy installation over CocoaPods](#installation)\n- Auto-generated enums and unicodes mapping, out of the font's [PUA range](https://en.wikipedia.org/wiki/Private_Use_Areas)\n- `NSAttributedString` and `UIImage` outputs\n- Supports TTF and OTF font files\n- Fonts are included and registered dynamically\n- [Interface Builder support](#interface-builder-support) (iOS \u0026 tvOS only)\n- [UIKit extensions](#uikit-extensions) for `UIBarButtonItem`, `UITabBarItem` and `UIButton` (iOS \u0026 tvOS only)\n- Auto-generated [icon font html catalog](#icon-font-catalog)\n- Compatible with Swift 3.0 and Objective-C\n- iOS 8 or later\n- tvOS 9 or later\n- [watchOS 2 or later](#about-watchos-support)\n\n_Note: Some open sourced icon fonts don't include the names of each of their glyphs. This could result in a non-descriptive enums, which can make things less intuitive for you when using Iconic. If you create your own icon font, make sure to properly name each glyph._\n\n\n## Installation\n\n#### Via CocoaPods\n\nStart by defining **Iconic** on your Podfile. Because we use an environment variable on a non-traditional setup, you will need to do it the following way:\n```ruby\npod 'Iconic', :git =\u003e 'https://github.com/home-assistant/Iconic.git', :tag =\u003e '1.3'\n```\n\nTo install **Iconic** with a custom icon font, you need to use the `FONT_PATH` environment variable:\n```ruby\nFONT_PATH='/Users/WillFerrell/Desktop/super-duper-font.otf' pod install\n\nFONT_PATH='/Users/WillFerrell/Desktop/super-duper-font.otf' pod update Iconic\n```\n\nIf you simply call `pod install`, **Iconic** will be installed using its default font, [FontAwesome](https://github.com/FortAwesome/Font-Awesome).\n\nAfter the installation is complete, you should see 3 files: `IconDrawable.swift`, the auto-generated `{FontName}Icon.swift` and the font file added as a resource:\n![Pod Setup](Screenshots/screenshot_pod_setup.png)\n\n\n## How to use\nFor complete documentation, [visit Iconic's docs](http://cocoadocs.org/docsets/Iconic/).\n\n### Import\nImport the Iconic module:\n\u003cdetails open\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\nimport Iconic\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objc\n@import Iconic;\n```\n\u003c/details\u003e\n\n\n### Registering the icon font\nRegistration is required to activate Iconic. You shall do this once, when launching your application. Internally, the icon mapping is retrieved and kept in memory during the application's life term.\n\nIconic provides a convenient way to register the icon font:\nNote: the method name may change depending of your icon font's name:\n\u003cdetails open\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\nFontAwesomeIcon.register()\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objc\n[Iconic registerFontAwesomeIcon];\n```\n\u003c/details\u003e\n\n## Use as images\nYou can construct an `UIImage` instance out of a font's icon and tint it. This may be very convenient for integrating with existing UIKit controls which expect `UIImage` objects already.\n\nImages are created using NSStringDraw APIs to render a `UIImage` out of an `NSAttributedString`.\n\u003cdetails open\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\nlet size = CGSize(width: 20, height: 20)\n\nlet icon = FontAwesomeIcon.HomeIcon\nlet image = icon.image(ofSize: size, color: .blue)\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objc\n[Iconic imageWithIcon:FontAwesomeIconHomeIcon size:CGSizeMake(20, 20) color:[UIColor blueColor]];\n```\n\u003c/details\u003e\n\n### Use as attributed strings\nYou may need to icons as text too, and simplify your layout work.\nFor example, instead of having an image and a label, you can combined it all in one single label:\n\u003cdetails open\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\nlet icon = FontAwesomeIcon.HomeIcon\nlet iconString = icon.attributedString(ofSize: 20, color: .blue)\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objc\n[Iconic attributedStringWithIcon:FontAwesomeIconHomeIcon pointSize:20.0 color:[UIColor blueColor]];\n```\n\u003c/details\u003e\n\n### Use as unicode string\nUltimately, you may need to retrieve the unicode string representation on an icon to do more advanced things:\n\u003cdetails open\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\nlet unicode = FontAwesomeIcon.HomeIcon.unicode\n```\n\u003c/details\u003e\n\n### Use as font\nFor further customization, you may need to use the UIFont object instead:\n\u003cdetails open\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\nlet font = FontAwesomeIcon.font(ofSize: 20)\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objc\nUIFont *font = [Iconic fontAwesomeIconFontOfSize:20.0];\n```\n\u003c/details\u003e\n\n\n### Interface Builder Support\n![Interface Builder](Screenshots/screenshot_interface_builder.gif)\n\nIconic includes a `UIImageView` subclass under the name of `{FontName}IconView.swift`, conforming to `@IBInspectable`. This class allows IB integration with little effort:\n- Use the `iconName` attribute to set the icon on Interface Builder (use the [icon font html catalog](#icon-font-catalog) as reference for icon names).\n- Adjust the bounds of the view to see it dynamically adjust the icon size.\n\n\n### UIKit Extensions\nUIKit extensions are also included, just to make your code look simpler:\n\u003cdetails open\u003e\n\u003csummary\u003eSwift\u003c/summary\u003e\n\n```swift\n// UITarbBarItem\nUITabBarItem(withIcon: .BookIcon, size: CGSize(width: 20, height: 20), title: \"Catalog\")\n\n// UIBarButtonItem\nUIBarButtonItem(withIcon: .BookIcon, size: CGSize(width: 24, height: 24), target: self, action: #selector(didTapButton))\n\n// UIButton\nlet button = UIButton(type: .System)\nbutton.setIconImage(icon: .HeartIcon, size: CGSize(width: 44, height: 44), color: nil, forState: .Normal)\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eObjective-C\u003c/summary\u003e\n\n```objc\n// UITarbBarItem\n[[UITabBarItem alloc] initWithIcon:FontAwesomeIconBookIcon size:CGSizeMake(20.0, 20.0) title:@\"Catalog\"];\n\n// UIBarButtonItem\n[[UIBarButtonItem alloc] initWithIcon:FontAwesomeIconCogIcon size:CGSizeMake(24.0, 24.0) target:self action:@selector(didTapButton)];\n\n// UIButton\nUIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];\n[button setIconImageWithIcon:FontAwesomeIconHeartIcon size:CGSizeMake(44.0, 44.0) color:nil forState:UIControlStateNormal];\n```\n\u003c/details\u003e\n\n\n## Sample Project\nCheck out the sample project, everything is demo'd there.\n![Sample Project](Screenshots/screenshot_sample_proj.png)\n\nGive Iconic a test drive by simply doing `pod try Iconic` in your terminal, and pick the `Samples.xcworkspace`.\n\nOn the sample project, Iconic is installed as a development pod. Because of this, pod files are not versioned. Therefore, if you clone the repo manually, you will to install the pods yourself.\n\n#### About watchOS support:\nWhen running the watchOS example, you might get a \"No such module CoreText\" error. This is because the CoreText.framework is missing for the watchOS Simulator. Run the 'WatchSimulator-CoreText-Patch.sh' script located in this repository, to copy the CoreText header files from the WatchOS SDK. You will then be able to run the watchOS sample with no issues as well as running Iconic on your Watch apps in the simulator.\n\n## Icon Font Catalog\nBesides the auto-generated Swift code, an icon font catalog will be added in `Pods/Iconic/Source/Catalog`. Use this as a visual reference about the icons and their names.\n\n![Icon Font Catalog](Screenshots/screenshot_icon_catalog.png)\n\n_Note: if you are using Chrome as your default browser, you will need to restart it using the `open -a 'Google Chrome' --args -allow-file-access-from-files` in the command line to be able to open view the catalog. This is because the html's javascript loads a local json file and Chrome has built-in security features to disable it. You can also use any other web browser like Safari or Firefox to open the catalog html._\n\n\n## Icon Font Samples\nThis repository also [includes a few open source and free icon fonts](./Fonts) for you to try Iconic with:\n* [FontAwesome](https://github.com/FortAwesome/Font-Awesome) by *Dave Gandy*\n* [Dripicons](https://github.com/amitjakhu/dripicons) by *Amit Jakhu*\n* [open-iconic](https://github.com/iconic/open-iconic) by *Waybury*\n* [MaterialIcons](https://github.com/google/material-design-icons) by *Google*\n* [Linearicons](https://linearicons.com/) by *Perxis*\n\n\n## Acknowledgements\n\nIconic was originally developed by [Ignacio Romero Zurbuchen](https://github.com/dzenbot). For more credits, please see [AUTHORS.md](AUTHORS.md).\n\n## License\nThis library is licensed under the [Apache 2.0](LICENSE.md) license.\n\nSwiftGen is licensed under the [MIT License](https://github.com/SwiftGen/SwiftGen/blob/master/LICENCE).\n\nThe Font Awesome font is licensed under the [SIL OFL 1.1 License](http://scripts.sil.org/OFL)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhome-assistant%2Ficonic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhome-assistant%2Ficonic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhome-assistant%2Ficonic/lists"}