Latest 1.1.2
Homepage https://github.com/dkalaitzidis/SwiftyAvatar
License Apache 2.0
Platforms ios 9.0
Authors

3.0
Apache
CocoaPods Compatible

iOS Swift 3.0 UIimage class
Create awesome circular avatar images!

enter image description here


IBInspectable attributes accessible from the identity inspector.

  • Roundness
  • Border width
  • Border color
  • Background color

You can see the changes directly on the storyboard!


Installation

Cocoapods:

  • pod ‘SwiftyAvatar’, ‘~> 1.1’

Manual:

  • drag ‘n drop SwiftyAvatar.swift into your project.

How to use

Storyboard:

  • Select the image you want to use as avatar and change the class to SwiftyAvatar.

Code:

  • With default initializer
    let avatar = SwiftyAvatar()
    avatar.image = UIImage(named:"yourImage")
  • With your values
    let avatar = SwiftyAvatar(size: 50, roundess: 2, borderWidth: 1, borderColor: UIColor.orange, background: UIColor.black)
    avatar.image = UIImage(named: "yourImage")

Contact & Contribute

  • Feel free to contact me with ideas or suggestions at [email protected]
  • Fork the project and make your own changes

Latest podspec

{
    "name": "SwiftyAvatar",
    "version": "1.1.2",
    "summary": "A UIImageView class for creating circular or rounded avatar images, IBDesignable to make all changes via storyboard",
    "description": "> A `UIImageView` class for creating **circular or rounded avatar images**, IBDesignable to make all changes via storyboardnn[![2.0](https://img.shields.io/badge/Swift-2.0-orange.svg)](https://developer.apple.com/swift/)n[![Build Status][travis-image]][travis-url]n[![Apache](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)n[![CocoaPods Compatible](https://img.shields.io/badge/Pod-1.0-blue.svg)](https://img.shields.io/badge/Pod-1.0-blue.svg)nnSwiftyAvatar let's you create easily rounded or circular avatar images.nnSimply change the UIImageView with SwiftyAvatar class and adjust the available properties.nnYou can see the changes in storyboard because SwiftyAvatar is @IBDesignable!nn![Alt text](http://kalai.gr/wp-content/uploads/2016/08/SwiftyAvatar-After-169x300.png)nn## Featuresnn- [x] @IBDesignablen- [x] Border Width & Colorn- [x] Background Color (if the image has trasparent background)n- [x] Spin animationnn## Requirementsnn- iOS 8.0+n- Xcode 7.3nn## Installationnn#### CocoaPodsnYou can use [CocoaPods](http://cocoapods.org/) to install `SwiftyAvatar` by adding it to your `Podfile`:nn```rubynplatform :ios, '8.0'nuse_frameworks!npod 'SwiftyAvatar', '~> 1.0'n```nn``` swiftnimport UIKitnimport SwiftyAvatarn```n#### Manuallyn1. Download and drop ```SwiftyAvatar.swift``` in your project.n2. Congratulations!nn## Usage examplennFrom storyboard, just change the class of your 'UIImageView' to 'SwiftyAvatar' and adjust the available properties.nnWith code:nn```swiftnlet avatar = SwiftyAvatar()navatar.image = UIImage(named:"yourImage")nnornnlet avatar = SwiftyAvatar(size: 50,n                          roundess: 2,n                          borderWidth: 1,n                          borderColor: UIColor.orange,n                          background: UIColor.black)n            avatar.image = UIImage(named: "yourImage")n```nn## Release Historyn* 1.1.2n    * usage from code with SwiftyAvatar() initializern* 1.1n    * swift-3 supportn* 1.0n    * First releasenn## ContributennWe would love for you to contribute to **SwiftyAvatar**, check the ``LICENSE`` file for more info.nnThanks to RishabhTayal (https://github.com/RishabhTayal) for readme spelling corrections, example and Pod supportnn## MetannDimitrios Kalaitzidis u2013 [@kalaitzidis34](https://twitter.com/kalaitzidis34) u2013 [email protected] under the Apache license. See ``Apache License`` for more information.nn[https://github.com/dkalaitzidis/SwiftyAvatar](https://github.com/dkalaitzidis/)nn[swift-image]:https://img.shields.io/badge/swift-3.0-orange.svgn[swift-url]: https://swift.org/n[license-image]: https://img.shields.io/badge/License-MIT-blue.svgn[license-url]: http://www.apache.org/licenses/LICENSE-2.0n[travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-squaren[travis-url]: https://travis-ci.org/dbader/node-datadog-metricsn[codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dadn[codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com",
    "homepage": "https://github.com/dkalaitzidis/SwiftyAvatar",
    "screenshots": "https://camo.githubusercontent.com/4313905c83d952cfad856b3d7135d84971df7f44/687474703a2f2f692e696d6775722e636f6d2f625a464d47476a2e706e67",
    "license": {
        "type": "Apache 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Dimitrios Kalaitzidis": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dkalaitzidis/SwiftyAvatar.git",
        "tag": "1.1.2"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "SwiftyAvatar/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This