Friday, 22 January 2016

How to remove specify UILabel subview from UIButton?


//[UIButton addSubview:UILabel];

for(int i = 0 ; i < button.subviews.count ; i++)
{
   UIView *v = [button.subviews objectAtIndex:i];
   if([v isMemberOfClass:[UILabel class]])
   {
      [v removeFromSuperview];
      i--;
   }
}

No comments:

Post a Comment