- LiveBroadcastVC.swift — Line 300 LiveBroadcastVC.handleDragContainerViewGesture(_
+300
- LiveBroadcastVC.swift — строка 268 LiveBroadcastVC.tabBarFirstView() + 268
- UIKitCore-[UIViewController ignoreViewControllerAnimated:completion:]
- спасибо за @escaping @callee_guaranteed @Sendable () -> ()
- TabbarVC.swift — строка 124 @objc TabbarVC.selectedIndex.setter + 124
- TabbarVC.selectedViewController.didset
- PlayerManager.swift — строка 289 PlayerManager.showPipView() + 289
- PipView.swift — строка 139 PlayerManager.updatePipViewUI() + 139
- PipView.swift — строка 210 PipView.addAvPlayer(_:adContainer:) + 210
Код: Выделить всё
Fatal Exception: UIViewControllerHierarchyInconsistency child view controller: should have parent view controller:(null) but actual parent is:
[*]Пользователь смотрит прямую трансляцию с воспроизводимой рекламой[*]Пользователь перетаскивает представление прямой трансляции, чтобы свернуть его в PipView.
[*]Приложение пытается перенести IMAAdViewController в новый контейнер.
Вот блоки кода, с которыми я столкнулся в последнем исключении Обратная трассировка (0);
Код: Выделить всё
func showPipView() {
guard let window = UIApplication.shared.keyUIWindow else { return }
if pipView == nil {
pipView = PipView(onTap: didTapPipView,
onPause: didTapPauseButton,
onClose: resetPlayerObjects)
window.addSubview(pipView!)
pipView?.translatesAutoresizingMaskIntoConstraints = false
pipViewBottomConstraint = pipView?
.bottomAnchor
.constraint(equalTo: window.bottomAnchor,
constant: pipViewBottomConstant)
pipViewBottomConstraint?.isActive = true
pipView?.updateBottomViewIsHidden(isAppearTabBar)
pipView?.widthAnchor.constraint(equalTo: window.widthAnchor).isActive = true
window.bringSubviewToFront(pipView!)
updatePipViewUI()
}
}
private func tabBarFirstView() {
guard let rootVC = UIApplication.shared.windows.first?.rootViewController else { return
}
var tabBarVC: UITabBarController?
if let navController = rootVC as? UINavigationController {
tabBarVC = navController.viewControllers.first(where: { $0 is UITabBarController }) as? UITabBarController
} else if let tabBar = rootVC as? UITabBarController {
tabBarVC = tabBar
}
guard let validTabBarVC = tabBarVC else { return }
dismiss(animated: true) {
validTabBarVC.selectedIndex = 0
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... roller-par