Skip to content

Commit

Permalink
♻️ (GEK): Rename SelectionViewViewModel to TouchToSelectViewViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Nov 14, 2023
1 parent 941a6d6 commit 349cf3c
Show file tree
Hide file tree
Showing 29 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ListenThenTouchToSelectView {

struct OneChoiceView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kAnswerSize: CGFloat = 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ListenThenTouchToSelectView {

struct TwoChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ListenThenTouchToSelectView {

struct ThreeChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ListenThenTouchToSelectView {

struct FourChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ListenThenTouchToSelectView {

struct FiveChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ListenThenTouchToSelectView {

struct SixChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public struct ListenThenTouchToSelectView: View {
case sixChoices
}

@StateObject private var viewModel: SelectionViewViewModel
@StateObject private var viewModel: TouchToSelectViewViewModel
@StateObject private var audioPlayer: AudioPlayer

public init(choices: [TouchToSelect.Choice], audioRecording: AudioRecordingModel) {
self._viewModel = StateObject(wrappedValue: SelectionViewViewModel(choices: choices))
self._viewModel = StateObject(wrappedValue: TouchToSelectViewViewModel(choices: choices))
self._audioPlayer = StateObject(wrappedValue: AudioPlayer(audioRecording: audioRecording))
}

Expand All @@ -35,7 +35,7 @@ public struct ListenThenTouchToSelectView: View {
}

self._viewModel = StateObject(
wrappedValue: SelectionViewViewModel(choices: payload.choices, shared: data))
wrappedValue: TouchToSelectViewViewModel(choices: payload.choices, shared: data))

let audioRecording = AudioRecordingModel(name: name, file: name)
self._audioPlayer = StateObject(wrappedValue: AudioPlayer(audioRecording: audioRecording))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ public struct ObserveThenTouchToSelectView: View {
case sixChoices
}

@StateObject private var viewModel: SelectionViewViewModel
@StateObject private var viewModel: TouchToSelectViewViewModel

@State private var imageWasTapped = false

private let image: String

public init(choices: [TouchToSelect.Choice], image: String) {
self._viewModel = StateObject(wrappedValue: SelectionViewViewModel(choices: choices))
self._viewModel = StateObject(wrappedValue: TouchToSelectViewViewModel(choices: choices))
self.image = image
}

Expand All @@ -38,7 +38,7 @@ public struct ObserveThenTouchToSelectView: View {
}

self._viewModel = StateObject(
wrappedValue: SelectionViewViewModel(choices: payload.choices, shared: data))
wrappedValue: TouchToSelectViewViewModel(choices: payload.choices, shared: data))

self.image = name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ObserveThenTouchToSelectView {

struct OneChoiceView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kAnswerSize: CGFloat = 180
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ObserveThenTouchToSelectView {

struct TwoChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ObserveThenTouchToSelectView {

struct ThreeChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ObserveThenTouchToSelectView {

struct FourChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ObserveThenTouchToSelectView {

struct FiveChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ObserveThenTouchToSelectView {

struct SixChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension RobotThenTouchToSelectView {

struct OneChoiceView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kAnswerSize: CGFloat = 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension RobotThenTouchToSelectView {

struct TwoChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension RobotThenTouchToSelectView {

struct ThreeChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension RobotThenTouchToSelectView {

struct FourChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension RobotThenTouchToSelectView {

struct FiveChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension RobotThenTouchToSelectView {

struct SixChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel
let isTappable: Bool

private let kHorizontalSpacing: CGFloat = 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ public struct RobotThenTouchToSelectView: View {
case sixChoices
}

@StateObject private var viewModel: SelectionViewViewModel
@StateObject private var viewModel: TouchToSelectViewViewModel
@State private var didSendCommandToRobot = false

private let actionType: Exercise.Action.ActionType

let robot = Robot.shared

public init(choices: [TouchToSelect.Choice]) {
self._viewModel = StateObject(wrappedValue: SelectionViewViewModel(choices: choices))
self._viewModel = StateObject(wrappedValue: TouchToSelectViewViewModel(choices: choices))

self.actionType = .color("red")
}
Expand All @@ -42,7 +42,7 @@ public struct RobotThenTouchToSelectView: View {
}

self._viewModel = StateObject(
wrappedValue: SelectionViewViewModel(choices: payload.choices, shared: data))
wrappedValue: TouchToSelectViewViewModel(choices: payload.choices, shared: data))

self.actionType = actionType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension TouchToSelectView {

struct OneChoiceView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel

private let kAnswerSize: CGFloat = 300

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension TouchToSelectView {

struct TwoChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel

private let kHorizontalSpacing: CGFloat = 150
private let kAnswerSize: CGFloat = 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension TouchToSelectView {

struct ThreeChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel

private let kHorizontalSpacing: CGFloat = 80
private let kAnswerSize: CGFloat = 280
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension TouchToSelectView {

struct FourChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel

private let kHorizontalSpacing: CGFloat = 200
private let kVerticalSpacing: CGFloat = 40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension TouchToSelectView {

struct FiveChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel

private let kHorizontalSpacing: CGFloat = 60
private let kVerticalSpacing: CGFloat = 40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension TouchToSelectView {

struct SixChoicesView: View {

@ObservedObject var viewModel: SelectionViewViewModel
@ObservedObject var viewModel: TouchToSelectViewViewModel

private let kHorizontalSpacing: CGFloat = 60
private let kVerticalSpacing: CGFloat = 40
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public struct TouchToSelectView: View {
case sixChoices
}

@StateObject private var viewModel: SelectionViewViewModel
@StateObject private var viewModel: TouchToSelectViewViewModel

public init(choices: [TouchToSelect.Choice], shuffle: Bool = false) {
self._viewModel = StateObject(wrappedValue: SelectionViewViewModel(choices: choices, shuffle: shuffle))
self._viewModel = StateObject(wrappedValue: TouchToSelectViewViewModel(choices: choices, shuffle: shuffle))
}

public init(exercise: Exercise, data: ExerciseSharedData? = nil) {
Expand All @@ -29,7 +29,7 @@ public struct TouchToSelectView: View {
}

self._viewModel = StateObject(
wrappedValue: SelectionViewViewModel(
wrappedValue: TouchToSelectViewViewModel(
choices: payload.choices, shuffle: payload.shuffleChoices, shared: data))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Combine
import ContentKit
import SwiftUI

class SelectionViewViewModel: ObservableObject {
class TouchToSelectViewViewModel: ObservableObject {

@Published var choices: [GameplaySelectionChoiceModel] = []
@ObservedObject var exercicesSharedData: ExerciseSharedData
Expand Down

0 comments on commit 349cf3c

Please sign in to comment.