-
Notifications
You must be signed in to change notification settings - Fork 560
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
Load an svg file and render it onto a UIView #72
Comments
Hi @KarimFikani! With latest master updates you can render SVG by using SVGView.
If you have any further questions, please don't hesitate to ask. |
Thank you @shipinev for your reply. Actually I meant if svg files can be loaded dynamically into a uiview through code and not by dragging and dropping it to a uiview. If yes, can you provide me with a code sample that does that? I looked at the examples repository that you have and couldn't find anything related to loading from files. Thanks. |
Yep, of course. You need to create programatically SVGView with needed frame and set fileName attribute which automatically calls rendering proccess of your SVG file: let svgView = SVGView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
svgView.fileName = "svgFileName" |
So I loaded the following svg file and got the following: The eyes are missing the black ellipse. |
it works thanks! |
Is it possible with Macaw to load an svg file and render it onto a UIView? Something similar to https://github.com/pocketsvg/PocketSVG
The text was updated successfully, but these errors were encountered: