0

I'm setting up a UIBarButtonSystemItemRefresh, and want to rotate the refresh icon of the UIBarButtonSystemItemRefresh until refresh done. How can I achieve this?

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refresh)];

- (void)refresh {
    //start rotate the refresh icon animation
}

- (void)done {
    //stop rotate the refresh icon animation
}
RateRebriduo
  • 265
  • 3
  • 11

1 Answers1

0

You can't publicly access the icon of a UIBarButtonItem created with a system item.

You will need to create your own icon and image view then create the bar button item with initWithCustomView:. Then you can access the bar button item's customView property when needed and apply whatever animation you need to the image view.

rmaddy
  • 314,917
  • 42
  • 532
  • 579