Files
GitHawk/Classes/Views/UIImageView+Avatar.swift
Ryan Nystrom 1daf87fc86 New ContextMenu UX for managing Issues & PRs (#1912)
* wip

* New managing UX using ContextMenu
2018-07-15 19:50:01 -04:00

25 lines
596 B
Swift

//
// UIImageView+Avatar.swift
// Freetime
//
// Created by Ryan Nystrom on 11/19/17.
// Copyright © 2017 Ryan Nystrom. All rights reserved.
//
import UIKit
extension UIImageView {
func configureForAvatar(border: Bool = true) {
contentMode = .scaleAspectFill
backgroundColor = Styles.Colors.Gray.lighter.color
layer.cornerRadius = Styles.Sizes.avatarCornerRadius
if border {
layer.borderColor = Styles.Colors.Gray.light.color.cgColor
layer.borderWidth = 1.0 / UIScreen.main.scale
}
clipsToBounds = true
}
}