Another attempt to fix empty URL bar

This commit is contained in:
James Magahern
2023-08-10 19:52:59 -07:00
parent 3f5d608908
commit a4c6caeb8e
6 changed files with 66 additions and 15 deletions

View File

@@ -0,0 +1,30 @@
//
// LayoutLatch.swift
// App
//
// Created by James Magahern on 8/10/23.
//
import Foundation
class LayoutLatch {
public weak var view: UIView?
public private(set) var latched: Bool = false
init(_ view: UIView) {
self.view = view
}
public func activate() {
latched = true
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { [weak self] in
self?.deactivate()
}
}
public func deactivate() {
latched = false
view?.setNeedsLayout()
}
}