IBInspectable attributes accessible from the identity inspector.
- Roundness
- Border width
- Border color
- Background color
You can see the changes directly on the storyboard!
Cocoapods:
- pod 'SwiftyAvatar', '~> 1.1'
Manual:
- drag 'n drop SwiftyAvatar.swift into your project.
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: .orange,
background: .black)
avatar.image = UIImage(named: "yourImage")
- Feel free to contact me with ideas or suggestions at kalaitzidis34@gmail.com
- Fork the project and make your own changes