Latest 1.1.2
Homepage https://github.com/kamwysoc/ContactCircularView
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

Version
License
Platform
Build

Why to use

If you want to add some custom ContactsBook screen or you just need come circular view with some text or image inside, this pod is suitable for your app.

Demo

Example app

ContactCircularView

Contact screen

ContactCircularView

Examples

To run the example project, clone the repo, and run pod install from the Example directory first.

Create, apply initials from name, set font and border

ContactCircularView

let contactInitialsView = ContactCircularView()
contactInitialsView.backgroundColor = UIColor.redColor()
contactInitialsView.applyBorderWithColor(.greenColor(), andWidth: 1.0)
contactInitialsView.applyTextFont(.italicSystemFontOfSize(12), andColor: .greenColor())
contactInitialsView.applyInitialsFromName("John Doe")

Create, apply image

ContactCircularView

let contactInitialsView = ContactCircularView()
contactInitialsView.applyImage(UIImage(imageLiteral: "some_cool_image"))

Create your custom TextFormatter, and initialize ContactCircularView with it

ContactCircularView

class FirstLetterFormatter: FormattedTextCreator {

    func formattedTextFromString(string: String) -> String {
        guard let firstLetter = string.characters.first else {
            return ""
        }
        return String(firstLetter)
    }

}
let contactInitialsView = ContactCircularView(textCreator: FirstLetterFormatter())
contactInitialsView.backgroundColor = UIColor.redColor()
contactInitialsView.applyTextColor(UIColor.whiteColor())
contactInitialsView.applyFormattedTextFromString("John Doe")

Create an circularView and make the UIImage from it

let contactInitialsView = ContactCircularView(textCreator: FirstLetterFormatter())
contactInitialsView.frame = CGRectMake(0,0,30,30)
contactInitialsView.backgroundColor = UIColor.redColor()
contactInitialsView.applyTextColor(UIColor.whiteColor())
contactInitialsView.applyFormattedTextFromString("John Doe")

let image = contactInitialsView.toImage()

Requirements

version 1.1.0+ Swift 3.0, Xcode 8

version 1.0.2 Swift 2.2, Xcode 7

Installation

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

pod "ContactCircularView"

Author

Homepage

Twitter

License

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

Latest podspec

{
    "name": "ContactCircularView",
    "version": "1.1.2",
    "summary": "Contact circular view than allows you to represent your friends by initials or image.",
    "description": "View that allows you to represent people initials (like in Contact book) also it allows you tonput some image instead using initials.nnMain inspiration was Contact circular views in iOS Contacts",
    "homepage": "https://github.com/kamwysoc/ContactCircularView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kamil Wysocki": "https://www.wysockikamil.com"
    },
    "source": {
        "git": "https://github.com/kamwysoc/ContactCircularView.git",
        "tag": "1.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ContactCircularView/Classes/**/*",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This