Skip to content

Commit

Permalink
Nitpicky comment fixes
Browse files Browse the repository at this point in the history
Mainly this addresses clarity of a few comments, line breaks at weird places, and style differences within a single file.
  • Loading branch information
amonshiz committed Mar 31, 2017
1 parent 623ff2a commit dabb0b0
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -52,3 +52,6 @@ Carthage/Build
# Bundler
.bundle
vendor

# Jetbrains
.idea
22 changes: 11 additions & 11 deletions Source/IGListAdapter.h
Expand Up @@ -24,9 +24,9 @@
NS_ASSUME_NONNULL_BEGIN

/**
A block to execute when list updates completes.
A block to execute when the list updates are completed.
@param finished Specifies whether or not the updates finished.
@param finished Specifies whether or not the update animations completed successfully.
*/
typedef void (^IGListUpdaterCompletion)(BOOL finished);

Expand All @@ -52,7 +52,7 @@ IGLK_SUBCLASSING_RESTRICTED
@property (nonatomic, nullable, weak) IGListCollectionView *collectionView;

/**
The object that acts as the data source for the list adapter.
The object that acts as the data source for the adapter.
*/
@property (nonatomic, nullable, weak) id <IGListAdapterDataSource> dataSource;

Expand All @@ -74,7 +74,7 @@ IGLK_SUBCLASSING_RESTRICTED
@property (nonatomic, nullable, weak) id <UIScrollViewDelegate> scrollViewDelegate;

/**
The updater for this list adapter.
The updater for the adapter.
*/
@property (nonatomic, strong, readonly) id <IGListUpdatingDelegate> updater;

Expand Down Expand Up @@ -104,11 +104,11 @@ IGLK_SUBCLASSING_RESTRICTED
workingRangeSize:(NSInteger)workingRangeSize NS_DESIGNATED_INITIALIZER;

/**
Perform an update from the previous state of the data source. This is analagous to calling
Perform an update from the previous state of the data source. This is analogous to calling
`-[UICollectionView performBatchUpdates:completion:]`.
@param animated A flag indicating if the transition should be animated.
@param completion The block to execute when the update completes.
@param completion The block to execute when the updates complete.
*/
- (void)performUpdatesAnimated:(BOOL)animated completion:(nullable IGListUpdaterCompletion)completion;

Expand All @@ -131,7 +131,7 @@ IGLK_SUBCLASSING_RESTRICTED
@param section A section in the list.
@return An section controller or `nil` if the section does not exist.
@return A section controller or `nil` if the section does not exist.
*/
- (nullable IGListSectionController <IGListSectionType> *)sectionControllerForSection:(NSInteger)section;

Expand All @@ -149,7 +149,7 @@ IGLK_SUBCLASSING_RESTRICTED
@param object An object from the data source.
@return An section controller or `nil` if `object` is not in the list.
@return A section controller or `nil` if `object` is not in the list.
@see `-[IGListAdapterDataSource listAdapter:sectionControllerForObject:]`
*/
Expand All @@ -160,7 +160,7 @@ IGLK_SUBCLASSING_RESTRICTED
@param sectionController A section controller in the list.
@return The object for the specified section controller, or nil if not found.
@return The object for the specified section controller, or `nil` if not found.
*/
- (nullable id)objectForSectionController:(IGListSectionController <IGListSectionType> *)sectionController;

Expand All @@ -183,7 +183,7 @@ IGLK_SUBCLASSING_RESTRICTED
- (NSInteger)sectionForObject:(id)object;

/**
Returns a copy of all the objects currently powering the adapter.
Returns a copy of all the objects currently driving the adapter.
@return An array of objects.
*/
Expand Down Expand Up @@ -213,7 +213,7 @@ IGLK_SUBCLASSING_RESTRICTED
- (NSArray<UICollectionViewCell *> *)visibleCellsForObject:(id)object;

/**
Scrolls to the sepcified object in the list adapter.
Scrolls to the specified object in the list adapter.
@param object The object to which to scroll.
@param supplementaryKinds The types of supplementary views in the section.
Expand Down
2 changes: 1 addition & 1 deletion Source/IGListAdapterDataSource.h
Expand Up @@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
Section controllers are initialized for all objects whenever the `IGListAdapter` is created, updated, or reloaded.
Section controllers are reused when objects are moved or updated. Maintaining the `-[IGListDiffable diffIdentifier]`
guarentees this.
guarantees this.
*/
- (IGListSectionController <IGListSectionType> *)listAdapter:(IGListAdapter *)listAdapter sectionControllerForObject:(id)object;

Expand Down
2 changes: 1 addition & 1 deletion Source/IGListAdapterUpdater.h
Expand Up @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN

/**
An `IGListAdapterUpdater` is a concrete type that conforms to `IGListUpdatingDelegate`.
It is an out-of-box upater for `IGListAdapter` objects to use.
It is an out-of-box updater for `IGListAdapter` objects to use.
@note This updater performs re-entrant, coalesced updating for a list. It also uses a least-minimal diff
for calculating UI updates when `IGListAdapter` calls
Expand Down
4 changes: 2 additions & 2 deletions Source/IGListAdapterUpdater.m
Expand Up @@ -65,7 +65,7 @@ - (void)performReloadDataWithCollectionView:(UICollectionView *)collectionView {
}

// execute all stored item update blocks even if we are just calling reloadData. the actual collection view
// mutations will be discarded, but clients are encouraged to put their actually /data/ mutations inside the
// mutations will be discarded, but clients are encouraged to put their actual /data/ mutations inside the
// update block as well, so if we don't execute the block the changes will never happen
for (IGListItemUpdateBlock itemUpdateBlock in batchUpdates.itemUpdateBlocks) {
itemUpdateBlock();
Expand Down Expand Up @@ -305,7 +305,7 @@ - (void)cleanStateBeforeUpdates {
// remove indexpath/item changes
self.objectTransitionBlock = nil;

// removes all object completion blocks. done before updates to start collecting completion blocks for coaslesced
// removes all object completion blocks. done before updates to start collecting completion blocks for coalesced
// or re-entrant object updates
[self.completionBlocks removeAllObjects];
}
Expand Down
2 changes: 1 addition & 1 deletion Source/IGListAdapterUpdaterDelegate.h
Expand Up @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)listAdapterUpdater:(IGListAdapterUpdater *)listAdapterUpdater willPerformBatchUpdatesWithCollectionView:(UICollectionView *)collectionView;

/**
Notifies the delegate that the updater succesfully finished `-[UICollectionView performBatchUpdates:completion:]`.
Notifies the delegate that the updater successfully finished `-[UICollectionView performBatchUpdates:completion:]`.
@param listAdapterUpdater The adapter updater owning the transition.
@param updates The batch updates that were applied to the collection view.
Expand Down
2 changes: 1 addition & 1 deletion Source/IGListBindable.h
Expand Up @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Tells the cell to configure itself with the given view model.
@param viewModel The view model for the cel.
@param viewModel The view model for the cell.
@note The view model can change many times throughout the lifetime of a cell as the model values change and the cell
is reused. Implementations should use only this method to do their configuration.
Expand Down
16 changes: 8 additions & 8 deletions Source/IGListCollectionContext.h
Expand Up @@ -102,7 +102,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns the section index of an section controller.
@param sectionController An section controller object.
@param sectionController A section controller object.
@return The section index of the controller if found, otherwise `NSNotFound`.
*/
Expand Down Expand Up @@ -156,10 +156,10 @@ NS_ASSUME_NONNULL_BEGIN
/**
Dequeues a supplementary view from the collection view reuse pool.
@param elementKind The kind of supplementary veiw.
@param elementKind The kind of supplementary view.
@param sectionController The section controller requesting this information.
@param viewClass The class of the supplementary view.
@param index The index of the supplementary vew.
@param index The index of the supplementary view.
@return A supplementary view dequeued from the reuse pool or a newly created one.
Expand All @@ -173,10 +173,10 @@ NS_ASSUME_NONNULL_BEGIN
/**
Dequeues a supplementary view from the collection view reuse pool.
@param elementKind The kind of supplementary veiw.
@param elementKind The kind of supplementary view.
@param identifier The identifier of the supplementary view in storyboard.
@param sectionController The section controller requesting this information.
@param index The index of the supplementary vew.
@param index The index of the supplementary view.
@return A supplementary view dequeued from the reuse pool or a newly created one.
*/
Expand All @@ -187,11 +187,11 @@ NS_ASSUME_NONNULL_BEGIN
/**
Dequeues a supplementary view from the collection view reuse pool.
@param elementKind The kind of supplementary veiw.
@param elementKind The kind of supplementary view.
@param sectionController The section controller requesting this information.
@param nibName The name of the nib file.
@param bundle The bundle in which to search for the nib file. If `nil`, this method searches the main bundle.
@param index The index of the supplementary vew.
@param index The index of the supplementary view.
@return A supplementary view dequeued from the reuse pool or a newly created one.
Expand All @@ -210,7 +210,7 @@ NS_ASSUME_NONNULL_BEGIN
@param completion An optional completion block to execute when the updates are finished.
@note This method can be wrapped in `UIView` animation APIs to control the duration or perform without animations. This
will end up calling `-[UICollectionView performBatchUpdates:completion:] internally, so invalidated changes may not be
will end up calling `-[UICollectionView performBatchUpdates:completion:]` internally, so invalidated changes may not be
reflected in the cells immediately.
*/
- (void)invalidateLayoutForSectionController:(IGListSectionController<IGListSectionType> *)sectionController
Expand Down
4 changes: 2 additions & 2 deletions Source/IGListCollectionView.h
Expand Up @@ -13,8 +13,8 @@

/**
This class is never actually used by the `IGListKit` infrastructure.
It exists only to give compiler errors when editing
methods are called on the collection view returned by `-[IGListAdapter collectionView]`.
It exists only to give compiler errors when editing methods are called on the collection view returned by
`-[IGListAdapter collectionView]`.
*/
IGLK_SUBCLASSING_RESTRICTED
@interface IGListCollectionView : UICollectionView
Expand Down
10 changes: 6 additions & 4 deletions Source/IGListCollectionViewLayout.h
Expand Up @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
Sections and items are put into the same horizontal row until the max-x position of an item extends beyond the width
of the collection view. When that happens, the item is "newlined" to the next row. The y position of that row is
deteremined by the maximum height (including section insets) of the section/item of the previous row.
determined by the maximum height (including section insets) of the section/item of the previous row.
Ex. of a section (2,0) with a large width causing a newline.
```
Expand Down Expand Up @@ -81,9 +81,11 @@ NS_ASSUME_NONNULL_BEGIN

/**
Create and return a new collection view layout.
@param stickyHeaders Set to `YES` to stick section headers to the top of the bounds while scrolling.
@param topContentInset The top content inset used to offset the sticky headers. Ignored if stickyHeaders is `NO`.
@param stretchToEdge Specifies whether to stretch width of last item to right edge when distance from last item to right edge < epsilon(1)
@param stickyHeaders Set to `YES` to stick section headers to the top of the bounds while scrolling.
@param topContentInset The top content inset used to offset the sticky headers. Ignored if stickyHeaders is `NO`.
@param stretchToEdge Specifies whether to stretch width of last item to right edge when distance from last item to right edge < epsilon(1)
@return A new collection view layout.
*/
- (instancetype)initWithStickyHeaders:(BOOL)stickyHeaders
Expand Down
2 changes: 1 addition & 1 deletion Source/IGListDisplayDelegate.h
Expand Up @@ -17,7 +17,7 @@
NS_ASSUME_NONNULL_BEGIN

/**
Implement this protocol to receive display events for an section controller when it is on screen.
Implement this protocol to receive display events for a section controller when it is on screen.
*/
@protocol IGListDisplayDelegate <NSObject>

Expand Down
2 changes: 1 addition & 1 deletion Source/IGListReloadDataUpdater.h
Expand Up @@ -14,7 +14,7 @@

/**
An `IGListReloadDataUpdater` is a concrete type that conforms to `IGListUpdatingDelegate`.
It is an out-of-box upater for `IGListAdapter` objects to use.
It is an out-of-box updater for `IGListAdapter` objects to use.
@note This updater performs simple, synchronous updates using `-[UICollectionView reloadData]`.
*/
Expand Down
2 changes: 1 addition & 1 deletion Source/IGListScrollDelegate.h
Expand Up @@ -15,7 +15,7 @@
@protocol IGListSectionType;

/**
Implement this protocol to receive display events for an section controller when it is on screen.
Implement this protocol to receive display events for a section controller when it is on screen.
*/
@protocol IGListScrollDelegate <NSObject>

Expand Down
2 changes: 1 addition & 1 deletion Source/IGListSectionType.h
Expand Up @@ -47,7 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
@return The size for the item at index.
@note The returned size is not garaunteed to be used. The implementation may query sections for their
@note The returned size is not guaranteed to be used. The implementation may query sections for their
layout information at will, or use its own layout metrics. For example, consider a dynamic-text sized list versus a fixed
height-and-width grid. The former will ask each section for a size, and the latter will likely not.
*/
Expand Down
7 changes: 4 additions & 3 deletions Source/IGListSingleSectionController.h
Expand Up @@ -30,7 +30,7 @@ typedef void (^IGListSingleSectionCellConfigureBlock)(id item, __kindof UICollec
@param item The model for the section.
@param collectionContext The collection context for the section.
@return The for the cell.
@return The size for the cell.
*/
typedef CGSize (^IGListSingleSectionCellSizeBlock)(id item, id<IGListCollectionContext> _Nullable collectionContext);

Expand All @@ -54,7 +54,8 @@ typedef CGSize (^IGListSingleSectionCellSizeBlock)(id item, id<IGListCollectionC

/**
This section controller is meant to make building simple, single-cell lists easier. By providing the type of cell, a block
to configure the cell, and a block to return the size of a cell, you can use an IGListAdapter-powered list simpler architecture.
to configure the cell, and a block to return the size of a cell, you can use an `IGListAdapter`-powered list with a
simpler architecture.
*/
IGLK_SUBCLASSING_RESTRICTED
@interface IGListSingleSectionController : IGListSectionController <IGListSectionType>
Expand All @@ -79,7 +80,7 @@ IGLK_SUBCLASSING_RESTRICTED
Creates a new section controller for a given nib name and bundle that will always have only one cell when present in a list.
@param nibName The name of the nib file for the single cell.
@param bundle The bundle in which to search for the nib file. If nil, this method looks for the file in the main bundle.
@param bundle The bundle in which to search for the nib file. If `nil`, this method looks for the file in the main bundle.
@param configureBlock A block that configures the cell with the item given to the section controller.
@param sizeBlock A block that returns the size for the cell given the collection context.
Expand Down
8 changes: 4 additions & 4 deletions Source/IGListStackedSectionController.h
Expand Up @@ -12,10 +12,10 @@
#import <IGListKit/IGListMacros.h>

/**
An instance of `IGListStackedSectionController` is a clustered section controller,
composed of many child section controllers. It constructs and routes item-level
indexes to the appropriate child section controller with a local index. This lets you build section controllers made up
of individual units that can be shared and reused with other section controllers.
An instance of `IGListStackedSectionController` is a clustered section controller, composed of many child section
controllers. It constructs and routes item-level indexes to the appropriate child section controller with a local
index. This lets you build section controllers made up of individual units that can be shared and reused with other
section controllers.
For example, you can create a "Comments" section controller that displays lists of text that is used alongside photo,
video, or slideshow section controllers. You then have four small and manageable section controllers instead of one
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/IGListSectionMap.h
Expand Up @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
The IGListSectionMap provides a way to map a collection of objects to a collection of section controllers and achieve
constant-time lookups O(1).
IGListSectionMap is a mutable object and does not garauntee thread safety.
IGListSectionMap is a mutable object and does not guarantee thread safety.
*/
IGLK_SUBCLASSING_RESTRICTED
@interface IGListSectionMap : NSObject <NSCopying>
Expand Down

0 comments on commit dabb0b0

Please sign in to comment.