Go to file
Antoni Silvestrovic d477f65cc9
Disabled GA
2023-05-22 20:55:22 +03:00
.changeset chore: update versions (#24) 2022-08-05 08:57:48 +03:00
.github Updated static folder path 2023-05-22 19:09:40 +03:00
apps/nextjs Disabled GA 2023-05-22 20:55:22 +03:00
content Fixed content issues 2022-08-04 18:43:09 +03:00
packages Next.js 13 App (#32) 2023-05-22 19:00:36 +03:00
.eslintrc.js Monorepo (#15) 2022-08-04 18:37:46 +03:00
.gitignore Fixed stuff 2022-08-04 19:33:06 +03:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2020-11-14 10:52:33 +02:00
LICENSE Create LICENSE 2022-10-21 21:06:50 +03:00
README.md Updated base url references for new domain 2022-12-31 12:59:06 +02:00
package.json Version update 2023-05-22 20:33:53 +03:00
pnpm-lock.yaml Added dependency 2023-05-22 20:52:05 +03:00
pnpm-workspace.yaml Monorepo (#15) 2022-08-04 18:37:46 +03:00
turbo.json Monorepo (#15) 2022-08-04 18:37:46 +03:00

README.md

SVG to SwiftUI Converter

Tool to convert SVG to SwiftUI's Shape structure. This approach is much more memory efficient than introducing a SVG library for rendering.

"Buy Me A Coffee"

Disclaimer (Before you use this tool)

This tool is oriented towards specific implementations where you might otherwise need to convert the icon into SwiftUI Shape manually, for example when you need a custom animatable icon, need to use SFSymbol in your macOS app, etc. For general purpose icons it might be better to use this guide to create an SF Symbol instead.

Usage

Step 1

Star this repository!

Online

The tool is available online, just follow this link.

Running locally

git clone https://github.com/quassum/SVG-to-SwiftUI
cd SVG-to-SwiftUI
yarn
yarn dev

Functionality Coverage

This repository is just a front-end wrapper over our svg-to-swiftui-core (npm link) package. You can find the functionality coverage on that package's page. We encourage you checking it out and maybe starring it on GitHub 😍!

Example usage

To demonstrate this tool I created a thicc plus sign with rounded corners (created it in Sketch, so shapes from Sketch should work fine with this tool). It's saved as content/demo-plus.svg file in this repository. You can see below how it looks like in the browser, and how it looks like after converting into SwiftUI Shape.

In the browser

SVG file wiewed in the browser

In SwiftUI View, exported as a Shape

SVG file wiewed in the browser

Contributing

  • Feel free to open an issue for the SVG code that did not work - provide the SVG code of course!
  • Pull requests are very welcome! Introducing support for more SVG element types would be the best contribution at this point.

Author

Antoni Silvestrovic

License

MIT