Latest 0.3.0
Homepage https://github.com/gkye/ContactImageView
License MIT
Platforms ios 8.0
Authors

codebeat badge

ContactImageView


UIImageView subclass which generates text as the placeholder for an ImageView, supports IBDesignable and code.

Installation

CocoaPods

pod 'ContactImageView'

Manual

Drag ContactImageView.swift file to your project

Usage

Storyboard / IBDesignable

IBDesignable screenshot

Programmatic / Code

Option 1

let imageView = ContactImageView(frame: CGRect(x:10, y: 50, width: 100, height: 100))
imageView.setImageText(text: "George Kye", backgroundImage: UIImage(named: "bg"), username: true, textColor: UIColor.whiteColor(), fillColor: UIColor.blackColor(), circle: true) //backgroundImage is optional

Option 2

    let imageView2 = ContactImageView(frame: CGRect(x:130, y: 50, width: 100, height: 100))
    imageView2.text = "Joe Swanson" //Default = "GK"
    imageView2.username = true //Default = false (Returns initials of username if true)
    imageView2.textColor = UIColor.purpleColor() //Default = UIColor.whiteColor()
    imageView2.circle = false //Default = true
    imageView2.textFont = UIFont.italicSystemFontOfSize(30) //Default = UIFont.systemFontOfSize(22)
    imageView2.fontSize = 11 //Default = 22
    imageView2.fillColor = UIColor.greenColor() //Default = UIColor.lightGrayColor

Author

George Kye

License

ContactImageView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ContactImageView",
    "version": "0.3.0",
    "summary": "UIImageView subclass which generates text as the placeholder for an ImageView,",
    "description": "UIImageView subclass which generates text as the placeholder for an ImageView, supports IBDesignable and code.",
    "homepage": "https://github.com/gkye/ContactImageView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "=": "[email protected]"
    },
    "source": {
        "git": "https://github.com/gkye/ContactImageView.git",
        "tag": "0.3.0"
    },
    "social_media_url": "https://twitter.com/kyegeorge",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ContactImageView/ContactImageView.swift",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This