我正在尝试创建一个自定义视图控制器容器,它将在屏幕底部显示一个抽屉,如Apple邮件或音乐应用程序,我希望用户能够点击它以将其转换为全屏,或以交互方式向上滑动以显示内容.

我有抽屉工作,使用UIPanGestureRecognizer滑动它.我可以通过将内容控制器添加为子控制器,将内容视图添加到层次结构viewWillAppear:并viewDidAppear:在适当时调用来实现.
但我希望允许内容视图控制器在滑动旁边动画(例如,任何动画viewWillAppear:,如交互式弹出窗口),因此我正在看自定义模态演示文稿UIPercentDrivenInteractiveTransition,但我正在撞墙,我看不清楚为什么这种情况正在发生.我已经设置了转换委托,返回自定义动画控制器和作为UIPercentDrivenInteractiveTransition对象的交互控制器.
我的抽屉是容器控制器视图层次结构的一部分,当然我希望内容控制器的视图是抽屉的子视图.但是在调用时presentViewController:animated:completion:,UITransitionView会将新的子视图添加到UIWindow应该发生过渡动画的位置.但这会导致我死亡UIPanGestureRecognizer并且用户无法执行滑动以打开抽屉.
我尝试创建自定义UIPresentationController和其他方法来控制层次结构containerView中的位置,但我无法更改行为.
我试图以正确的方式做什么?我错过了什么?
如果有人有兴趣,这是我的框架:LNPopupController
我目前正在使用自定义屏幕的三分之一呈现视图控制器UIPresentationController.在我看来UIPresentationController,我presentedViewController在几个视图中包含圆角和阴影(就像在Apple的Custom Transitions示例应用程序中).我最近添加了一个UIVisualEffectView带有a UIBlurEffect的presentedViewController层次结构,但它显示很奇怪.视图现在是半透明的,但不模糊.
我认为这是因为模糊效果正确应用,但因为它是一个模态演示,它不会看到背后的视图,因此无法模糊它.有什么想法吗?这是相关的代码
override func presentationTransitionWillBegin()
// Wrap the presented view controller's view in an intermediate hierarchy
// that applies a shadow and rounded corners to the top-left and top-right
// edges. The final effect is built using three intermediate views.
//
// presentationWrapperView <- shadow
// |- presentationRoundedCornerView <- rounded corners (masksToBounds)
// |- presentedViewControllerWrapperView
// |- presentedViewControllerView (presentedViewController.view)
//
// SEE ALSO: The note in AAPLCustomPresentationSecondViewController.m. …Run Code Online (Sandbox Code Playgroud)