NSIndexPath+PSTCollectionViewAdditions.m 573 B

12345678910111213141516171819202122232425
  1. //
  2. // NSIndexPath+PSTCollectionViewAdditions.m
  3. // PSTCollectionView
  4. //
  5. // Copyright (c) 2013 Peter Steinberger. All rights reserved.
  6. //
  7. #import "NSIndexPath+PSTCollectionViewAdditions.h"
  8. #if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000
  9. @implementation NSIndexPath (PSTCollectionViewAdditions)
  10. // Simple NSIndexPath addition to allow using "item" instead of "row".
  11. + (NSIndexPath *)indexPathForItem:(NSInteger)item inSection:(NSInteger)section {
  12. return [NSIndexPath indexPathForRow:item inSection:section];
  13. }
  14. - (NSInteger)item {
  15. return self.row;
  16. }
  17. @end
  18. #endif