Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)setSelected:(bool)s {
- selected=s;
- if (s)
- {
- CATransform3D rot = CATransform3DMakeRotation(M_PI, 0, 1, 0);
- rot.m34=-1.0 / 200;
- [self setTransform:rot];
- }
- else
- {
- CATransform3D rot = CATransform3DMakeRotation(0, 0, 1, 0);
- rot.m34=-1.0 / 200;
- [self setTransform:rot];
- }
- }
- -(void)setSelected:(bool)s {
- selected=s;
- CATransform3D perpectiveTransform = CATransform3DIdentity;
- perpectiveTransform.m34 =-1.0 / 200;
- if (s)
- {
- CATransform3D rot = CATransform3DMakeRotation(M_PI, 0, 1, 0);
- [self setTransform:CATransform3DConcat(rot, perpectiveTransform)];
- }
- else
- {
- CATransform3D rot = CATransform3DMakeRotation(0, 0, 1, 0);
- [self setTransform:CATransform3DConcat(rot, perpectiveTransform)];
- }
- }
- self.superlayer.sublayerTransform = perspectiveTransform; //do this in your setup
- ....
- self.transform = rot;
- yourView.layer.transform = CATransform3DMakeScale(-1, 1, 1);
- yourView.layer.affineTransform = CGAffineTransformMakeScale(-1, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement