diff --git a/README.md b/README.md index ab598b8..0150b5b 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ List { }) } } + +Button("More Apps by Me") { + MyAppList.openURL(url: URL(string: MyAppList.appsByMe)!) +} ``` ## License diff --git a/Sources/MyAppListKit/MyAppListKit.swift b/Sources/MyAppListKit/MyAppListKit.swift index e2c786e..2eb1875 100644 --- a/Sources/MyAppListKit/MyAppListKit.swift +++ b/Sources/MyAppListKit/MyAppListKit.swift @@ -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)