Displaying Assets
Asset Navigator will display the assets in a group in a UITableView
, similar to the way that Apple’s Photos app does with four images per row. To do this, determine how many rows are needed.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ NSInteger returnCount = 0; if (assetArray && ([assetArray count] > 0)) { if ([assetArray count] % 4 == 0) { returnCount = ([assetArray count] / 4); } else { returnCount = ([assetArray count] / 4) + 1; } } return returnCount;}
If the number of assets in the group is evenly divisible by four, divide the number of assets by four. Otherwise, divide ...
Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.