SpinnerViewController.swift 1.04 KB
//
//  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.
    }
 
}