Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ios/RiveReactNativeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
}

func playIfNeeded() {
if let baseViewModel = baseViewModel, (baseViewModel.isPlaying == false) {

Check warning on line 144 in ios/RiveReactNativeView.swift

View workflow job for this annotation

GitHub Actions / lint-swift

`if`, `for`, `guard`, `switch`, `while`, and `catch` statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses (control_statement)
Task {
baseViewModel.play()
}
Expand All @@ -166,6 +166,7 @@
try handleInput(name: name, path: path, type: .number) { (input: RiveRuntime.RiveSMINumber) in
input.setValue(value)
}
playIfNeeded()
}

func getNumberInputValue(name: String, path: String?) throws -> Float {
Expand All @@ -178,6 +179,7 @@
try handleInput(name: name, path: path, type: .boolean) { (input: RiveRuntime.RiveSMIBool) in
input.setValue(value)
}
playIfNeeded()
}

func getBooleanInputValue(name: String, path: String?) throws -> Bool {
Expand All @@ -190,6 +192,7 @@
try handleInput(name: name, path: path, type: .trigger) { (input: RiveRuntime.RiveSMITrigger) in
input.fire()
}
playIfNeeded()
}

func setTextRunValue(name: String, value: String, path: String?) throws {
Expand Down
Loading