// // FortuneWheelViewModel.swift // SodaLive // // Created by klaus on 2023/12/07. // import SwiftUI class FortuneWheelViewModel: ObservableObject { private var pendingRequestWorkItem: DispatchWorkItem? @Published var degree = 0.0 private let model: FortuneWheelModel init(model: FortuneWheelModel) { self.model = model } private func getWheelStopDegree() -> Double { var index = -1; if let method = model.getWheelItemIndex { index = method() } if index < 0 || index >= model.titles.count { index = Int.random(in: 0..