やっとでた?
デモは3つ
ロック画面でお馴染みのやつ
UIInterplatingMotionEffectというクラスを使っていてたったこれだけ。
UIInterpolatingMotionEffect *xAxis = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
xAxis.minimumRelativeValue = @(25.0);
xAxis.maximumRelativeValue = @(-25.0);
UIInterpolatingMotionEffect *yAxis = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
yAxis.minimumRelativeValue = @(32.0);
yAxis.maximumRelativeValue = @(-32.0);
self.backgroundMotionEffect = [[UIMotionEffectGroup alloc] init];
self.backgroundMotionEffect.motionEffects = @[xAxis, yAxis];
[self.backgroundView addMotionEffect:self.backgroundMotionEffect];ほお。2番めは手前のウィンドウがBlurな場合。このBlurなビューはあらかじめ用意された画像。磨りガラス状の半透明なビューにも背景のParallxing効果がちゃんと反映されている。
UIInterpolatingMotionEffectのリファレンス


