Lib automatically creates labels with circular backgrounds(Like in contacts app in Android).
Library is written in swift
iOS Version >= 8.0
It is highly customizable. It has text based color generator(Same text will always be same color) It has full Storyboard integration.
CircleLabel is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CircleLabel'
Dowload files from lib folder and copy them into your project.
CircleLabel extends UIImageView. It has full Storyboard support you will see how it looks directly in Interface Builder.
import CircleLabel
Drag UIView to your view and set class to CircleLabel.
You can set parameters directly from Storyboard or Manually from code.
var circle:CircleLabel
//Set text within circle
circle.text = "From Code"
//This text will be used to generate circle color
circle.colorFromText = "GUARAM"
//Use custom color scheme
circle.COLOR_SCHEME = [ 0xffe57373, 0xfff06292 ...]
//Generate color based on text or user defined parameter
circle.useTextColor = true;
//If useTextColor == false - this value will be used for circle color
circle.circleColor = UIColor.blue
//Change text color
circle.textColor = UIColor.white
//Padding of inner text
circle.padding = 0.3
//Amount of lines
circle!.amountLines = 1
Gio Andriadze, [email protected]
CircleLabel is available under the MIT license. See the LICENSE file for more info.