@@ -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// /------------------------------------
0 commit comments