Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Improves the delegate methods naming convention.

  • Loading branch information...
commit 79a14e4f2ed9c29586ec2ad01d7fd15083762532 1 parent 8eb9981
@lxcid authored
View
2  LXRCVFL Example using Storyboard/LXRCVFL Example using Storyboard/LXCollectionViewController.m
@@ -110,7 +110,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)theCollectionView c
#pragma mark - LXReorderableCollectionViewDelegateFlowLayout methods
-- (void)itemAtIndexPath:(NSIndexPath *)theFromIndexPath willMoveToIndexPath:(NSIndexPath *)theToIndexPath {
+- (void)collectionView:(UICollectionView *)theCollectionView layout:(UICollectionViewLayout *)theLayout itemAtIndexPath:(NSIndexPath *)theFromIndexPath willMoveToIndexPath:(NSIndexPath *)theToIndexPath {
id theFromItem = [self.deck objectAtIndex:theFromIndexPath.item];
[self.deck removeObjectAtIndex:theFromIndexPath.item];
[self.deck insertObject:theFromItem atIndex:theToIndexPath.item];
View
4 LXRCVFL Example using Storyboard/LXRCVFL Example using Storyboard/en.lproj/MainStoryboard.storyboard
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2840" systemVersion="11E53" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="wfC-9f-vtC">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2843" systemVersion="11E53" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="wfC-9f-vtC">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1926"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1929"/>
</dependencies>
<scenes>
<!--Collection View Controller-->
View
2  LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.h
@@ -27,6 +27,6 @@
@protocol LXReorderableCollectionViewDelegateFlowLayout <UICollectionViewDelegateFlowLayout>
-- (void)itemAtIndexPath:(NSIndexPath *)theFromIndexPath willMoveToIndexPath:(NSIndexPath *)theToIndexPath;
+- (void)collectionView:(UICollectionView *)theCollectionView layout:(UICollectionViewLayout *)theLayout itemAtIndexPath:(NSIndexPath *)theFromIndexPath willMoveToIndexPath:(NSIndexPath *)theToIndexPath;
@end
View
2  LXReorderableCollectionViewFlowLayout/LXReorderableCollectionViewFlowLayout.m
@@ -64,7 +64,7 @@ - (void)invalidateLayoutIfNecessary {
self.selectedItemIndexPath = theIndexPathOfSelectedItem;
if ([self.collectionView.delegate conformsToProtocol:@protocol(LXReorderableCollectionViewDelegateFlowLayout)]) {
id<LXReorderableCollectionViewDelegateFlowLayout> theDelegate = (id<LXReorderableCollectionViewDelegateFlowLayout>)self.collectionView.delegate;
- [theDelegate itemAtIndexPath:thePreviousSelectedIndexPath willMoveToIndexPath:theIndexPathOfSelectedItem];
+ [theDelegate collectionView:self.collectionView layout:self itemAtIndexPath:thePreviousSelectedIndexPath willMoveToIndexPath:theIndexPathOfSelectedItem];
}
[self.collectionView performBatchUpdates:^{
//[self.collectionView moveItemAtIndexPath:thePreviousSelectedIndexPath toIndexPath:theIndexPathOfSelectedItem];
Please sign in to comment.
Something went wrong with that request. Please try again.