Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Example-iOS/Source/Examples/ViewModel/RiveButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ class RiveButton: RiveViewModel {
.frame(width: 100, height: 30)
}

func touchBegan(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
@objc func touchBegan(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
stop()
setInput(input, value: true)
}

func touchEnded(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
@objc func touchEnded(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
stop()
action?()
touchCancelled(onArtboard: artboard, atLocation: location)
}

func touchCancelled(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
@objc func touchCancelled(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
setInput(input, value: false)
}
}
4 changes: 2 additions & 2 deletions Example-iOS/Source/Examples/ViewModel/RiveSlider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class RiveSlider: RiveViewModel {
super.init(fileName: "riveslider", stateMachineName: "Slide", fit: .scaleDown)
}

func touchBegan(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
@objc func touchBegan(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
touchMoved(onArtboard: artboard, atLocation: location)
}

func touchMoved(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
@objc func touchMoved(onArtboard artboard: RiveArtboard?, atLocation location: CGPoint) {
progress = Double(location.x / riveView!.frame.width) * 100
}
}