88
99import UIKit
1010
11- class ViewController : UIViewController {
11+ class ViewController : UIViewController , ScrollStackControllerDelegate {
12+
1213
1314 @IBOutlet public var contentView : UIView !
1415
@@ -28,13 +29,19 @@ class ViewController: UIViewController {
2829 override func viewDidLoad( ) {
2930 super. viewDidLoad ( )
3031 }
32+
33+ func scrollStackRowDidUpdateLayout( _ stackView: ScrollStack ) {
34+ debugPrint ( " New content insets \( stackView. contentSize. height) " )
35+ }
3136
3237 override func viewDidAppear( _ animated: Bool ) {
3338 super. viewDidAppear ( animated)
3439
3540 stackController. view. frame = contentView. bounds
3641 contentView. addSubview ( stackController. view)
3742
43+
44+ stackView. stackDelegate = self
3845 // Prepare content
3946
4047 welcomeVC = WelcomeVC . create ( )
@@ -44,7 +51,6 @@ class ViewController: UIViewController {
4451 notesVC = NotesVC . create ( delegate: self )
4552
4653 stackView. addRows ( controllers: [ welcomeVC, notesVC, tagsVC, galleryVC, pricingVC] , animated: false )
47-
4854 }
4955
5056 @IBAction public func addNewRow( ) {
@@ -78,6 +84,28 @@ class ViewController: UIViewController {
7884 let randomRow = Int . random ( in: 0 ..< stackView. rows. count)
7985 stackView. scrollToRow ( index: randomRow, at: . middle, animated: true )
8086 }
87+
88+
89+ func scrollStackDidScroll( _ stackView: ScrollStack , offset: CGPoint ) {
90+
91+ }
92+
93+ func scrollStackRowDidBecomeVisible( _ stackView: ScrollStack , row: ScrollStackRow , index: Int , state: ScrollStack . RowVisibility ) {
94+
95+ }
96+
97+ func scrollStackRowDidBecomeHidden( _ stackView: ScrollStack , row: ScrollStackRow , index: Int , state: ScrollStack . RowVisibility ) {
98+
99+ }
100+
101+ func scrollStackDidUpdateLayout( _ stackView: ScrollStack ) {
102+
103+ }
104+
105+ func scrollStackContentSizeDidChange( _ stackView: ScrollStack , from oldValue: CGSize , to newValue: CGSize ) {
106+ // debugPrint("Content size did change from \(oldValue) to \(newValue)")
107+ }
108+
81109}
82110
83111extension ViewController : TagsVCProtocol {
0 commit comments