-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Value of type 'some View' has no member 'getNode' #32
Comments
Hi @CodeTropolis, You're right that But your examples are correct. Could you attach an SVG you're using? Probably a node you're trying to get is missing or it's an element which couldn't be tapped (for example, shape with stroke and without fill). |
Here's the SVG(Github attachment not working): https://pastebin.com/Eguxingd The SVG is a world map. Not concerned about CSS id or class properties except for the necessary props required for tap recognition on a region. Appreciate your help. |
I reproduced your issue. Tap works on some parts of "americas" for me, but "europe" and "asia" can't be tapped at all. Will take a look. |
I'm experiencing something similar.
|
That's because zone is not a path, it's a group containing several paths. You need to use something like this to change fill color: func setColor(_ node: SVGNode, color: SVGColor) {
if let group = node as? SVGGroup {
for content in group.contents {
setColor(content, color: color)
}
} else if let shape = node as? SVGShape {
shape.fill = color
}
}
...
setColor(zone, color: SVGColor.by(name: "orange")) |
Thank you Yuri! Appreciate your help. |
Nor does the following from your "Getting Started" recognize a tap:
What is the correct API to recognize a tap? Have you changed the API overall? If so, where's the documentation?
The text was updated successfully, but these errors were encountered: