Skip to content

Commit

Permalink
fixed debugColor should also affect to all sub frameLayouts
Browse files Browse the repository at this point in the history
  • Loading branch information
kennic committed Jun 21, 2023
1 parent dfe73e3 commit 31a9e14
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 18 deletions.
Binary file not shown.
8 changes: 4 additions & 4 deletions FrameLayoutKit.podspec
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Pod::Spec.new do |s|
s.name = 'FrameLayoutKit'
s.version = '6.6'
s.version = '6.6.1'
s.summary = 'FrameLayoutKit is a super fast and easy to use layout kit'
s.description = <<-DESC
An auto layout kit helps you to layout your UI easier, faster and more effective
An auto layout kit helps you to layout your UI easier, faster and more effective with operand syntax and nested functions
DESC

s.homepage = 'https://github.com/kennic/FrameLayoutKit'
Expand All @@ -12,9 +12,9 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/kennic/FrameLayoutKit.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/namkennic'
s.platform = :ios, "9.0"
s.platform = :tvos, "9.0"
# s.platform = :tvos, "9.0"
s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '9.0'
# s.tvos.deployment_target = '9.0'
s.swift_version = "5.2"
s.source_files = 'FrameLayoutKit/Classes/**/*.*'

Expand Down
9 changes: 9 additions & 0 deletions FrameLayoutKit/Classes/DoubleFrameLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,20 @@ open class DoubleFrameLayout: FrameLayout {

override open var debug: Bool {
didSet {
super.debug = debug
frameLayout1.debug = debug
frameLayout2.debug = debug
}
}

override open var debugColor: UIColor?{
didSet {
super.debugColor = debugColor
frameLayout1.debugColor = debugColor
frameLayout2.debugColor = debugColor
}
}

override open var allowContentVerticalGrowing: Bool {
didSet {
frameLayout1.allowContentVerticalGrowing = allowContentVerticalGrowing
Expand Down
10 changes: 5 additions & 5 deletions FrameLayoutKit/Classes/FlowFrameLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ open class FlowFrameLayout: FrameLayout {
}

override public var debug: Bool {
didSet {
stackLayout.debug = debug
stackLayout.frameLayouts.forEach { $0.debug = debug }
setNeedsLayout()
}
didSet { stackLayout.debug = debug }
}

override public var debugColor: UIColor? {
didSet { stackLayout.debugColor = debugColor }
}

public var isJustified: Bool = false {
Expand Down
10 changes: 5 additions & 5 deletions FrameLayoutKit/Classes/GridFrameLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ open class GridFrameLayout: FrameLayout {
}

override public var debug: Bool {
didSet {
stackLayout.debug = debug
stackLayout.frameLayouts.forEach { $0.debug = debug }
setNeedsLayout()
}
didSet { stackLayout.debug = debug }
}

override public var debugColor: UIColor? {
didSet { stackLayout.debugColor = debugColor }
}

public var verticalSpacing: CGFloat {
Expand Down
5 changes: 5 additions & 0 deletions FrameLayoutKit/Classes/ScrollStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ open class ScrollStackView: UIView {
set { frameLayout.debug = newValue }
}

public var debugColor: UIColor? {
get { frameLayout.debugColor }
set { frameLayout.debugColor = newValue }
}

public var isOverlapped: Bool {
get { frameLayout.isOverlapped }
set { frameLayout.isOverlapped = newValue }
Expand Down
27 changes: 23 additions & 4 deletions FrameLayoutKit/Classes/StackFrameLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,31 @@ open class StackFrameLayout: FrameLayout {
}

override open var ignoreHiddenView: Bool {
didSet { frameLayouts.forEach { $0.ignoreHiddenView = ignoreHiddenView } }
didSet {
super.ignoreHiddenView = ignoreHiddenView
frameLayouts.forEach { $0.ignoreHiddenView = ignoreHiddenView }
}
}

override open var shouldCacheSize: Bool {
didSet { frameLayouts.forEach { $0.shouldCacheSize = shouldCacheSize } }
didSet {
super.shouldCacheSize = shouldCacheSize
frameLayouts.forEach { $0.shouldCacheSize = shouldCacheSize }
}
}

override open var debug: Bool {
didSet { frameLayouts.forEach { $0.debug = debug } }
didSet {
super.debug = debug
frameLayouts.forEach { $0.debug = debug }
}
}

override open var debugColor: UIColor?{
didSet {
super.debugColor = debugColor
frameLayouts.forEach { $0.debugColor = debugColor }
}
}

/// Set minContentSize for every FrameLayout inside
Expand Down Expand Up @@ -87,7 +103,10 @@ open class StackFrameLayout: FrameLayout {
}

override open var clipsToBounds: Bool {
didSet { frameLayouts.forEach { $0.clipsToBounds = clipsToBounds } }
didSet {
super.clipsToBounds = clipsToBounds
frameLayouts.forEach { $0.clipsToBounds = clipsToBounds }
}
}

public var firstFrameLayout: FrameLayout? { frameLayouts.first }
Expand Down

0 comments on commit 31a9e14

Please sign in to comment.