
画像を選択するときに、ピッカーから mainView (ぼかし領域) へのアニメーションが必要ですが、良いアイデアはありますか?
基本的な考え方:
- (CGRect)convertRect:(CGRect)rect fromView:(UIView *)view でいくつかの計算を行う必要があります。確かではありませんが、ピッカーは青い領域とは異なるウィンドウにある可能性があります。
CGRect destRect; // position in window, height/width need to be flipped, so the size is correct after rotation
// add a ContainerView so rotation-handling is easier, esp. durring moving/scaling
UIView *containerView = [[UIView alloc] initWithFrame:destRect];
// set the frame of the imageView, origin 0/0 so rotation is easy to handle, height/width flipp back
UIImageView *tempImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, destRect.size.height, destRect.size.width)];
// flip layer center as well
[tempImageView setCenter:CGPointMake(camView.center.y, camView.center.x)];
// add the rotation
[tempImageView setTransform:CGAffineTransformMakeRotation(M_PI_2)];
[tempImageView setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];