All Projects → bachonk → Uiimageview Letters

bachonk / Uiimageview Letters

Licence: mit
UIImageView category for using initials as a placeholder image, written in Objective-C. For a Swift implementation, see https://github.com/bachonk/InitialsImageView

Projects that are alternatives of or similar to Uiimageview Letters

Aaviewanimator
AAViewAnimator is a set of animations designed for UIView, UIButton, UIImageView with options in iOS, written in Swift.
Stars: ✭ 33 (-95.24%)
Mutual labels:  cocoapods, uiimageview
Cminputview
💪之前代码是基于UITextView进行的封装,侵入性较强,不方便使用,现使用Category重构代码,支持Cocoapods
Stars: ✭ 149 (-78.53%)
Mutual labels:  cocoapods, placeholder
Mbprogresshud Bwmextension
Nihility-Ming to MBProgressHUD extension, easy to use.
Stars: ✭ 35 (-94.96%)
Mutual labels:  cocoapods, category
Yjcategories
Objective-C 常用分类集合,支持Cocoapods
Stars: ✭ 89 (-87.18%)
Mutual labels:  cocoapods, category
Faceaware
An extension that gives UIImageView the ability to focus on faces within an image.
Stars: ✭ 3,004 (+332.85%)
Mutual labels:  cocoapods, uiimageview
Ios Category
iOS 工具分类整理
Stars: ✭ 30 (-95.68%)
Mutual labels:  cocoapods, category
Zoomy
Adds seamless scrollView and instagram like zooming to UIImageViews in any view hierarchy.
Stars: ✭ 130 (-81.27%)
Mutual labels:  cocoapods, uiimageview
React Native Dropdown Picker
A single / multiple, categorizable & searchable item picker (dropdown) component for react native which supports both Android & iOS.
Stars: ✭ 230 (-66.86%)
Mutual labels:  category, placeholder
Skeletonui
☠️ Elegant skeleton loading animation in SwiftUI and Combine
Stars: ✭ 275 (-60.37%)
Mutual labels:  cocoapods, placeholder
Rhplaceholder
Show pleasant loading view for your users 😍
Stars: ✭ 238 (-65.71%)
Mutual labels:  cocoapods, placeholder
Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (-76.37%)
Mutual labels:  cocoapods, uiimageview
Maplebacon
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations
Stars: ✭ 322 (-53.6%)
Mutual labels:  cocoapods, uiimageview
Imageloaderswift
A lightweight and fast image loader for iOS written in Swift.
Stars: ✭ 290 (-58.21%)
Mutual labels:  cocoapods, uiimageview
Listplaceholder
ListPlaceholder is a swift library allows you to easily add facebook style animated loading placeholder to your tableviews or collection views.
Stars: ✭ 511 (-26.37%)
Mutual labels:  cocoapods, placeholder
Kydrawercontroller
Side Drawer Navigation Controller similar to Android
Stars: ✭ 632 (-8.93%)
Mutual labels:  cocoapods
Interactivesidemenu
iOS Interactive Side Menu written in Swift.
Stars: ✭ 668 (-3.75%)
Mutual labels:  cocoapods
Pdfgenerator
A simple generator of PDF written in Swift.
Stars: ✭ 629 (-9.37%)
Mutual labels:  cocoapods
Lthpasscodeviewcontroller
iOS 7 style Passcode Lock
Stars: ✭ 629 (-9.37%)
Mutual labels:  cocoapods
Growingtextview
An UITextView in Swift. Support auto growing, placeholder and length limit.
Stars: ✭ 683 (-1.59%)
Mutual labels:  placeholder
Forceblur
ForceBlur Animation for iOS Messaging Apps
Stars: ✭ 666 (-4.03%)
Mutual labels:  cocoapods

UIImageView+Letters

An easy, helpful UIImageView category that generates letter initials as a placeholder for user profile images, with a randomized background color

Note: Looking for a Swift 3 compatible version? Check out the new InitialsImageView extension, rewritten entirely in Swift!

Example screenshot

Installation

CocoaPods

Add this spec to your podfile:

pod "UIImageView-Letters"

Check out the official guide for getting started with CocoaPods.

Manual
  1. Drag the UIImageView+Letters.{h,m} files into your project
  2. Enjoy!

Usage

In the file where you want to use the category, be sure to import the file.

#import "UIImageView+Letters.h"

Methods

Call the following methods on any UIImageView instance to set the image:

  • - (void)setImageWithString:(NSString *)string
  • - (void)setImageWithString:(NSString *)string color:(UIColor *)color
  • - (void)setImageWithString:(NSString *)string color:(UIColor *)color circular:(BOOL)isCircular
  • - (void)setImageWithString:(NSString *)string color:(UIColor *)color circular:(BOOL)isCircular fontName:(NSString *)fontName
  • - (void)setImageWithString:(NSString *)string color:(UIColor *)color circular:(BOOL)isCircular textAttributes:(NSDictionary *)textAttributes

string is the string used to generate the initials. This should be a user's full name if available.

color is an optional parameter that sets the background color of the image. Pass in nil to have a color automatically generated for you.

isCircular is a boolean parameter that will automatically clip the image to a circle if enabled.

fontName is a string that specifies a custom font. Pass in nil to use the system font by default. The list of provided font identifiers can be found here.

textAttributes is an NSDictionary that allows you to specify font, text color, shadow properties, etc., for the letters text, using the keys found in NSAttributedString.h.

Example
NSString *userName = @"Michael Bluth";
UIImageView *myImgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 50, 50)];
[myImgView setImageWithString:userName color:nil circular:YES];

Saying Thanks

If you like this tool, show your support by downloading the free Turnout app that inspired it!

License

Using the MIT license. See license file for details.

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].