Show a mark at the touched point on the View of SwiftUI
TouchTracker
Show a mark at the touched point on the View of SwiftUI.
Demo
Document
Set the following for a View of SwiftUI.
Text("Hello")
.touchTrack()
Alternatively, it can also be written as follows
TouchTrackingView {
Text("Hello")
}
Customize
Text("Hello")
.touchTrack() // show touch point
.touchPointRadius(8) // radius of mark on touched point
.touchPointColor(.orange) // color of mark on touched point
.touchPointBorder(true, color: .blue, width: 1) // applying a border to touched points
.touchPointShadow(true, color: .purple, radius: 3) // shadow on touched points
.showLocationLabel(true) // show touch coordinate
It is also possible to display images as follow
Text("Hello")
.touchPointImage(Image(systemName: "swift").resizable())