docs: update appearance of view controller in documentation
This commit is contained in:
parent
06a83190ab
commit
b97ea5bc8f
|
|
@ -198,11 +198,8 @@ open class BaseModalViewController<ContentView: UIView,
|
|||
|
||||
dragView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
let isHeaderViewHidden = headerViewConstraints == nil
|
||||
let dragViewConstraints = SubviewConstraints(
|
||||
edgeConstraints: .init(
|
||||
topConstraint: dragView.topAnchor.constraint(equalTo: view.topAnchor),
|
||||
bottomConstraint: dragView.bottomAnchor.constraint(equalTo: isHeaderViewHidden ? contentView.topAnchor : headerView.topAnchor)),
|
||||
edgeConstraints: .init(topConstraint: dragView.topAnchor.constraint(equalTo: view.topAnchor)),
|
||||
centerConstraints: .init(centerXConstraint: dragView.centerXAnchor.constraint(equalTo: view.centerXAnchor)),
|
||||
sizeConstraints: .init(widthConstraint: dragView.widthAnchor.constraint(equalToConstant: .zero),
|
||||
heightConstraint: dragView.heightAnchor.constraint(equalToConstant: .zero)))
|
||||
|
|
|
|||
|
|
@ -27,18 +27,6 @@ where ContentViewController: UIViewController {
|
|||
|
||||
private(set) public lazy var contentViewController = createContentViewController()
|
||||
|
||||
open override var viewControllerAppearance: BaseAppearance {
|
||||
let appearance = super.viewControllerAppearance
|
||||
|
||||
appearance.dragViewState = .presented(.defaultAppearance)
|
||||
appearance.headerViewState = .presented(.make {
|
||||
$0.backgroundColor = .white
|
||||
$0.contentViewState = .buttonLeft(.init(titles: [.normal: "Close"],
|
||||
appearance: [.normal: .init(backgroundColor: .white)]))
|
||||
})
|
||||
|
||||
return appearance
|
||||
}
|
||||
// MARK: - BaseModalViewController
|
||||
|
||||
open override func createContentView() -> UIView {
|
||||
|
|
|
|||
|
|
@ -53,9 +53,10 @@ class CustomViewController: BaseModalViewController<UIView, UIView> {
|
|||
|
||||
appearance.dragViewState = .presented(.defaultAppearance)
|
||||
appearance.headerViewState = .presented(.make {
|
||||
$0.layout.size = .fixedHeight(52)
|
||||
$0.backgroundColor = .white
|
||||
$0.contentViewState = .buttonLeft(.init(titles: [.normal: "Close"],
|
||||
appearance: [.normal: .init(backgroundColor: .white)]))
|
||||
appearance: [.normal: .init(backgroundColor: .blue)]))
|
||||
})
|
||||
|
||||
return appearance
|
||||
|
|
|
|||
|
|
@ -55,9 +55,10 @@ class CustomViewController: BaseModalViewController<UIView, UIView> {
|
|||
|
||||
appearance.dragViewState = .presented(.defaultAppearance)
|
||||
appearance.headerViewState = .presented(.make {
|
||||
$0.layout.size = .fixedHeight(52)
|
||||
$0.backgroundColor = .white
|
||||
$0.contentViewState = .buttonLeft(.init(titles: [.normal: "Close"],
|
||||
appearance: [.normal: .init(backgroundColor: .white)]))
|
||||
appearance: [.normal: .init(backgroundColor: .blue)]))
|
||||
})
|
||||
|
||||
return appearance
|
||||
|
|
|
|||
Loading…
Reference in New Issue