BTTransition
预览
示例
要运行示例项目,请克隆仓库,然后在 Example 目录中首先运行 pod install
。
要求
安装
BTTransition 可以通过 CocoaPods 获取。要安装它,只需将以下行添加到您的 Podfile:
pod 'BTTransition'
简单使用
@implementation BTPresentViewController
- (instancetype)init{
UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
self = [storyboard instantiateViewControllerWithIdentifier:@"BTPresentViewController"];;
if (self) {
_aniamtion = [[BTCoverVerticalTransition alloc]initPresentViewController:self withRragDismissEnabal:YES];
self.transitioningDelegate = _aniamtion;
}
return self;
}
...
@end
或
@implementation BTPresentViewController
- (instancetype)init{
[super init];
if (self) {
_aniamtion = [[BTCoverVerticalTransition alloc]initPresentViewController:self withRragDismissEnabal:YES];
self.transitioningDelegate = _aniamtion;
}
return self;
}
...
@end
如何呈现
@implementation
- (void)viewDidLoad {
[super viewDidLoad];
...
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
BTPresentViewController * vc = [[BTPresentViewController alloc]init];;
[self presentViewController:vc animated:YES completion:nil];
}
...
@end
作者
biostome, [email protected]
许可证
BTTransition 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。