私はあなたが説明したものと同様のことをしました。つまり、UINavigationController のビューのポップとプッシュのデフォルト アニメーションを変更しました。
オブジェクトのデフォルトのアニメーションを無効にして、独自のアニメーションに置き換えるという考え方です。UINavigationController の新しいカテゴリを作成し、以下のような関数を使用しました。
- (void) altAnimatePopViewControllerAnimated:(BOOL)animated
{
[CATransaction begin];
CATransition *transition;
transition = [CATransition animation];
transition.type = kCATransitionPush; // Use any animation type and subtype you like
transition.subtype = kCATransitionFromTop;
transition.duration = 0.3;
CATransition *fadeTrans = [CATransition animation];
fadeTrans.type = kCATransitionFade;
fadeTrans.duration = 0.3;
[CATransaction setValue:(id)kCFBooleanTrue
forKey:kCATransactionDisableActions];
[[[[self.view subviews] objectAtIndex:0] layer] addAnimation:transition forKey:nil];
[[[[self.view subviews] objectAtIndex:1] layer] addAnimation:fadeTrans forKey:nil];
[self popViewControllerAnimated:YES];
[CATransaction commit];
}
使用するにはコードを使用するだけです
[self.navigationController altAnimatePopViewControllerAnimated:YES];
プッシュを行うには、別の同様の関数を作成し、アニメーションを逆にします。
完璧ではありませんが、機能します。さまざまなアニメーション タイプを選択すると、ナビゲーション バー / コントローラーを構成するさまざまなサブビューで遊んで完璧になります。
これを思いつくのに私のかなりの白がかかったので、それを賢く使ってください:)
******* 編集
プッシュトランジションをこれに置き換えてみてください(自分では試していません):
CAKeyframeAnimation *scale = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
scale.duration = duration;
scale.values = [NSArray arrayWithObjects:[NSNumber numberWithFloat:.5f],
[NSNumber numberWithFloat:1.2f],
[NSNumber numberWithFloat:.85f],
[NSNumber numberWithFloat:1.f],
nil];
これによりポップインが行われます。つまり、適切なサイズに落ち着く前にビューが大きくなります。配列の値をいじって、アニメーションのカーブを制御します。