mirror of
https://github.com/samsonjs/UIKitCatalog.git
synced 2026-03-25 08:55:51 +00:00
45 lines
1.3 KiB
Swift
45 lines
1.3 KiB
Swift
/*
|
||
See LICENSE folder for this sample’s licensing information.
|
||
|
||
Abstract:
|
||
A view controller that demonstrates how to use `UIActivityIndicatorView`.
|
||
*/
|
||
|
||
import UIKit
|
||
|
||
class ActivityIndicatorViewController: UITableViewController {
|
||
// MARK: - Properties
|
||
|
||
@IBOutlet weak var grayStyleActivityIndicatorView: UIActivityIndicatorView!
|
||
|
||
@IBOutlet weak var tintedActivityIndicatorView: UIActivityIndicatorView!
|
||
|
||
// MARK: - View Life Cycle
|
||
|
||
override func viewDidLoad() {
|
||
super.viewDidLoad()
|
||
|
||
configureGrayActivityIndicatorView()
|
||
configureTintedActivityIndicatorView()
|
||
|
||
// When the activity is done, be sure to use UIActivityIndicatorView.stopAnimating().
|
||
}
|
||
|
||
// MARK: - Configuration
|
||
|
||
func configureGrayActivityIndicatorView() {
|
||
grayStyleActivityIndicatorView.activityIndicatorViewStyle = .gray
|
||
|
||
grayStyleActivityIndicatorView.startAnimating()
|
||
|
||
grayStyleActivityIndicatorView.hidesWhenStopped = true
|
||
}
|
||
|
||
func configureTintedActivityIndicatorView() {
|
||
tintedActivityIndicatorView.activityIndicatorViewStyle = .gray
|
||
|
||
tintedActivityIndicatorView.color = UIColor(named: "Tint_Purple_Color")
|
||
|
||
tintedActivityIndicatorView.startAnimating()
|
||
}
|
||
}
|