What's the easiest way to determine the x,y location of a UIBarButtonItem in a UIToolbar?
The only answer I found is in any way to know where uibarbuttonitem has been drawn.
All proposed answers seem too complicated. There ought to be a simpler way to get the position of the damn UIBarButtonItem isn't there?
I used this which seems to be the most elegant way
- (CGRect)frameForBarButtonItem:(UIBarButtonItem *)buttonItem
{
UIView *view = [buttonItem valueForKey:@"view"];
return view ? view.frame : CGRectZero;
}