Latest 1.2.0
Homepage https://github.com/AntonPoltoratskyi/UserAvatarView
License MIT
Platforms ios 10.0
Frameworks UIKit

Swift
Xcode
MIT
CocoaPods Compatible

UserAvatarView is a UIView container subclass that wraps:

  • UIImageView
  • status view with customizable: appearance, angle, radius

Demo

Requirements:

  • iOS 10.0+
  • Xcode 10.0+
  • Swift 4.2+

Installation

CocoaPods

target 'MyApp' do
  pod 'UserAvatarView', '~> 1.2'
end

Carthage

github "AntonPoltoratskyi/UserAvatarView" "master"

Usage

1) Declare UserAvatarView either in storyboard:

@IBOutlet weak var avatarView: UserAvatarView!

or programmatically.

2) Setup appropriate properties:

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:

avatarView.imageView.image = avatarImage

Author

Anton Poltoratskyi

License

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

Latest podspec

{
    "name": "UserAvatarView",
    "version": "1.2.0",
    "summary": "UserAvatarView is a UIView subclass that has customizable status view",
    "description": "UserAvatarView is a UIView subclass that has status view with customizable appearance, angle, radius",
    "homepage": "https://github.com/AntonPoltoratskyi/UserAvatarView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Anton Poltoratskyi",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/AntonPoltoratskyi/UserAvatarView.git",
        "tag": "1.2.0"
    },
    "source_files": "UserAvatarView/*.{swift}",
    "frameworks": "UIKit",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This