Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

devpolant/UserAvatarView

Repository files navigation

Swift Xcode MIT CocoaPods Compatible

UserAvatarView

UserAvatarView is a UIView container subclass that wraps:

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

Demo

Requirements:

  • iOS 10.0+
  • Xcode 12.0+
  • Swift 5.0+

Installation

CocoaPods

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

Carthage

github "devpolant/UserAvatarView" "master"

Usage

  1. Declare UserAvatarView either in storyboard:
@IBOutlet weak var avatarView: UserAvatarView!

or programmatically.

  1. 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
  1. 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.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /