Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import UIKit
import Shared
final class LaunchView: UIView {
private var imageView = UIImageView()
init() {
super.init(frame: .zero)
imageView.image = Asset.splash.image
imageView.contentMode = .scaleAspectFit
backgroundColor = Asset.neutralWhite.color
addSubview(imageView)
imageView.snp.makeConstraints {
$0.center.equalToSuperview()
$0.left.equalToSuperview().offset(100)
}
}
required init?(coder: NSCoder) { nil }
func setupGradient() {
let gradient = CAGradientLayer()
gradient.colors = [
UIColor(red: 122/255, green: 235/255, blue: 239/255, alpha: 1).cgColor,
UIColor(red: 56/255, green: 204/255, blue: 232/255, alpha: 1).cgColor,
UIColor(red: 63/255, green: 186/255, blue: 253/255, alpha: 1).cgColor,
UIColor(red: 98/255, green: 163/255, blue: 255/255, alpha: 1).cgColor
]
gradient.frame = bounds
gradient.startPoint = CGPoint(x: 1, y: 0)
gradient.endPoint = CGPoint(x: 0, y: 1)
layer.insertSublayer(gradient, at: 0)
}
}