Skip to content

nsnull0/YWNamePlaceholder

Repository files navigation

YWNamePlaceHolder

CI Status Version License Platform

Profile Picture place Holder

Availability

⚠️ This Library only Available to Swift > 3.0 ⚠️

Screenshot

iPhone6s

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
pod 'YWNamePlaceHolder'
end

Then, run the following command:

$ pod install

Initialization

YWNamePlaceHolder is UIView descent

//initiate with default length characters based on text received
let yourProfileContainer:YWNamePlaceHolder = YWNamePlaceHolder(originLocation: <CGPoint> ,
_withSize: <CGFloat> ,
_yourPlaceholder :<String> ,
_fontPlaceHolder: <UIFont>)


//initiate with your preferred length of characters
let yourProfileContainer:YWNamePlaceHolder = YWNamePlaceHolder(originLocation: <CGPoint> ,
_withSize: <CGFloat> ,
_yourPlaceholder :<String> ,
_fontPlaceHolder: <UIFont>,
_constraintTextResultCount: <Int>)

Functionality

func setFont(UIFont)

/*
TextColor: setting the text profile color
ContentColor: setting the circle background content
*/
func setColor(TextColor<UIColor>, ContentColor<UIColor>)

/*
fontSize: setting the text size spesificly and static
*/
func setFontSize(fontSize<CGFloat>)

/*
to list font that used in the device
*/
func debugListFontDevice() -> Array<String>

/*
change text and color to corresponding placeholder which is already initialize
size param is optional
*/
func setUpdate(str<String>, color<UIColor>, contentColor<UIColor>)
func setUpdate(str<String>, color<UIColor>, contentColor<UIColor>, size<CGFloat?>)

/*
change your placeholder text with your preferred length of characters which is already initialize
*/
setUpdateTextLength(count<Int>)

see Example project for more detail in initialization

Support

  • Updated occasionally for more functionality

Credits

  • Creator Yoseph Wijaya (Swift 3.0)
  • BMInitialPlaceHoldersView (Objective-C)