Skip to content

Commit dc86626

Browse files
committed
Merge branch 'release/1.0.3'
2 parents 9ff8ba1 + b8e3e59 commit dc86626

File tree

7 files changed

+16
-5
lines changed

7 files changed

+16
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/Pods
22
/Podfile.lock
3+
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ let allRows = scrollStack.rows
129129
let isEmpty = scrollStack.isEmpty // true if it does not contains row
130130
let notHiddenRows = scrollStack.rows.filter { !$0.isHidden }
131131

132-
// By Vibility
132+
// By Visibility
133133
let currentlyVisibleRows = scrollStack.visibleRows // only currently visible rows (partially or enterly)
134134
let enterlyVisibleRows = scrollStack.enterlyVisibleRows // only enterly visible rows into the stack
135135

ScrollStackController.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "ScrollStackController"
3-
s.version = "1.0.2"
3+
s.version = "1.0.3"
44
s.summary = "Create complex scrollable layout using UIViewController and simplify your code"
55
s.homepage = "https://github.com/malcommac/ScrollStackController"
66
s.license = { :type => "MIT", :file => "LICENSE" }

ScrollStackControllerDemo/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ViewController: UIViewController {
8383
extension ViewController: TagsVCProtocol {
8484

8585
func toggleTags() {
86-
let index = stackView.gitrowForController(tagsVC)!.index
86+
let index = stackView.rowForController(tagsVC)!.index
8787
tagsVC.isExpanded = !tagsVC.isExpanded
8888
stackView.reloadRow(index: index, animated: true)
8989
}

Sources/ScrollStackController/ScrollStack.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,17 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
225225
fatalError("Initialization from IB not supported yet!")
226226
}
227227

228+
// MARK: - Set Rows
229+
230+
/// Remove all existing rows and setup the new rows.
231+
///
232+
/// - Parameter controllers: controllers to set.
233+
@discardableResult
234+
open func setRows(controllers: [UIViewController]) -> [ScrollStackRow] {
235+
removeAllRows(animated: false)
236+
return addRows(controllers: controllers)
237+
}
238+
228239
// MARK: - Insert Rows
229240
/// Insert a new row to manage passed controller instance.
230241
///
@@ -615,6 +626,7 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
615626

616627
rows.forEach {
617628
$0.askForCutomizedSizeOfContentView(animated: animated)
629+
($0.controller as? ScrollStackContainableController)?.reloadContentFromStackView(stackView: self, row: $0, animated: animated)
618630
}
619631

620632
UIView.execute(animated: animated, {

Sources/ScrollStackController/ScrollStackRow.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ open class ScrollStackRow: UIView, UIGestureRecognizerDelegate {
267267
case .fitLayoutForAxis:
268268
setupRowSizeToFitLayout()
269269
}
270-
271-
customizableController.reloadContentFromStackView(stackView: stackView!, row: self, animated: animated)
272270
}
273271

274272
private func setupRowToFixedValue(_ value: CGFloat) {

0 commit comments

Comments
 (0)