Skip to content

Commit

Permalink
Remove observable object
Browse files Browse the repository at this point in the history
  • Loading branch information
sheiladoherty-dolby committed Jul 24, 2024
1 parent c2b115f commit 3a55e35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
// SingleStreamView.swift
//

import SwiftUI
import RTSCore
import DolbyIOUIKit
import MillicastSDK
import RTSCore
import SwiftUI

struct SingleStreamView: View {

private enum Animation {
static let duration: CGFloat = 0.75
static let blendDuration: CGFloat = 3.0
static let offset: CGFloat = 200.0
}

private let isShowingDetailPresentation: Bool
private let onSelect: ((StreamSource) -> Void)
private let onSelect: (StreamSource) -> Void
private let onClose: (() -> Void)?
private var viewModel: SingleStreamViewModel

@State private var showingScreenControls = false
@State private var isShowingSettingsScreen: Bool = false
Expand All @@ -26,7 +26,6 @@ struct SingleStreamView: View {

@StateObject private var userInteractionViewModel: UserInteractionViewModel = .init()

@ObservedObject private var viewModel: SingleStreamViewModel
@ObservedObject private var themeManager = ThemeManager.shared

init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ import os
import RTSCore

@MainActor
final class SingleStreamViewModel: ObservableObject {
final class SingleStreamViewModel {
static let logger = Logger(
subsystem: Bundle.main.bundleIdentifier!,
category: String(describing: SingleStreamViewModel.self)
)

let sources: [StreamSource]
let selectedVideoSource: StreamSource
let selectedAudioSource: StreamSource?
let settingsMode: SettingsMode
let subscriptionManager: SubscriptionManager
let videoTracksManager: VideoTracksManager

lazy var statsInfoViewModel = StatsInfoViewModel(streamSource: selectedVideoSource,
videoTracksManager: videoTracksManager,
subscriptionManager: subscriptionManager)

init(
sources: [StreamSource],
selectedVideoSource: StreamSource,
Expand All @@ -40,7 +40,7 @@ final class SingleStreamViewModel: ObservableObject {
self.subscriptionManager = subscriptionManager
self.videoTracksManager = videoTracksManager
}

func streamSource(for id: UUID) -> StreamSource? {
sources.first { $0.id == id }
}
Expand Down

0 comments on commit 3a55e35

Please sign in to comment.