O'Reilly logo

iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK by Joe Keeley, Kyle Richter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required