Fix manage object context in tvOS info view controllers

This commit is contained in:
Arkadiusz Fal 2022-01-06 17:06:03 +01:00
parent e159bb772c
commit 792db567ed
2 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,8 @@ final class PlayerViewController: UIViewController {
var subscriptionsModel: SubscriptionsModel!
var playerView = AVPlayerViewController()
let persistenceController = PersistenceController.shared
#if !os(tvOS)
var aspectRatio: Double? {
let ratio = Double(playerView.videoBounds.width) / Double(playerView.videoBounds.height)
@ -95,6 +97,7 @@ final class PlayerViewController: UIViewController {
.environmentObject(commentsModel)
.environmentObject(playerModel)
.environmentObject(subscriptionsModel)
.environment(\.managedObjectContext, persistenceController.container.viewContext)
)
)

View File

@ -8,6 +8,7 @@ struct TVNavigationView: View {
@EnvironmentObject<RecentsModel> private var recents
@Default(.visibleSections) private var visibleSections
var body: some View {
TabView(selection: navigation.tabSelectionBinding) {
if visibleSections.contains(.favorites) {