mirror of
https://github.com/fxm90/GradientLoadingBar.git
synced 2026-04-17 12:17:30 +00:00
44 lines
1.1 KiB
Swift
44 lines
1.1 KiB
Swift
//
|
|
// SafeAreaExampleViewController.swift
|
|
// GradientLoadingBar_Example
|
|
//
|
|
// Created by Felix Mau on 08/30/18.
|
|
// Copyright © 2018 Felix Mau. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import GradientLoadingBar
|
|
|
|
class SafeAreaExampleViewController: UIViewController {
|
|
// MARK: - Private properties
|
|
|
|
private let gradientLoadingBar = GradientLoadingBar(isRelativeToSafeArea: false)
|
|
|
|
private let notchGradientLoadingBar = NotchGradientLoadingBar(isRelativeToSafeArea: false)
|
|
|
|
// MARK: - Public methods
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
super.viewWillDisappear(animated)
|
|
|
|
gradientLoadingBar.fadeOut()
|
|
notchGradientLoadingBar.fadeOut()
|
|
}
|
|
|
|
@IBAction func showBasicBarButtonTouchUpInside(_: Any) {
|
|
gradientLoadingBar.fadeIn()
|
|
}
|
|
|
|
@IBAction func hideBasicBarButtonTouchUpInside(_: Any) {
|
|
gradientLoadingBar.fadeOut()
|
|
}
|
|
|
|
@IBAction func showNotchBarButtonTouchUpInside(_: Any) {
|
|
notchGradientLoadingBar.fadeIn()
|
|
}
|
|
|
|
@IBAction func hideNotchBarButtonTouchUpInside(_: Any) {
|
|
notchGradientLoadingBar.fadeOut()
|
|
}
|
|
}
|