https://github.com/devpolant/useravatarview
https://github.com/devpolant/useravatarview
avatar ios swift swift-4 uikit user-status
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/devpolant/useravatarview
- Owner: devpolant
- License: mit
- Created: 2018-10-25T07:42:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-09T09:39:17.000Z (almost 5 years ago)
- Last Synced: 2025-05-05T14:55:19.219Z (10 months ago)
- Topics: avatar, ios, swift, swift-4, uikit, user-status
- Language: Swift
- Size: 981 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://swift.org)
[](https://developer.apple.com/xcode)
[](https://opensource.org/licenses/MIT)
[](https://cocoapods.org/pods/UserAvatarView)
# UserAvatarView
UserAvatarView is a UIView container subclass that wraps:
- UIImageView
- status view with customizable: appearance, angle, radius

## Requirements:
- iOS 10.0+
- Xcode 12.0+
- Swift 5.0+
## Installation
#### CocoaPods
```ruby
target 'MyApp' do
pod 'UserAvatarView', '~> 1.3'
end
```
#### Carthage
```ogdl
github "devpolant/UserAvatarView" "master"
```
## Usage
1) Declare UserAvatarView either in storyboard:
```swift
@IBOutlet weak var avatarView: UserAvatarView!
```
or programmatically.
2) Setup appropriate properties:
```swift
avatarView.statusAppearance = .color(.red)
// avatarView.statusAppearance = .image(UIImage(named: "..."))
// avatarView.statusAppearance = .none
avatarView.statusAngle = .pi / 4
avatarView.statusIconSize = 8
avatarView.statusIconPadding = 2
```
3) UIImageView subview is public, so you can setup avatar image on `imageView`:
```swift
avatarView.imageView.image = avatarImage
```
## Author
Anton Poltoratskyi
## License
UserAvatarView is available under the MIT license. See the [LICENSE](https://github.com/devpolant/UserAvatarView/blob/master/LICENSE) file for more info.