Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
kennic committed Jan 7, 2021
1 parent 24e140c commit dc9cf9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions FrameLayoutKit/Classes/ScrollStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ open class ScrollStackView: UIView {

@discardableResult
open func add(_ view: UIView?) -> FrameLayout {
if let view = view { scrollView.addSubview(view) }
let layout = frameLayout.add(view)
if let view = view { scrollView.addSubview(view) }
setNeedsLayout()
return layout
}
Expand All @@ -410,8 +410,8 @@ open class ScrollStackView: UIView {

@discardableResult
open func insert(_ view: UIView?, at index: Int) -> FrameLayout {
if let view = view { scrollView.insertSubview(view, at: index) }
let layout = frameLayout.insert(view, at: index)
if let view = view { scrollView.insertSubview(view, at: index) }
setNeedsLayout()
return layout
}
Expand Down Expand Up @@ -439,10 +439,11 @@ open class ScrollStackView: UIView {
views = []
}

open func relayoutSubviews(animateDuration: TimeInterval = 0.35, options: UIView.AnimationOptions = .allowUserInteraction, completion: ((Bool) -> Void)? = nil) {
open func relayoutSubviews(animateDuration: TimeInterval = 0.35, options: UIView.AnimationOptions = .curveEaseInOut, completion: ((Bool) -> Void)? = nil) {
setNeedsLayout()

UIView.animate(withDuration: animateDuration, delay: 0.0, options: options, animations: {
self.layoutSubviews()
self.layoutIfNeeded()
}, completion: completion)
}

Expand Down
4 changes: 2 additions & 2 deletions FrameLayoutKit/Classes/StackFrameLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ open class StackFrameLayout: FrameLayout {
if let view = view, view.superview == nil {
#if DEBUG
if !isUserInteractionEnabled, view is UIControl {
print("[FrameLayoutKit] \(view) was automatically added to StackFrameLayout \(self) which was disabled user interation. This could make your control unable to interact. You can either set isUserInteractionEnabled = true for this FrameLayout or addSubview(your control) before adding to frameLayout")
print("⚠️ [FrameLayoutKit] \(view) was automatically added to StackFrameLayout \(self) which was disabled user interation. This could make your control unable to interact. You can either set isUserInteractionEnabled = true for this FrameLayout or addSubview(your control) before adding to frameLayout.")
}
#endif
addSubview(view)
Expand All @@ -200,7 +200,7 @@ open class StackFrameLayout: FrameLayout {
if let view = view, view.superview == nil {
#if DEBUG
if !isUserInteractionEnabled, view is UIControl {
print("[FrameLayoutKit] \(view) was automatically added to StackFrameLayout \(self) which was disabled user interation. This could make your control unable to interact. You can either set isUserInteractionEnabled = true for this FrameLayout or addSubview(your control) before adding to frameLayout")
print("⚠️ [FrameLayoutKit] \(view) was automatically added to StackFrameLayout \(self) which was disabled user interation. This could make your control unable to interact. You can either set isUserInteractionEnabled = true for this FrameLayout or addSubview(your control) before adding to frameLayout.")
}
#endif
addSubview(view)
Expand Down

0 comments on commit dc9cf9f

Please sign in to comment.