Value of type 'some View' has no member 'getNode'
@ystrot is already working on this.
Since Feb 16, 2023.
Assessment
This issue has not been assessed yet.
Description
if let filePath = Bundle.main.url(forResource: "zones", withExtension: "svg") {
ScrollView(.horizontal) {
let zoneMap = SVGView(contentsOf: filePath).frame(width: 1100, height: 550)
if let part = zoneMap.getNode(byId: "part") {
part.onTapGesture { // onTapGesture not available.
part.opacity = 0.2
}
}
}
}
Nor does the following from your "Getting Started" recognize a tap:
struct ZoneSelect: View {
let fileURL = Bundle.main.url(forResource: "zones", withExtension: "svg")!
var body: some View {
let root = SVGView(contentsOf: fileURL)// 1
let first = root.getNode(byId:"zone1")// 2
first?.onTapGesture{ // 3
(first as? SVGShape)?.fill = SVGColor.by(name: "red") // 4
print("Tapped!")
}
return root
}
}
What is the correct API to recognize a tap? Have you changed the API overall? If so, where's the documentation?
- Dominant language
- Swift
- Stars
- 853
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from exyte/SVGView
-
Make view resizable Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Support % sizes Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·