Kurdtvs-Live-Kurdish-TV-Kur.../Mastodon/Scene/Onboarding/Share/OnboardingNavigationControl...

52 lines
1.4 KiB
Swift
Raw Normal View History

//
// OnboardingNavigationController.swift
// Mastodon
//
// Created by MainasuK on 2021-12-31.
//
import UIKit
final class OnboardingNavigationController: AdaptiveStatusBarStyleNavigationController {
private(set) lazy var gradientBorderView = GradientBorderView(frame: view.bounds)
}
extension OnboardingNavigationController {
override func viewDidLoad() {
super.viewDidLoad()
gradientBorderView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(gradientBorderView)
NSLayoutConstraint.activate([
gradientBorderView.topAnchor.constraint(equalTo: view.topAnchor),
gradientBorderView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
gradientBorderView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
gradientBorderView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
])
updateBorderViewDisplay()
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
}
2022-01-04 11:30:21 +01:00
}
extension OnboardingNavigationController {
private func updateBorderViewDisplay() {
switch traitCollection.userInterfaceIdiom {
case .phone:
gradientBorderView.isHidden = true
default:
gradientBorderView.isHidden = false
}
}
2022-01-04 11:30:21 +01:00
}