Skip to content
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

Is it only by "id" #766

Open
allensoberano opened this issue Sep 12, 2021 · 0 comments
Open

Is it only by "id" #766

allensoberano opened this issue Sep 12, 2021 · 0 comments

Comments

@allensoberano
Copy link

allensoberano commented Sep 12, 2021

When referencing the element, I've only been able to do it by "id". Are you not able to reference the node by "class" as well? Whenever I try to reference by "class", the following code errors
let nodeShape = self.node.nodeBy(tag: nodeTag) as! Shape
because` it's always nil, but if an "id" is added to the class then it works just fine by id reference.

The problem is the SVG I will be receiving will not have "ids" for specific objects I need to color in the SVG.

Examples:
This works fine because it has an 'id'
<circle id="circle1" cx="145.461" cy="308.524" r="18.8" transform="rotate(180,145.461,308.524)" />
but something like this is always returning nil:
<path class="sectionA" style="fill:#ffffff;stroke:#e5e5e5" d="M 53.695242,337.52531 L 176.63156,337.52531 L 176.63156,83.836587 L 53.695242,83.836587 L 53.695242,337.52531 z" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant