Skip to content

Commit 03ed41a

Browse files
committed
Documentation
1 parent ee22594 commit 03ed41a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Examples/DemosApp/DemosApp/ComponentsPreview/PreviewPages/DividerPreview.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import UIKit
44

55
struct DividerPreview: View {
66
@State private var model = DividerVM()
7-
7+
88
var body: some View {
99
VStack {
1010
PreviewWrapper(title: "UIKit") {

Sources/ComponentsKit/Divider/UKDivider.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
import UIKit
22

3+
/// A UIKit component that displays a separating line.
34
open class UKDivider: UIView, UKComponent {
5+
// MARK: - Properties
6+
7+
/// A model that defines the appearance properties.
48
public var model: DividerVM {
59
didSet {
610
self.update(oldValue)
711
}
812
}
913

14+
// MARK: - Initializers
15+
16+
/// Initializer.
17+
/// - Parameters:
18+
/// - model: A model that defines the appearance properties.
1019
public init(model: DividerVM = .init()) {
1120
self.model = model
1221
super.init(frame: .zero)
@@ -17,10 +26,14 @@ open class UKDivider: UIView, UKComponent {
1726
fatalError("init(coder:) has not been implemented")
1827
}
1928

29+
// MARK: - Setup
30+
2031
private func setup() {
2132
self.backgroundColor = self.model.color.uiColor
2233
}
2334

35+
// MARK: - Update
36+
2437
public func update(_ oldModel: DividerVM) {
2538
guard self.model != oldModel else { return }
2639

@@ -33,10 +46,14 @@ open class UKDivider: UIView, UKComponent {
3346
self.setNeedsLayout()
3447
}
3548

49+
// MARK: - Layout
50+
3651
open override func layoutSubviews() {
3752
super.layoutSubviews()
3853
}
3954

55+
// MARK: - UIView Properties
56+
4057
open override var intrinsicContentSize: CGSize {
4158
return self.sizeThatFits(UIView.layoutFittingExpandedSize)
4259
}

0 commit comments

Comments
 (0)