Skip to content

Commit

Permalink
feat: add openURL func.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 28, 2024
1 parent 3b0f2d8 commit b32a501
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ List {
})
}
}

Button("More Apps by Me") {
MyAppList.openURL(url: URL(string: MyAppList.appsByMe)!)
}
```

## License
Expand Down
5 changes: 5 additions & 0 deletions Sources/MyAppListKit/MyAppListKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public struct MyAppList {
}
#endif
}
public static func openURL(string: String) {
if let url = URL(string: string) {
openURL(url: url)
}
}

public static var appsByMe: String {
#if os(macOS)
Expand Down

0 comments on commit b32a501

Please sign in to comment.