miércoles 3 de junio de 2009

Scalling UIView and all its content

I have been looking for several days to find a way to scale an UIView and all its content, at the end the solution is simple:

self.transform = CGAffineTransformMakeScale(1.1, 1.1);
(been self the UIView)

it is so simple that is embarrassing :), a code snip of my example, when you push the view it gets bigger 10%:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
self.transform = CGAffineTransformMakeScale(1.1, 1.1);
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
self.transform = CGAffineTransformMakeScale(1, 1);
}