Skip to content

Commit dedc832

Browse files
authored
Update README.md
1 parent cb4d6a0 commit dedc832

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
A Swift Macro that helps mapping URLs to Enum cases.
77

8+
https://github.com/user-attachments/assets/07bb37fd-f82f-43eb-b34a-ec9bed7f29c8
9+
810
## Overview
911

1012
URL deep linking is a fundamental technology widely used in most services today. However, in Swift environments, implementing deep linking typically requires direct URL path manipulation or regex usage:
@@ -76,8 +78,8 @@ DeepLink(url: URL(string: "/posts/1/comments/2")!) == .postComment(postId: "1",
7678
DeepLink(url: URL(string: "/f/1/s/2")!) == .postComment(second: 2, first: 1)
7779

7880
// ❌ Invalid URLs
79-
DeepLink(url: URL(string: "/post/1")) == nil
80-
DeepLink(url: URL(string: "/posts/1/comments")) == nil
81+
DeepLink(url: URL(string: "/post/1")!) == nil
82+
DeepLink(url: URL(string: "/posts/1/comments")!) == nil
8183
DeepLink(url: URL(string: "/f/string/s/string")!) == nil
8284
```
8385
4. Use the `Enum.init(url: URL)` generated initializer.

0 commit comments

Comments
 (0)