All Projects → vpeschenkov → Letteravatarkit

vpeschenkov / Letteravatarkit

Licence: mit
📦 An extension that generates letter-based avatars/placeholders

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Letteravatarkit

Nearbyweather
NearbyWeather is an open source weather app for iOS, which uses the OpenWeatherMap API. With this project developers are invited to learn advanced iOS concepts, as well as to contribute further advancements. Fork this repo to get started.
Stars: ✭ 146 (-18.89%)
Mutual labels:  fastlane
Shift
Animate gradient changes with time or motion for iOS Swift
Stars: ✭ 165 (-8.33%)
Mutual labels:  swift-framework
Notautolayout
Layout your views without Auto Layout constraints, in a much more swifty way.
Stars: ✭ 171 (-5%)
Mutual labels:  swift-framework
Makehuman Js
A library to build 3D human characters in the browser
Stars: ✭ 147 (-18.33%)
Mutual labels:  avatar
Clendar
Clendar - universal calendar app. Written in SwiftUI. Available on App Store
Stars: ✭ 153 (-15%)
Mutual labels:  fastlane
Knead proj
游戏中捏脸的实现
Stars: ✭ 169 (-6.11%)
Mutual labels:  avatar
Vue Image Crop Upload
A beautiful vue component for image cropping and uploading. (vue图片剪裁上传组件)
Stars: ✭ 1,892 (+951.11%)
Mutual labels:  avatar
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (-1.67%)
Mutual labels:  swift-framework
Upcomingmovies
Movies app written in Swift 5 using the TMDb API and demonstrating Clean Architecture, Dependency Injection, MVVM and Coordinators.
Stars: ✭ 160 (-11.11%)
Mutual labels:  fastlane
Swifthub
GitHub iOS client in RxSwift and MVVM-C clean architecture
Stars: ✭ 2,330 (+1194.44%)
Mutual labels:  fastlane
Swiftywebrtc
Swift Framework for WebRTC
Stars: ✭ 147 (-18.33%)
Mutual labels:  swift-framework
Facemoji Kit
Face tracker with blend shapes coefficients, 3D head pose and dense mesh in real-time on iOS, Android, Mac, PC and Linux.
Stars: ✭ 158 (-12.22%)
Mutual labels:  avatar
Commander
🚀The framework to write type-safe and structured command line program easily in Swift.
Stars: ✭ 170 (-5.56%)
Mutual labels:  swift-framework
Bookstore Ios
 Sample iOS App - A collection of examples and patterns for Unit Testing, UI Testing, handling Result/Optionals, writing documentation, and more. Details in README.
Stars: ✭ 147 (-18.33%)
Mutual labels:  swift-framework
React Native Boilerplate
A React Native template for building solid applications 🐙, using JavaScript 💛 or Typescript 💙 (you choose).
Stars: ✭ 2,669 (+1382.78%)
Mutual labels:  fastlane
React Avatar Editor
Small avatar & profile picture component. Resize and crop uploaded images using a intuitive user interface.
Stars: ✭ 1,846 (+925.56%)
Mutual labels:  avatar
Simplycoreaudio
A Swift framework that aims to make Core Audio use less tedious in macOS
Stars: ✭ 167 (-7.22%)
Mutual labels:  swift-framework
Android Kotlin Modulerized Cleanarchitecture
🚀 Example modularized android application with single activity written in Kotlin
Stars: ✭ 180 (+0%)
Mutual labels:  fastlane
Fastlane Plugin Changelog
Automate changes to your project CHANGELOG.md
Stars: ✭ 176 (-2.22%)
Mutual labels:  fastlane
Xcfit
Full Stack Protocol Oriented BDD in Xcode for iOS app with Swift using XCUITest, Cucumberish and FitNesse
Stars: ✭ 170 (-5.56%)
Mutual labels:  fastlane

LetterAvatarKit

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:

Requirements

  • iOS 8+
  • tvOS 9+
  • Swift 4.0+

Features

  • Ease of use
  • Flexible API
  • Builder pattern
  • Circle/Square/Bordered image
  • Flat UI colors
  • tvOS support

Installation

CocoaPods

LetterAvatarKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LetterAvatarKit", "1.2.3" # Swift 5.0+
pod "LetterAvatarKit", "1.1.7" # Swift 4.2
pod "LetterAvatarKit", "1.1.5" # Swift 4.0

Carthage

Add this to Cartfile

github "vpeschenkov/LetterAvatarKit" == 1.2.3 # Swift 5.0+
github "vpeschenkov/LetterAvatarKit" == 1.1.7 # Swift 4.2
github "vpeschenkov/LetterAvatarKit" == 1.1.5 # Swift 4.0
$ carthage update

Usage

Swift

Using LetterAvatarMaker:

// Square avatar image
let avatarImage = LetterAvatarMaker()
    .setUsername("Letter Avatar")
    .build()
avatarImageView.image = avatarImage

// Circle avatar image with white border
let circleAvatarImage = LetterAvatarMaker()
    .setCircle(true)
    .setUsername("Letter Avatar")
    .setBorderWidth(1.0)
    .setBackgroundColors([ .red ])
    .build()
avatarImageView.image = circleAvatarImage

Using LetterAvatarMaker with closures:

let avatarImage = LetterAvatarMaker()
    .build { c in
        c.username = "Letter Avatar"
    }
avatarImageView.image = avatarImage

let avatarImage = LetterAvatarMaker()
    .build { c in
        c.circle = true
        c.username = "Letter Avatar"
        c.borderWidth = 1.0
        c.backgroundColors = [ .red ]
    }
avatarImageView.image = avatarImage

Using LetterAvatarBuilderConfiguration:

let configuration = LetterAvatarBuilderConfiguration()
configuration.username = "Letter Avatar"
avatarImageView.image = UIImage.makeLetterAvatar(withConfiguration: configuration)

Using UIImage extension:

avatarImageView.image = UIImage.makeLetterAvatar(withUsername: "Letter Avatar")

Objective-C

Using LKLetterAvatarBuilderCongiguration:

LKLetterAvatarBuilderCongiguration *configuration = [[LKLetterAvatarBuilderCongiguration alloc] init];
configuration.username = @"Letter Avatar";
self.avatarImageView.image = [UIImage lk_makeLetterAvatarWithConfiguration:configuration];

Using UIImage extension:

self.avatarImageView.image = [UIImage lk_makeLetterAvatarWithUsername:@"Letter Avatar"];

Customization

You can configure the following properties of LetterAvatarBuilderConfiguration:

/// The username.
open var username: String?
/// The size of an avatar image.
open var size: CGSize = CGSize(width: 80, height: 80)
/// The flag that indicates of using single only one letter, otherwise,
/// as much as wil be possible to obtain. But no more than 3 letters.
open var isSingleLettered: Bool = false
/// The letters font.
open var lettersFont: UIFont = UIFont.systemFont(ofSize: 16.0)
/// The letters colors
open var lettersColor: UIColor = LKUIColorByRGB(red: 236, green: 240, blue: 241)
/// The background colors of an image.
open var backgroundColors: [UIColor] = UIColor.colors
/// The letters font attributes.
open var lettersFontAttributes: [NSAttributedString.Key: Any]?
/// Indicates whether to generate circle or square image.
open var circle: Bool = false
/// The border width of the image.
open var borderWidth: CGFloat = 0.0
/// The border color of the image.
open var borderColor: UIColor = UIColor.white
/// A Boolean flag indicating whether the avatar is opaque.
open var opaque: Bool = false

Community

Questions, comments, issues, and pull requests are welcome!

Contacts

License

Distributed under the MIT license. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].