{"id":1517,"url":"https://github.com/vpeschenkov/LetterAvatarKit","last_synced_at":"2025-08-06T13:32:46.141Z","repository":{"id":45979830,"uuid":"105822483","full_name":"vpeschenkov/LetterAvatarKit","owner":"vpeschenkov","description":"📲 Use this extension 🧩 to create letter-based avatars or placeholders 🎭 to be utilized within your app","archived":false,"fork":false,"pushed_at":"2022-12-21T13:00:24.000Z","size":706,"stargazers_count":218,"open_issues_count":0,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-22T09:49:53.125Z","etag":null,"topics":["avatar","carthage","cocoapods","gmail-avatar","initials","initials-avatar","ios","jazzy","letter-avatar","objective-c","placeholder-image","placeholders","swift","swift-framework","swift5","uiimage-extension","uiimageview-category","uiimageview-letters"],"latest_commit_sha":null,"homepage":"","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/vpeschenkov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-04T21:54:18.000Z","updated_at":"2024-06-13T09:51:01.000Z","dependencies_parsed_at":"2022-08-12T12:40:24.689Z","dependency_job_id":null,"html_url":"https://github.com/vpeschenkov/LetterAvatarKit","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpeschenkov%2FLetterAvatarKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpeschenkov%2FLetterAvatarKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpeschenkov%2FLetterAvatarKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpeschenkov%2FLetterAvatarKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpeschenkov","download_url":"https://codeload.github.com/vpeschenkov/LetterAvatarKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215780271,"owners_count":15929791,"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":["avatar","carthage","cocoapods","gmail-avatar","initials","initials-avatar","ios","jazzy","letter-avatar","objective-c","placeholder-image","placeholders","swift","swift-framework","swift5","uiimage-extension","uiimageview-category","uiimageview-letters"],"created_at":"2024-01-05T20:15:48.326Z","updated_at":"2024-08-17T16:30:55.275Z","avatar_url":"https://github.com/vpeschenkov.png","language":"Swift","funding_links":[],"categories":["Media","Libs","Images [🔝](#readme)"],"sub_categories":["Image","Images","Other free courses"],"readme":"# LetterAvatarKit\n\n![][Swift Version] ![][Pods] ![][Platform] ![][Carthage compatible] ![][Codacy Badge]\n![][Travis]\n\n`LetterAvatarKit` provides an ```UIImage``` extension for generating letter-based avatars/placeholders. There are a few images showing what you can achive by using this framework:\n\n![][screenshots]\n\n## Requirements\n- iOS 8+\n- tvOS 9+\n- Swift 4.0+\n\n## Features\n- Easy to use and intuitive interface\n- Highly flexible API allows for customization and integration into various projects\n- Use of the builder pattern for constructing avatar configurations\n- Support for creating circular, square, or bordered images\n- Wide range of flat UI colors available\n- Compatible with tvOS platform\n\n## Installation\n\n### [CocoaPods](https://cocoapods.org)\n\n`LetterAvatarKit` is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n```ruby\npod \"LetterAvatarKit\", \"1.2.5\" # Swift 5.0+, Xcode 12\npod \"LetterAvatarKit\", \"1.2.3\" # Swift 5.0+, Xcode 11\npod \"LetterAvatarKit\", \"1.1.7\" # Swift 4.2\npod \"LetterAvatarKit\", \"1.1.5\" # Swift 4.0\n```\n\n### [Carthage](https://github.com/Carthage/Carthage)\n\nAdd this to `Cartfile`\n\n```ruby\ngithub \"vpeschenkov/LetterAvatarKit\" == 1.2.5 # Swift 5.0+, Xcode 12\ngithub \"vpeschenkov/LetterAvatarKit\" == 1.2.3 # Swift 5.0+, Xcode 11\ngithub \"vpeschenkov/LetterAvatarKit\" == 1.1.7 # Swift 4.2\ngithub \"vpeschenkov/LetterAvatarKit\" == 1.1.5 # Swift 4.0\n```\n\n```sh\n$ carthage update\n```\n\n## Usage\n\n### Swift\n\nUsing `LetterAvatarMaker`:\n\n```swift\n// Square avatar image\nlet avatarImage = LetterAvatarMaker()\n    .setUsername(\"Letter Avatar\")\n    .build()\navatarImageView.image = avatarImage\n\n// Circle avatar image with white border\nlet circleAvatarImage = LetterAvatarMaker()\n    .setCircle(true)\n    .setUsername(\"Letter Avatar\")\n    .setBorderWidth(1.0)\n    .setBackgroundColors([ .red ])\n    .build()\navatarImageView.image = circleAvatarImage\n```\n\nUsing `LetterAvatarMaker` with closures:\n\n```swift\nlet avatarImage = LetterAvatarMaker()\n    .build { c in\n        c.username = \"Letter Avatar\"\n    }\navatarImageView.image = avatarImage\n\nlet avatarImage = LetterAvatarMaker()\n    .build { c in\n        c.circle = true\n        c.username = \"Letter Avatar\"\n        c.borderWidth = 1.0\n        c.backgroundColors = [ .red ]\n    }\navatarImageView.image = avatarImage\n```\n\nUsing `LetterAvatarBuilderConfiguration`:\n```swift\nlet configuration = LetterAvatarBuilderConfiguration()\nconfiguration.username = \"Letter Avatar\"\navatarImageView.image = UIImage.makeLetterAvatar(withConfiguration: configuration)\n```\n\nUsing UIImage extension:\n```swift\navatarImageView.image = UIImage.makeLetterAvatar(withUsername: \"Letter Avatar\")\n```\n\n### Objective-C\n\nUsing `LKLetterAvatarBuilderCongiguration`:\n```objc\nLKLetterAvatarBuilderCongiguration *configuration = [[LKLetterAvatarBuilderCongiguration alloc] init];\nconfiguration.username = @\"Letter Avatar\";\nself.avatarImageView.image = [UIImage lk_makeLetterAvatarWithConfiguration:configuration];\n```\nUsing UIImage extension:\n```objc\nself.avatarImageView.image = [UIImage lk_makeLetterAvatarWithUsername:@\"Letter Avatar\"];\n```\n\n## Customization\n\nYou can configure the following properties of `LetterAvatarBuilderConfiguration`:\n\n```swift\n/// The username.\nopen var username: String?\n```\n\n```swift\n/// The size of an avatar image.\nopen var size: CGSize = CGSize(width: 80, height: 80)\n```\n\n```swift\n/// The flag that indicates of using single only one letter, otherwise,\n/// as much as wil be possible to obtain. But no more than 3 letters.\nopen var isSingleLettered: Bool = false\n```\n\n```swift\n/// The letters font.\nopen var lettersFont: UIFont = UIFont.systemFont(ofSize: 16.0)\n```\n\n```swift\n/// The letters colors\nopen var lettersColor: UIColor = LKUIColorByRGB(red: 236, green: 240, blue: 241)\n```\n\n```swift\n/// The background colors of an image.\nopen var backgroundColors: [UIColor] = UIColor.colors\n```\n\n```swift\n/// The letters font attributes.\nopen var lettersFontAttributes: [NSAttributedString.Key: Any]?\n```\n\n```swift\n/// Indicates whether to generate circle or square image.\nopen var circle: Bool = false\n```\n\n```swift\n/// The border width of the image.\nopen var borderWidth: CGFloat = 0.0\n```\n\n```swift\n/// The border color of the image.\nopen var borderColor: UIColor = UIColor.white\n```\n\n```swift\n/// A Boolean flag indicating whether the avatar is opaque.\nopen var opaque: Bool = false\n```\n\n## Community\n\nQuestions, comments, issues, and pull requests are welcome!\n\n## Contacts\n\n- [GitHub](https://github.com/vpeschenkov)\n- [Twitter](https://twitter.com/vpeschenkov)\n\n## License\n\nDistributed under the MIT license. See [LICENSE](https://github.com/vpeschenkov/LetterAvatarKit/blob/master/LICENSE) for more information.\n\n[Screenshots]: https://i.imgur.com/n3SjH6q.jpg\n[Platform]: https://cocoapod-badges.herokuapp.com/p/LetterAvatarKit/badge.png\n[Travis]: https://travis-ci.org/vpeschenkov/LetterAvatarKit.svg?branch=master\n[Pods]: https://cocoapod-badges.herokuapp.com/v/LetterAvatarKit/badge.png\n[Swift Version]: https://img.shields.io/badge/swift-5.0-orange.svg?style=flat\n[Codacy Badge]: https://api.codacy.com/project/badge/Grade/d0f9b1a4ccb64d4aacd18a971e4cf8b7\n[Carthage compatible]: https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat(https://github.com/Carthage/Carthage)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpeschenkov%2FLetterAvatarKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpeschenkov%2FLetterAvatarKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpeschenkov%2FLetterAvatarKit/lists"}