Created
February 7, 2016 20:06
-
-
Save bnookala/f0531b75fcc2280ceb8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface MyAmazingViewController () <> { | |
BOOL isInGrid; | |
} | |
@implementation MyAmazingViewController | |
- (void)myCommonFunction:(NSIndexPath *)cellPath { | |
if (isInGrid) { | |
UICollectionViewCell *myCell = [self collectionView:self.grid cellForItemAtIndexPath:cellPath]; | |
myCell.someProperty = YES; | |
} else { | |
UITableViewCell *myCell = [self tableView:self.table cellForRowAtIndexPath:cellPath]; | |
myCell.someProperty = YES; | |
} | |
}; | |
#pragma mark UICollectionViewDataSource | |
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)path { | |
[self myCommonFunction:path]; | |
} | |
@end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment