DDHDynamicViewControllerTransitions视图控制器过渡
使用UIDynamic行为的自定义视图控制器过渡。
用法:
创建一个实例,DDHNavigationControllerDelegate
并使其成为导航控制器的委托。
#import "DDHAppDelegate.h" #import "DDHFirstViewController.h" #import "DDHNavigationControllerDelegate.h" @interface DDHAppDelegate () @property (nonatomic, strong) DDHNavigationControllerDelegate *navigationControllerDelegate; @end @implementation DDHAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; DDHFirstViewController *firstViewController = [[DDHFirstViewController alloc] initWithNibName:@"DDHFirstViewController" bundle:nil]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController]; self.navigationControllerDelegate = [[DDHNavigationControllerDelegate alloc] initWithTransitionType:1]; navigationController.delegate = self.navigationControllerDelegate; self.window.rootViewController = navigationController; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; }
Snap
Gravity
Gravity + Rotation
评论