Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.

Commit be78804

Browse files
committed
Version 0.1.1
* Documented new collection view methods * Updated changelog * Bump version
1 parent bed021c commit be78804

File tree

4 files changed

+113
-10
lines changed

4 files changed

+113
-10
lines changed

Changelog.markdown

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
### Version 0.1.1
44

5-
**Unreleased**
5+
[Released October 18, 2011](https://github.com/samsoffes/sstoolkit/tree/0.1.1)
66

77
* Added `SSCollectionViewItemAnimation` to SSCollectionView
88

99
* Added basic tests
1010

11+
* Documented SSCollectionViewDataSource
12+
13+
* Documented SSCollectionViewDelegate
14+
15+
* Added `- (NSArray *)visibleItems` to SSCollectionView
16+
17+
* Added `- (NSArray *)indexPathsForVisibleRows` to SSCollectionView
18+
1119
* Added begin/end updates to SSCollection with the following methods:
1220

1321
- (void)beginUpdates;
@@ -16,10 +24,9 @@
1624
- (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths withItemAnimation:(SSCollectionViewItemAnimation)animation;
1725
- (void)insertSections:(NSIndexSet *)sections withItemAnimation:(SSCollectionViewItemAnimation)animation;
1826
- (void)deleteSections:(NSIndexSet *)sections withItemAnimation:(SSCollectionViewItemAnimation)animation;
19-
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection;
2027

2128
### Version 0.1.0
2229

23-
[Released September 18, 2011](https://github.com/samsoffes/sskeychain/tree/0.1.0)
30+
[Released October 17, 2011](https://github.com/samsoffes/sstoolkit/tree/0.1.0)
2431

2532
* Initial release

SSToolkit/SSCollectionView.h

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,114 @@ typedef enum {
269269
/// @name Inserting, Deleting, and Moving Items and Sections
270270
///---------------------------------------------------------
271271

272+
/**
273+
Begin a series of method calls that insert, delete, or select items and sections of the receiver.
274+
275+
Call this method if you want subsequent insertions, deletion, and selection operations (for example,
276+
`itemForIndexPath:` and `indexPathsForVisibleItems`) to be animated simultaneously. This group of methods must conclude
277+
with an invocation of `endUpdates`. These method pairs can be nested. If you do not make the insertion, deletion, and
278+
selection calls inside this block, collection view attributes such as item count might become invalid. You should not
279+
call `reloadData` within the group; if you call this method within the group, you will need to perform any animations
280+
yourself.
281+
282+
@see endUpdates
283+
284+
@warning This functionality was introduced in version 0.1.1 and still considered in development. During development,
285+
it has proven to be stable, but use with care.
286+
*/
272287
- (void)beginUpdates;
288+
289+
/**
290+
Conclude a series of method calls that insert, delete, select, or reload items and sections of the receiver.
291+
292+
You call this method to bracket a series of method calls that began with `beginUpdates` and that consist of operations
293+
to insert, delete, select, and reload items and sections of the collection view. When you call `endUpdates`,
294+
SSCollectionView animates the operations simultaneously. Invocations of `beginUpdates` and `endUpdates` can be nested.
295+
If you do not make the insertion, deletion, and selection calls inside this block, collection view attributes such as
296+
item count might become invalid.
297+
298+
@see beginUpdates
299+
300+
@warning Currently only row-based animations are preformed. Eventually item-based animations will be supported.
301+
*/
273302
- (void)endUpdates;
303+
304+
/**
305+
Inserts items in the receiver at the locations identified by an array of index paths, with an option to animate the
306+
insertion.
307+
308+
Note the behavior of this method when it is called in an animation block defined by the `beginUpdates` and `endUpdates`
309+
methods. SSCollectionView defers any insertions of items or sections until after it has handled the deletions of rows
310+
or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting
311+
or removing an item in a mutable array, where the operation can affect the array index used for the successive
312+
insertion or removal operation.
313+
314+
@param indexPaths An array of NSIndexPath objects each representing a item index and section index that together
315+
identify an item in the collection view.
316+
317+
@param animation A constant that either specifies the kind of animation to perform when inserting the item or requests
318+
no animation. See `SSCollectionViewItemAnimation` in the header file for more.
319+
320+
@warning Currently, this is only supported inside of a `beginUpdates` and `endUpdates` animation block.
321+
*/
274322
- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths withItemAnimation:(SSCollectionViewItemAnimation)animation;
323+
324+
/**
325+
Deletes the items specified by an array of index paths, with an option to animate the deletion.
326+
327+
Note the behavior of this method when it is called in an animation block defined by the `beginUpdates` and `endUpdates`
328+
methods. SSCollectionView defers any insertions of items or sections until after it has handled the deletions of rows
329+
or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting
330+
or removing an item in a mutable array, where the operation can affect the array index used for the successive
331+
insertion or removal operation.
332+
333+
@param indexPaths An array of NSIndexPath objects each representing a item index and section index that together
334+
identify an item in the collection view.
335+
336+
@param animation A constant that either specifies the kind of animation to perform when inserting the item or requests
337+
no animation. See `SSCollectionViewItemAnimation` in the header file for more.
338+
339+
@warning Currently, this is only supported inside of a `beginUpdates` and `endUpdates` animation block.
340+
*/
275341
- (void)deleteItemsAtIndexPaths:(NSArray *)indexPaths withItemAnimation:(SSCollectionViewItemAnimation)animation;
342+
343+
/**
344+
Inserts one or more sections in the receiver, with an option to animate the insertion.
345+
346+
Note the behavior of this method when it is called in an animation block defined by the `beginUpdates` and `endUpdates`
347+
methods. SSCollectionView defers any insertions of items or sections until after it has handled the deletions of rows
348+
or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting
349+
or removing an item in a mutable array, where the operation can affect the array index used for the successive
350+
insertion or removal operation.
351+
352+
@param sections An index set that specifies the sections to insert in the receiving collection view. If a section
353+
already exists at the specified index location, it is moved down one index location.
354+
355+
@param animation A constant that indicates how the insertion is to be animated, for example, fade in or slide in from
356+
the left. See `SSCollectionViewItemAnimation` in the header file for more.
357+
358+
@warning Currently, this is only supported inside of a `beginUpdates` and `endUpdates` animation block.
359+
*/
276360
- (void)insertSections:(NSIndexSet *)sections withItemAnimation:(SSCollectionViewItemAnimation)animation;
361+
362+
/**
363+
Deletes one or more sections in the receiver, with an option to animate the deletion.
364+
365+
Note the behavior of this method when it is called in an animation block defined by the `beginUpdates` and `endUpdates`
366+
methods. SSCollectionView defers any insertions of items or sections until after it has handled the deletions of rows
367+
or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting
368+
or removing an item in a mutable array, where the operation can affect the array index used for the successive
369+
insertion or removal operation.
370+
371+
@param sections An index set that specifies the sections to insert in the receiving collection view. If a section
372+
already exists at the specified index location, it is moved down one index location.
373+
374+
@param animation A constant that indicates how the insertion is to be animated, for example, fade in or slide in from
375+
the left. See `SSCollectionViewItemAnimation` in the header file for more.
376+
377+
@warning Currently, this is only supported inside of a `beginUpdates` and `endUpdates` animation block.
378+
*/
277379
- (void)deleteSections:(NSIndexSet *)sections withItemAnimation:(SSCollectionViewItemAnimation)animation;
278-
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection;
279380

280381

281382
///------------------------------------

SSToolkit/SSCollectionView.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,6 @@ - (void)deleteSections:(NSIndexSet *)sections withItemAnimation:(SSCollectionVie
450450
}
451451

452452

453-
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection {
454-
[_tableView moveSection:section toSection:newSection];
455-
}
456-
457-
458453
#pragma mark - Reloading the Collection View
459454

460455
- (void)reloadData {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.1.1

0 commit comments

Comments
 (0)