- 界面截图:
- ViewController
// ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
// ViewController.m
#import "ViewController.h"
#import "LZViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIButton *btn;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
// 左翻转效果
- (IBAction)tapButton:(UIButton *)button {
LZViewController *vc = [[LZViewController alloc] init];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:nil];
}
@end
- LZViewController
// LZViewController.h
#import <UIKit/UIKit.h>
@interface LZViewController : UIViewController
@end
// LZViewController.m
#import "LZViewController.h"
@interface LZViewController ()
@end
@implementation LZViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
// 右翻转效果
- (IBAction)tapButton:(UIButton *)button {
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
-
效果图: