File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed
Sources/ComponentsKit/Divider Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ extension DividerVM {
34
34
return 2.0
35
35
}
36
36
}
37
+ }
38
+
39
+ // MARK: - UIKit Helpers
37
40
41
+ extension DividerVM {
38
42
func shouldUpdateLayout( _ oldModel: Self ) -> Bool {
39
43
return self . orientation != oldModel. orientation
40
44
|| self . size != oldModel. size
Original file line number Diff line number Diff line change @@ -11,22 +11,12 @@ open class UKDivider: UIView, UKComponent {
11
11
}
12
12
}
13
13
14
- // MARK: - UIView methods
14
+ // MARK: - UIView Properties
15
15
16
16
open override var intrinsicContentSize : CGSize {
17
17
return self . sizeThatFits ( UIView . layoutFittingExpandedSize)
18
18
}
19
19
20
- open override func sizeThatFits( _ size: CGSize ) -> CGSize {
21
- let lineSize = self . model. lineSize
22
- switch self . model. orientation {
23
- case . vertical:
24
- return CGSize ( width: lineSize, height: size. height)
25
- case . horizontal:
26
- return CGSize ( width: size. width, height: lineSize)
27
- }
28
- }
29
-
30
20
// MARK: - Initializers
31
21
32
22
/// Initializer.
@@ -61,4 +51,16 @@ open class UKDivider: UIView, UKComponent {
61
51
self . invalidateIntrinsicContentSize ( )
62
52
}
63
53
}
54
+
55
+ // MARK: - UIView Methods
56
+
57
+ open override func sizeThatFits( _ size: CGSize ) -> CGSize {
58
+ let lineSize = self . model. lineSize
59
+ switch self . model. orientation {
60
+ case . vertical:
61
+ return CGSize ( width: lineSize, height: size. height)
62
+ case . horizontal:
63
+ return CGSize ( width: size. width, height: lineSize)
64
+ }
65
+ }
64
66
}
You can’t perform that action at this time.
0 commit comments