I play with UIbuttons, just to understand what really can be done with them. So far I have only one problem:
How to change the position of UIButton?
- (IBAction)buttonClicked:(id)sender { UIButton *senderB = sender; CGPoint position = senderB.frame.origin; CGSize size = senderB.frame.size; senderB.frame = CGRectMake(position.x,position.y + 10,size.width,size.height); }
The above works great, however, creating a new CGrect for every time I just want to change one seems inefficient to me.
Is there any way for me to directly set the values โโof senderB.frame.origin.x etc.
Georges Oates Larsen
source share