forum

Home / DeveloperSection / Forums / How to set Activity Indicator in UITableView in Objective-C?

How to set Activity Indicator in UITableView in Objective-C?

Anonymous User 2448 23-Apr-2016
I want to display activity indicator for the initial load time for each collection view cell. So I tried to place it in the table view delegate method cellForItemAtIndexPath: and created 25 pixels above the cell for some reason.
Below is my code:
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    let cell = self.collectionView.dequeueReusableCellWithReuseIdentifier("AACollectionViewCell", forIndexPath: indexPath) as! AACollectionViewCell
    let activityView = UIActivityIndicatorView (activityIndicatorStyle: .Blue)
    activityView.center = cell.myImage.center

    activityView.center = cell.contentView.center
    activityView.startAnimating()

    return cell
}
Now, Please tell me the proper way to handle the activity indicator or what the wrong in my code..!
Thank you.

Updated on 25-Apr-2016
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By