ProgressHelperView.swift
1.13 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// ProgressHelperView.swift
// Pro-Seecurity-VPN
//
// Created by user247686 on 12/11/23.
//
import Foundation
import UIKit
class ProgressHelperView: UIView {
var activityIndicator: ActivityIndicator = {
let obj = ActivityIndicator()
obj.tintColor = .white
obj.translatesAutoresizingMaskIntoConstraints = false
return obj
}()
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
private func setup() {
backgroundColor = UIColor.black.withAlphaComponent(0.4)
addSubview(activityIndicator)
activityIndicator.snp.makeConstraints { (make) in
make.size.equalTo(64.sizeW)
make.center.equalToSuperview()
}
}
override func didMoveToSuperview() {
super.didMoveToSuperview()
activityIndicator.startAnimating()
}
override func removeFromSuperview() {
super.removeFromSuperview()
activityIndicator.stopAnimating()
}
}