Skip to content

Commit 31a9e14

Browse files
committed
fixed debugColor should also affect to all sub frameLayouts
1 parent dfe73e3 commit 31a9e14

8 files changed

Lines changed: 51 additions & 18 deletions

File tree

Binary file not shown.

FrameLayoutKit.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Pod::Spec.new do |s|
22
s.name = 'FrameLayoutKit'
3-
s.version = '6.6'
3+
s.version = '6.6.1'
44
s.summary = 'FrameLayoutKit is a super fast and easy to use layout kit'
55
s.description = <<-DESC
6-
An auto layout kit helps you to layout your UI easier, faster and more effective
6+
An auto layout kit helps you to layout your UI easier, faster and more effective with operand syntax and nested functions
77
DESC
88

99
s.homepage = 'https://github.com/kennic/FrameLayoutKit'
@@ -12,9 +12,9 @@ Pod::Spec.new do |s|
1212
s.source = { :git => 'https://github.com/kennic/FrameLayoutKit.git', :tag => s.version.to_s }
1313
s.social_media_url = 'https://twitter.com/namkennic'
1414
s.platform = :ios, "9.0"
15-
s.platform = :tvos, "9.0"
15+
# s.platform = :tvos, "9.0"
1616
s.ios.deployment_target = '9.0'
17-
s.tvos.deployment_target = '9.0'
17+
# s.tvos.deployment_target = '9.0'
1818
s.swift_version = "5.2"
1919
s.source_files = 'FrameLayoutKit/Classes/**/*.*'
2020

FrameLayoutKit/Classes/DoubleFrameLayout.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,20 @@ open class DoubleFrameLayout: FrameLayout {
8484

8585
override open var debug: Bool {
8686
didSet {
87+
super.debug = debug
8788
frameLayout1.debug = debug
8889
frameLayout2.debug = debug
8990
}
9091
}
9192

93+
override open var debugColor: UIColor?{
94+
didSet {
95+
super.debugColor = debugColor
96+
frameLayout1.debugColor = debugColor
97+
frameLayout2.debugColor = debugColor
98+
}
99+
}
100+
92101
override open var allowContentVerticalGrowing: Bool {
93102
didSet {
94103
frameLayout1.allowContentVerticalGrowing = allowContentVerticalGrowing

FrameLayoutKit/Classes/FrameLayout+Extension.swift renamed to FrameLayoutKit/Classes/Extensions/FrameLayout+Extension.swift

File renamed without changes.

FrameLayoutKit/Classes/FlowFrameLayout.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ open class FlowFrameLayout: FrameLayout {
6464
}
6565

6666
override public var debug: Bool {
67-
didSet {
68-
stackLayout.debug = debug
69-
stackLayout.frameLayouts.forEach { $0.debug = debug }
70-
setNeedsLayout()
71-
}
67+
didSet { stackLayout.debug = debug }
68+
}
69+
70+
override public var debugColor: UIColor? {
71+
didSet { stackLayout.debugColor = debugColor }
7272
}
7373

7474
public var isJustified: Bool = false {

FrameLayoutKit/Classes/GridFrameLayout.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ open class GridFrameLayout: FrameLayout {
104104
}
105105

106106
override public var debug: Bool {
107-
didSet {
108-
stackLayout.debug = debug
109-
stackLayout.frameLayouts.forEach { $0.debug = debug }
110-
setNeedsLayout()
111-
}
107+
didSet { stackLayout.debug = debug }
108+
}
109+
110+
override public var debugColor: UIColor? {
111+
didSet { stackLayout.debugColor = debugColor }
112112
}
113113

114114
public var verticalSpacing: CGFloat {

FrameLayoutKit/Classes/ScrollStackView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ open class ScrollStackView: UIView {
7474
set { frameLayout.debug = newValue }
7575
}
7676

77+
public var debugColor: UIColor? {
78+
get { frameLayout.debugColor }
79+
set { frameLayout.debugColor = newValue }
80+
}
81+
7782
public var isOverlapped: Bool {
7883
get { frameLayout.isOverlapped }
7984
set { frameLayout.isOverlapped = newValue }

FrameLayoutKit/Classes/StackFrameLayout.swift

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,31 @@ open class StackFrameLayout: FrameLayout {
3232
}
3333

3434
override open var ignoreHiddenView: Bool {
35-
didSet { frameLayouts.forEach { $0.ignoreHiddenView = ignoreHiddenView } }
35+
didSet {
36+
super.ignoreHiddenView = ignoreHiddenView
37+
frameLayouts.forEach { $0.ignoreHiddenView = ignoreHiddenView }
38+
}
3639
}
3740

3841
override open var shouldCacheSize: Bool {
39-
didSet { frameLayouts.forEach { $0.shouldCacheSize = shouldCacheSize } }
42+
didSet {
43+
super.shouldCacheSize = shouldCacheSize
44+
frameLayouts.forEach { $0.shouldCacheSize = shouldCacheSize }
45+
}
4046
}
4147

4248
override open var debug: Bool {
43-
didSet { frameLayouts.forEach { $0.debug = debug } }
49+
didSet {
50+
super.debug = debug
51+
frameLayouts.forEach { $0.debug = debug }
52+
}
53+
}
54+
55+
override open var debugColor: UIColor?{
56+
didSet {
57+
super.debugColor = debugColor
58+
frameLayouts.forEach { $0.debugColor = debugColor }
59+
}
4460
}
4561

4662
/// Set minContentSize for every FrameLayout inside
@@ -87,7 +103,10 @@ open class StackFrameLayout: FrameLayout {
87103
}
88104

89105
override open var clipsToBounds: Bool {
90-
didSet { frameLayouts.forEach { $0.clipsToBounds = clipsToBounds } }
106+
didSet {
107+
super.clipsToBounds = clipsToBounds
108+
frameLayouts.forEach { $0.clipsToBounds = clipsToBounds }
109+
}
91110
}
92111

93112
public var firstFrameLayout: FrameLayout? { frameLayouts.first }

0 commit comments

Comments
 (0)