diff --git a/TIUIElements/Sources/Helpers/Protocols/NavigationBarДalculated.swift b/TIUIElements/Sources/Helpers/Protocols/CollapsibleViewsContainer.swift similarity index 85% rename from TIUIElements/Sources/Helpers/Protocols/NavigationBarДalculated.swift rename to TIUIElements/Sources/Helpers/Protocols/CollapsibleViewsContainer.swift index 139dacbf..210b80af 100644 --- a/TIUIElements/Sources/Helpers/Protocols/NavigationBarДalculated.swift +++ b/TIUIElements/Sources/Helpers/Protocols/CollapsibleViewsContainer.swift @@ -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 diff --git a/TIUIElements/Sources/Helpers/Protocols/TableViewHandler.swift b/TIUIElements/Sources/Helpers/Protocols/TableViewHandler.swift index 23bf9618..0d9466f1 100644 --- a/TIUIElements/Sources/Helpers/Protocols/TableViewHandler.swift +++ b/TIUIElements/Sources/Helpers/Protocols/TableViewHandler.swift @@ -4,7 +4,7 @@ public protocol TableViewHandler { var tableView: UITableView { get } } -extension TableViewHandler { +public extension TableViewHandler { var startOffset: CGPoint { tableView.contentOffset } diff --git a/TIUIElements/Sources/Helpers/Protocols/UIView+Animate.swift b/TIUIElements/Sources/Helpers/Protocols/UIView+Animate.swift index be730851..d34a20a4 100644 --- a/TIUIElements/Sources/Helpers/Protocols/UIView+Animate.swift +++ b/TIUIElements/Sources/Helpers/Protocols/UIView+Animate.swift @@ -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