mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			43 lines
		
	
	
		
			1023 B
		
	
	
	
		
			Swift
		
	
		
		
			
		
	
	
			43 lines
		
	
	
		
			1023 B
		
	
	
	
		
			Swift
		
	
| 
											9 years ago
										 | // | ||
|  | //  Copyright (c) 2017 Open Whisper Systems. All rights reserved. | ||
|  | // | ||
| 
											9 years ago
										 | 
 | ||
|  | import UIKit | ||
|  | 
 | ||
| 
											8 years ago
										 | @objc | ||
|  | public class AvatarImageView: UIImageView { | ||
| 
											9 years ago
										 | 
 | ||
| 
											8 years ago
										 |     public init() { | ||
| 
											9 years ago
										 |         super.init(frame: CGRect.zero) | ||
|  |         self.configureView() | ||
|  |     } | ||
|  | 
 | ||
|  |     override init(frame: CGRect) { | ||
|  |         super.init(frame: frame) | ||
|  |         self.configureView() | ||
|  |     } | ||
|  | 
 | ||
| 
											8 years ago
										 |     required public init?(coder aDecoder: NSCoder) { | ||
| 
											9 years ago
										 |         super.init(coder: aDecoder) | ||
|  |         self.configureView() | ||
|  |     } | ||
|  | 
 | ||
|  |     override init(image: UIImage?) { | ||
|  |         super.init(image: image) | ||
|  |         self.configureView() | ||
|  |     } | ||
|  | 
 | ||
|  |     func configureView() { | ||
|  |         self.layer.minificationFilter = kCAFilterTrilinear | ||
|  |         self.layer.magnificationFilter = kCAFilterTrilinear | ||
|  |         self.layer.borderWidth = 0.5 | ||
| 
											9 years ago
										 |         self.layer.masksToBounds = true | ||
| 
											9 years ago
										 |         self.contentMode = .scaleToFill | ||
| 
											9 years ago
										 |     } | ||
|  | 
 | ||
| 
											8 years ago
										 |     override public func layoutSubviews() { | ||
| 
											9 years ago
										 |         self.layer.borderColor = UIColor.black.cgColor.copy(alpha: 0.15) | ||
|  |         self.layer.cornerRadius = self.frame.size.width / 2 | ||
|  |     } | ||
| 
											9 years ago
										 | } |