You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,16 +70,12 @@ You can think of it as `UITableView` but with several differences:
70
70
71
71
### When to use `ScrollStackController` and when not
72
72
73
-
##### Yes
74
-
75
73
`ScrollStackController` is best used for shorter screens with an heterogeneous set of rows: in these cases you don't need to have view recycling.
76
74
77
75
Thanks to autolayout you will get updates and animations for free.
78
76
79
77
You can also manage each screen independently with a great separation of concerns; morehover unlike `UITableView` and `UICollectionView`, you can keep strong references to `UIViewController` (and its views) in an `ScrollStack` view and make changes to them at any point.
80
78
81
-
#### No
82
-
83
79
`ScrollStackController` is not suitable in all situations.
84
80
`ScrollStackController` lays out the entire UI at first time when your screen loads.
85
81
If you have a long list of rows you may experience delays.
@@ -142,7 +138,7 @@ Let's take a look below.
142
138
143
139
<aname="addingrows"/>
144
140
145
-
####Adding Rows
141
+
### Adding Rows
146
142
147
143
`ScrollStack` provides a comprehensive set of methods for managing rows, including inserting rows at the beginning and end, inserting rows above or below other rows.
148
144
@@ -174,7 +170,7 @@ As you noticed there is not need to keep a strong reference to any view controll
174
170
175
171
<aname="removingreplacingrows"/>
176
172
177
-
####Removing / Replacing Rows
173
+
### Removing / Replacing Rows
178
174
179
175
A similar set of APIs are used to remove existing rows from the stack:
`ScrollStack` uses the power of `UIStackView`: you can show and hide rows easily with a gorgeous animation by using one of the following methods:
219
215
@@ -232,7 +228,7 @@ Keep in mind: when you hide a rows the row still part of the stack and it's not
232
228
233
229
<aname="reloadrows"/>
234
230
235
-
####Reload Rows
231
+
### Reload Rows
236
232
237
233
Reload rows method allows you to refresh the layout of the entire stack (using `layoutIfNeeded()`) while you have a chance to update a specific row's `contentView` (aka the view of the managed `UIViewController`).
238
234
@@ -272,7 +268,7 @@ class GalleryVC: UIViewController, ScrollStackContainableController {
272
268
273
269
<aname="sizingrows"/>
274
270
275
-
####Sizing Rows
271
+
### Sizing Rows
276
272
277
273
You can control the size of your `UIViewController` inside a row of a `ScrollStack` in two ways:
278
274
@@ -292,7 +288,7 @@ Each of the following cases is covered inside the demo application:
292
288
293
289
<aname="fixedrowsize"/>
294
290
295
-
####Fixed Row Size
291
+
### Fixed Row Size
296
292
297
293
If your view controller has a fixed size you can just return it as follows:
298
294
@@ -320,7 +316,7 @@ When you will add this view controller in a scroll stack it will be sized as you
320
316
321
317
<aname="fittinglayoutrowsize"/>
322
318
323
-
####Fitting Layout Row Size
319
+
### Fitting Layout Row Size
324
320
325
321
Sometimes you may want to have the content view sized by fitting the contents of the view controller's view. In these cases you can use `. fitLayoutForAxis`.
####Working with dynamic UICollectionView/UITableView/UITextView
376
+
### Working with dynamic UICollectionView/UITableView/UITextView
381
377
382
378
There are some special cases where you may need to resize the row according to the changing content in your view controller's view.
383
379
@@ -419,7 +415,7 @@ In this way as you add new value to the table the size of the row in stack view
419
415
420
416
<aname="rowsseparator"/>
421
417
422
-
####Rows Separator
418
+
### Rows Separator
423
419
424
420
Each row managed by `ScrollStack` is of a subview class of type `ScrollStackRow`. It has a strong referenced to managed `UIViewController` but also have a subview on bottom called `ScrollStackSeparator`.
425
421
@@ -438,7 +434,7 @@ Moreover you can set these values directly on `ScrollStack` controller in order
438
434
439
435
<aname="taponrows"/>
440
436
441
-
####Tap On Rows
437
+
### Tap On Rows
442
438
443
439
By default rows are not tappable but if you need to implement some sort of tap features like in `UITableView` you can add it by setting a default callback for `onTap` property on `ScrollStackRow` instances.
0 commit comments