File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
Sources/ComponentsKit/Modal/UIKit Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 11import UIKit
22
33/// A bottom-aligned modal controller.
4+ ///
5+ /// - Example:
6+ /// ```swift
7+ /// let bottomModal = UKBottomModalController(
8+ /// model: BottomModalVM(),
9+ /// header: { _ in
10+ /// let headerLabel = UILabel()
11+ /// headerLabel.text = "Header"
12+ /// return headerLabel
13+ /// },
14+ /// body: { _ in
15+ /// let bodyLabel = UILabel()
16+ /// bodyLabel.text = "This is the body content of the modal."
17+ /// bodyLabel.numberOfLines = 0
18+ /// return bodyLabel
19+ /// },
20+ /// footer: { dismiss in
21+ /// return UKButton(model: .init {
22+ /// $0.title = "Close"
23+ /// }) {
24+ /// dismiss(true)
25+ /// }
26+ /// }
27+ /// )
28+ ///
29+ /// vc.present(bottomModal, animated: true)
30+ /// ```
431public class UKBottomModalController : UKModalController < BottomModalVM > {
532 // MARK: - Initialization
633
Original file line number Diff line number Diff line change 11import UIKit
22
33/// A center-aligned modal controller.
4+ ///
5+ /// - Example:
6+ /// ```swift
7+ /// let centerModal = UKCenterModalController(
8+ /// model: CenterModalVM(),
9+ /// header: { _ in
10+ /// let headerLabel = UILabel()
11+ /// headerLabel.text = "Header"
12+ /// return headerLabel
13+ /// },
14+ /// body: { _ in
15+ /// let bodyLabel = UILabel()
16+ /// bodyLabel.text = "This is the body content of the modal."
17+ /// bodyLabel.numberOfLines = 0
18+ /// return bodyLabel
19+ /// },
20+ /// footer: { dismiss in
21+ /// return UKButton(model: .init {
22+ /// $0.title = "Close"
23+ /// }) {
24+ /// dismiss(true)
25+ /// }
26+ /// }
27+ /// )
28+ ///
29+ /// vc.present(centerModal, animated: true)
30+ /// ```
431public class UKCenterModalController : UKModalController < CenterModalVM > {
532 // MARK: - Initialization
633
You can’t perform that action at this time.
0 commit comments