Skip to content

Commit 87cfc5a

Browse files
committed
Fix typo in documentation
1 parent 0dcc9fc commit 87cfc5a

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ This is an overview of the architecture:
9999
![](./architecture.png)
100100

101101
- `ScrollStackController `: is a subclass of `UIViewController`. You would to use it and add as a child controller of your view controller. This allows you to manage any child-controllers related events for each row you will add to the stack controller.
102-
- `ScrollStack`: the view of the `ScrollStackController ` is a `ScrollStack`, a subclass of `UIScrollView` with an `UIStackView` which allows you to manage the layout of the stack.
102+
- `ScrollStack`: the view of the `ScrollStackController ` is a `ScrollStack`, a subclass of `UIScrollView` with an `UIStackView` which allows you to manage the layout of the stack. You can access to it via `scrollStack` property of the controller.
103103
- Each row is a `ScrollStackRow`, which is a subclass of `UIView`. Inside there are two views, the `contentView` (a reference to managed `UIViewController`'s `view`) and the `separatorView`. A row strongly reference managed view controller, so you don't need to keep a strong reference by your own.
104104
- Separator view are subclass of `ScrollStackSeparator` class.
105105

@@ -115,6 +115,8 @@ class MyViewController: UIViewController {
115115

116116
override func viewDidLoad() {
117117
super.viewDidLoad()
118+
119+
stackController.view.frame = contentView.bounds
118120
contentView.addSubview(stackController.view)
119121
}
120122

@@ -548,7 +550,7 @@ class ViewController: ScrollStackController, ScrollStackControllerDelegate {
548550
func viewDidLoad() {
549551
super.viewDidLoad()
550552

551-
self.stackView.stackDelegate = self
553+
self.scrollStack.stackDelegate = self
552554
}
553555

554556
func scrollStackDidScroll(_ stackView: ScrollStack, offset: CGPoint) {

ScrollStackControllerDemo/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ViewController: UIViewController {
1515
private var stackController = ScrollStackViewController()
1616

1717
public var stackView: ScrollStack {
18-
return stackController.stackView
18+
return stackController.scrollStack
1919
}
2020

2121

Sources/ScrollStackController/ScrollStackViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ open class ScrollStackViewController: UIViewController {
3737
// MARK: Public Properties
3838

3939
/// Inner stack view control.
40-
public let stackView = ScrollStack()
40+
public let scrollStack = ScrollStack()
4141

4242
/// Displays the scroll indicators momentarily.
4343
open var automaticallyFlashScrollIndicators = false
@@ -55,9 +55,9 @@ open class ScrollStackViewController: UIViewController {
5555
// MARK: View Lifecycle
5656

5757
open override func loadView() {
58-
view = stackView
58+
view = scrollStack
5959
// monitor remove or add of a row to manage the view controller's hierarchy
60-
stackView.onChangeRow = { [weak self] (row, isRemoved) in
60+
scrollStack.onChangeRow = { [weak self] (row, isRemoved) in
6161
guard let `self` = self else {
6262
return
6363
}
@@ -69,7 +69,7 @@ open class ScrollStackViewController: UIViewController {
6969
super.viewDidAppear(animated)
7070

7171
if automaticallyFlashScrollIndicators {
72-
stackView.flashScrollIndicators()
72+
scrollStack.flashScrollIndicators()
7373
}
7474
}
7575

0 commit comments

Comments
 (0)