Skip to content

Commit b7de9cc

Browse files
committed
#3 Added setRows() method
1 parent 2f447b2 commit b7de9cc

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Sources/ScrollStackController/ScrollStack.swift

Lines changed: 11 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
///

0 commit comments

Comments
 (0)