美文网首页iOS菜鸟食谱iOS-OC初级
presentViewController 透明跳转

presentViewController 透明跳转

作者: 秀才不才 | 来源:发表于2015-12-14 12:12 被阅读216次
  • (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^ __nullable)(void))completion

这个支持透明跳转,但是有版本限制

modalPresentationStyle
UIModalPresentationCurrentContext NS_ENUM_AVAILABLE_IOS(3_2),
UIModalPresentationOverCurrentContext NS_ENUM_AVAILABLE_IOS(8_0),

判断系统版本方法:

if (NSFoundationVersionNumber < NSFoundationVersionNumber_iOS_8_0) {
    self.modalPresentationStyle = UIModalPresentationCurrentContext;
} else {
    presentVC.modalPresentationStyle = UIModalPresentationOverCurrentContext;
}

好啦, 自定义 alert sheet 什么的也不在话下啦

相关文章

网友评论

    本文标题:presentViewController 透明跳转

    本文链接:https://www.haomeiwen.com/subject/qpluhttx.html