fix: pr issue
This commit is contained in:
parent
e38ee51275
commit
a9c7bd6abd
|
|
@ -16,7 +16,7 @@ public protocol CollapsibleViewsContainer: class, TableViewHandler {
|
|||
var bottomHeaderView: UIView? { get } // tableHeaderView
|
||||
|
||||
var fixedTopOffet: CGFloat { get } // status bar + nav bar height
|
||||
var navigationBar: UINavigationBar? { get }
|
||||
var navBar: UINavigationBar? { get }
|
||||
|
||||
var tableView: UITableView { get }
|
||||
}
|
||||
|
|
@ -30,6 +30,13 @@ var fixedTopOffet: CGFloat {
|
|||
}
|
||||
```
|
||||
|
||||
UIViewController have default realization for navBar
|
||||
```swift
|
||||
public var navBar: UINavigationBar? {
|
||||
navigationController?.navigationBar
|
||||
}
|
||||
```
|
||||
|
||||
## Usage if your ViewController don't needs extend UITableViewDelegate
|
||||
```swift
|
||||
let headerTransitionDelegate = HeaderTransitionDelegate(headerViewHandler: self)
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ open class HeaderTransitionDelegate: NSObject, UIScrollViewDelegate {
|
|||
|
||||
private var titleView: UIView? {
|
||||
get {
|
||||
headerViewHandler?.navigationBar?.topItem?.titleView
|
||||
headerViewHandler?.navBar?.topItem?.titleView
|
||||
}
|
||||
set {
|
||||
headerViewHandler?.navigationBar?.topItem?.titleView = newValue
|
||||
headerViewHandler?.navBar?.topItem?.titleView = newValue
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ open class HeaderTransitionDelegate: NSObject, UIScrollViewDelegate {
|
|||
}
|
||||
|
||||
private func animate(headerAnimation: HeaderAnimationType, alpha: CGFloat) {
|
||||
|
||||
debugPrint("titleView = ", headerViewHandler?.navBar)
|
||||
switch headerAnimation {
|
||||
case .paralaxWithTransition:
|
||||
titleView?.transition(to: alpha)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
import UIKit
|
||||
|
||||
public protocol NavigationBarHandler {
|
||||
var navBar: UINavigationBar? { get }
|
||||
}
|
||||
|
||||
extension UIViewController: NavigationBarHandler {
|
||||
public var navBar: UINavigationBar? {
|
||||
navigationController?.navigationBar
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
import UIKit
|
||||
|
||||
public protocol CollapsibleViewsContainer: class, TableViewHandler {
|
||||
public protocol CollapsibleViewsContainer: class,
|
||||
TableViewHandler,
|
||||
NavigationBarHandler {
|
||||
|
||||
var topHeaderView: UIView? { get } // titleView
|
||||
var bottomHeaderView: UIView? { get } // tableHeaderView
|
||||
|
||||
var fixedTopOffet: CGFloat { get } // status bar + nav bar height
|
||||
var navigationBar: UINavigationBar? { get }
|
||||
}
|
||||
|
||||
public extension UIViewController {
|
||||
|
|
|
|||
Loading…
Reference in New Issue