iOS - UIModalPresentationFormSheet 用于 iPhone
Charleene 是将 UIModalPresentationFormSheet(在 iPad 上作为系统 API 功能所知)移植到 iPhone 的简单、现代和轻量级解决方案。
Charleene 可以接收任何 UIViewController 作为父 UIViewController 并以模态方式展示它。
当 Charleene 在 iPad 上使用时,它会调用 iOS 系统 API 的 UIModalPresentationFormSheet。
要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 pod install
。
在实现文件中将相应的类别包含在 UIViewController 中
#import "UIViewController+Charleene.h"
用法很简单
从 Storyboard
ViewControllerOfYourChoice *vc = [[UIStoryboard storyboardWithName:@“Main” bundle:nil] instantiateViewControllerWithIdentifier:@“ViewControllerOfYourChoice”];
[self presentCharleeneModally:vc transitionMode:KSModalTransitionModeFromBottom];
从代码
ViewControllerOfYourChoice *vc = [[ViewControllerOfYourChoice alloc] init];
[self presentCharleeneModally:vc transitionMode:KSModalTransitionModeFromBottom];
消失很简单,只需在任何 UIViewController 上调用以下方法即可
[self dismissCharleeneAnimated:YES completion:nil];
iOS7.x / iOS 8.x
Charleene 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "Charleene"
Kersten Broich,[email protected]
Charleene 在 MIT 许可证下提供。有关更多信息,请参阅 LICENSE 文件。