SwiftSVG
SwiftSVG copied to clipboard
Is this project still maintained?
Hey there @mchoe ! Seems like you have a real solid project here, I wonder if you're still maintaining it though? I'm looking for options for somewhat of a polyfill project to process SVGs until we can support iOS 13 fully.
You have relatively recent code (5 months ago), but your last release is way older than that .
Would appreciate your response.
Thanks! Shai.
Hi @freak4pc, thanks for the message! I admit that I've fallen a bit behind on maintaining this. I actually had some plans to swap out the rendering with something more robust, but with the recent announcements of native SVG support, things are a bit in the air.
I know that that support starts with iOS 13, so maybe I can try and help you in the meantime. Do you have an example SVG I can take a look at and I can get back to you?
To be totally honest, I haven't tested the framework yet. I wanted to know if there's anyone looking into the code or is it entirely unmaintained.
I'll run some tests with our assets and see how it looks :) Thanks!
@mchoe
I tried some basic assets and the main issue I'm seeing is that the frame of the SVG isn't always respected. For example this has a bounding box of 24x24 in the SVG itself, but leaks out of that area if I use a UIImageView
of that size:
Here's the SVG. Maybe you'll spot something we're doing wrong:
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>545DB722-F3FC-4742-9238-9837CA0EE22B</title>
<g id="Iconography" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(-180.000000, -837.000000)" fill="#273238" id="Group-6">
<g transform="translate(100.000000, 229.000000)">
<g id="Group-10" transform="translate(32.000000, 32.000000)">
<g transform="translate(0.000000, 48.000000)">
<g id="Operation-/-Arrows-/-Boxed-/-Arrow-Down-Boxed" transform="translate(48.000000, 528.000000)">
<path d="M15,3 C18.3137085,3 21,5.6862915 21,9 L21,15 C21,18.3137085 18.3137085,21 15,21 L9,21 C5.6862915,21 3,18.3137085 3,15 L3,9 C3,5.6862915 5.6862915,3 9,3 L15,3 Z M12,7 C11.4871642,7 11.0644928,7.38604019 11.0067277,7.88337887 L11,8 L11,13.585 L9.70710678,12.2928932 L9.61289944,12.2097046 C9.22060824,11.9046797 8.65337718,11.9324093 8.29289322,12.2928932 C7.93240926,12.6533772 7.90467972,13.2206082 8.20970461,13.6128994 L8.29289322,13.7071068 L11.2928932,16.7071068 L11.336853,16.7485042 L11.336853,16.7485042 L11.4046934,16.8036654 L11.4046934,16.8036654 L11.5159379,16.8753288 L11.5159379,16.8753288 L11.628664,16.9287745 L11.628664,16.9287745 L11.734007,16.9641549 L11.734007,16.9641549 L11.8833789,16.9932723 L12,17 L12.1174626,16.9931674 L12.1174626,16.9931674 L12.2335141,16.9725773 L12.2335141,16.9725773 L12.3416665,16.9401054 L12.3416665,16.9401054 L12.4232215,16.9063266 L12.4232215,16.9063266 L12.5207088,16.8540045 L12.5207088,16.8540045 L12.6128994,16.7902954 L12.7071068,16.7071068 L12.7071068,16.7071068 L15.7071068,13.7071068 L15.7902954,13.6128994 C16.0699015,13.2532992 16.0699015,12.7467008 15.7902954,12.3871006 L15.7071068,12.2928932 L15.6128994,12.2097046 C15.2532992,11.9300985 14.7467008,11.9300985 14.3871006,12.2097046 L14.2928932,12.2928932 L13,13.585 L13,8 L12.9932723,7.88337887 C12.9355072,7.38604019 12.5128358,7 12,7 Z" id="Shape"></path>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
As far as I understand, "SVG support" in iOS means that one can use SVG assets -- but they are still converted to an internal format at build time and there is no SVG runtime support at all (and not planned as far as I am aware?). So a SVG library will be important for the time being for displaying dynamically created or downloaded SVG content.
For today, there is no SVG support via code, I think work should be continued