SpinnerViewController.swift
1.04 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
//
// SpinnerViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 14/11/22.
//
import UIKit
@objc public class SpinnerViewController: UIViewController {
var spinner = UIActivityIndicatorView()
public override func loadView() {
if #available(iOS 13.0, *) {
spinner = UIActivityIndicatorView(style: .large)
spinner.color = .white
} else {
spinner = UIActivityIndicatorView(style: .whiteLarge)
}
view = UIView()
view.backgroundColor = UIColor(white: 0, alpha: 0.7)
spinner.translatesAutoresizingMaskIntoConstraints = false
spinner.startAnimating()
view.addSubview(spinner)
spinner.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
spinner.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
}
public override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}