mirror of
https://github.com/fxm90/GradientLoadingBar.git
synced 2026-06-16 12:24:31 +00:00
43 lines
936 B
Swift
43 lines
936 B
Swift
//
|
|
// BasicExampleViewController.swift
|
|
// Example
|
|
//
|
|
// Created by Felix Mau on 07.03.22.
|
|
// Copyright © 2022 Felix Mau. All rights reserved.
|
|
//
|
|
|
|
import GradientLoadingBar
|
|
import SwiftUI
|
|
import UIKit
|
|
|
|
final class BasicExampleViewController: UIViewController {
|
|
|
|
// MARK: - Public methods
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
super.viewWillDisappear(animated)
|
|
|
|
// Reset any possible visible loading bar.
|
|
GradientLoadingBar.shared.fadeOut()
|
|
}
|
|
|
|
// MARK: - Private methods
|
|
|
|
@IBAction private func showButtonTouchUpInside(_: Any) {
|
|
GradientLoadingBar.shared.fadeIn()
|
|
}
|
|
|
|
@IBAction private func hideButtonTouchUpInside(_: Any) {
|
|
GradientLoadingBar.shared.fadeOut()
|
|
}
|
|
}
|
|
|
|
// MARK: - Helper
|
|
|
|
struct BasicExampleView: View {
|
|
var body: some View {
|
|
StoryboardView(name: "BasicExample")
|
|
.navigationTitle("🏡 Basic Example")
|
|
}
|
|
}
|