docs: update appearance of view controller in documentation

This commit is contained in:
Nikita Semenov 2023-07-03 10:17:47 +03:00
parent 06a83190ab
commit b97ea5bc8f
4 changed files with 5 additions and 18 deletions

View File

@ -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)))

View File

@ -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 {

View File

@ -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

View File

@ -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