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.
		
		
		
		
		
			
		
			
	
	
		
			25 lines
		
	
	
		
			597 B
		
	
	
	
		
			Swift
		
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			597 B
		
	
	
	
		
			Swift
		
	
| 
											8 years ago
										 | // | ||
|  | //  Copyright (c) 2018 Open Whisper Systems. All rights reserved. | ||
|  | // | ||
|  | 
 | ||
|  | public class GradientView: UIView { | ||
|  | 
 | ||
|  |     let gradientLayer = CAGradientLayer() | ||
|  | 
 | ||
|  |     public required init(from fromColor: UIColor, to toColor: UIColor) { | ||
|  |         gradientLayer.colors = [fromColor.cgColor, toColor.cgColor] | ||
|  |         super.init(frame: CGRect.zero) | ||
|  | 
 | ||
|  |         self.layer.addSublayer(gradientLayer) | ||
|  |     } | ||
|  | 
 | ||
|  |     public required init?(coder aDecoder: NSCoder) { | ||
| 
											7 years ago
										 |         notImplemented() | ||
| 
											8 years ago
										 |     } | ||
|  | 
 | ||
|  |     public override func layoutSubviews() { | ||
|  |         super.layoutSubviews() | ||
|  |         gradientLayer.frame = self.bounds | ||
|  |     } | ||
|  | } |