fix: pr issue
This commit is contained in:
parent
effad1e51c
commit
1b58ff5aaa
|
|
@ -1,30 +1,30 @@
|
|||
import UIKit
|
||||
|
||||
public protocol CollapsibleViewsContainer: class,
|
||||
TableViewHandler,
|
||||
NavigationBarHandler {
|
||||
|
||||
TableViewHandler,
|
||||
NavigationBarHandler {
|
||||
var topHeaderView: UIView? { get } // titleView
|
||||
var bottomHeaderView: UIView? { get } // tableHeaderView
|
||||
|
||||
var fixedTopOffet: CGFloat { get } // status bar + nav bar height
|
||||
}
|
||||
|
||||
public extension UIViewController {
|
||||
|
||||
|
||||
var defaultTopOffet: CGFloat { // status bar + nav bar height calculate for UIViewController
|
||||
let navigationBar = navigationController?.navigationBar
|
||||
let window = view.window
|
||||
let prefersLargeTitles = navigationBar?.prefersLargeTitles ?? false
|
||||
|
||||
|
||||
let statusBarHeight: CGFloat
|
||||
if #available(iOS 13.0, *) {
|
||||
statusBarHeight = window?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0
|
||||
} else {
|
||||
statusBarHeight = UIApplication.shared.statusBarFrame.height
|
||||
}
|
||||
|
||||
|
||||
let navigationBarHeight = navigationBar?.bounds.height ?? 0
|
||||
|
||||
|
||||
return prefersLargeTitles
|
||||
? navigationBarHeight - statusBarHeight
|
||||
: 0
|
||||
|
|
@ -4,7 +4,7 @@ public protocol TableViewHandler {
|
|||
var tableView: UITableView { get }
|
||||
}
|
||||
|
||||
extension TableViewHandler {
|
||||
public extension TableViewHandler {
|
||||
var startOffset: CGPoint {
|
||||
tableView.contentOffset
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ extension UIView {
|
|||
self?.transform = CGAffineTransform(translationX: 0, y: -alpha*10)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public func scale(alpha: CGFloat) {
|
||||
UIView.animate(withDuration: 0.2){ [weak self] in
|
||||
self?.alpha = alpha
|
||||
|
|
|
|||
Loading…
Reference in New Issue