Skip to content

Commit 0be0619

Browse files
committed
Fix post-34
1 parent d9d1f76 commit 0be0619

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/en-gb/posts/post-34/Icons in SwiftUI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ If you ever read an svg file, you'll learn that they are just directions for dra
8383

8484
That's the [Lucide Icon for a smiley face](https://lucide.dev/icons/smile). While this is definitely not the most readable format, it's really just a set of instructions for drawing a path. Say, doesn't SwiftUI also have an API for drawing paths? Yes, it does! You can use the `Path` view to draw a path in SwiftUI. You can find [Apple's official tutorial here](https://developer.apple.com/tutorials/swiftui/drawing-paths-and-shapes). This API is much more human-readable than SVG, and it's also deeply tied into the animation system in SwiftUI. So if you want to create a custom icon, you can use the `Path` view to draw it.
8585

86-
If only there were a way to easily convert SVG paths into SwiftUI `Path` views, allowing for seamless integration of custom icons into your projects. Well apparently there is! Quassum made an incredibly helpful, simple web tool called [SVG to SwiftUI](https://quassum.com/svg-to-swiftui/) that allows you to convert SVG paths into SwiftUI `Path` views. You can simply paste the SVG path into the tool, and it will generate the SwiftUI code for you. So for example, we can go to Lucide, copy the SVG path for the smiley face icon, and paste it into the tool. The tool will generate the following SwiftUI code:
86+
If only there were a way to easily convert SVG paths into SwiftUI `Path` views, allowing for seamless integration of custom icons into your projects. Well apparently there is! Quassum made an incredibly helpful, simple web tool called [SVG to SwiftUI](https://svg-to-swiftui.quassum.com/) that allows you to convert SVG paths into SwiftUI `Path` views. You can simply paste the SVG path into the tool, and it will generate the SwiftUI code for you. So for example, we can go to Lucide, copy the SVG path for the smiley face icon, and paste it into the tool. The tool will generate the following SwiftUI code:
8787
```swift
8888
struct MyIcon: Shape {
8989
func path(in rect: CGRect) -> Path {

0 commit comments

Comments
 (0)