如何在iPad上显示RPBroadcastActivityViewController。
RPBroadcastActivityViewController.load { [unowned self] (broadcastActivityViewController, error) in
// If an error has occurred, display an alert to the user.
if let error = error {
self.showAlert(message: error.localizedDescription)
return
}
// Present vc
if let broadcastActivityViewController = broadcastActivityViewController {
broadcastActivityViewController.delegate = self
// present
self.present(...
}
}
可以在iPhone上使用,但在iPad上什么都没有显示,应用程序有点冻结。我在应用程序商店查看了使用此功能的游戏,发现了同样的问题。
E、 游戏Tower Dash上的g当按下iPad上的实时流按钮时,没有显示任何内容,它只适用于iPhone。
我一直在尝试做波波福演讲,但似乎什么也做不到。
我错过了什么吗?
更新:这似乎是一个bug。即使在苹果自己的Swift Playground应用程序中,这种情况也会发生。
更新2:苹果公司实际上已经回复了我的错误报告,并告诉我需要像这样将iPad上的视图控制器作为popover呈现
UIDevice.current.userInterfaceIdiom == .pad {
broadcastAVC.popoverPresentationController?.sourceView = view
broadcastAVC.popoverPresentationController?.sourceRect = CGRect(x: view.bounds.midX, y: view.bounds.midY, width: 0, height: 0)
broadcastAVC.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.init(rawValue: 0) // no arrow
}
然而,它仍然对我不起作用。正如我提到的,苹果公司自己的Swift Playground应用程序中会出现这种情况,所以它一定是一个bug。
固定的:
我忘了在上面提到的代码中添加这一行
broadcastAVC.modalPresentationStyle = .popover