Skip to content

Commit 2fc1b39

Browse files
committed
Add new OpenURLAction extensions
1 parent dcb7b32 commit 2fc1b39

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

RELEASE_NOTES.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ These release notes cover the current major version. See older versions for olde
1313

1414
## 6.2
1515

16-
This version adds a `ListActionButton` and `ListActionButtonGroup`.
1716

18-
The old `ListButtonGroup` view has been deprecated.
17+
### ✨ Features
18+
19+
* `ListActionButton` and `ListActionButtonGroup` are two new list views.
20+
* `OpenURLAction` has new optional extensions.
21+
22+
### 🗑️ Deprecations
23+
24+
* `ListButtonGroup` has been deprecated.
1925

2026

2127

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// OpenURLAction+Optional.swift
3+
// SwiftUIKit
4+
//
5+
// Created by Daniel Saidi on 2026-05-26.
6+
// Copyright © 2026 Daniel Saidi. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
public extension OpenURLAction {
12+
13+
func tryOpen(_ url: URL?) {
14+
guard let url else { return }
15+
callAsFunction(url)
16+
}
17+
18+
func tryOpen(_ urlString: String?) {
19+
guard let urlString else { return }
20+
guard let url = URL(string: urlString) else { return }
21+
tryOpen(url)
22+
}
23+
}

0 commit comments

Comments
 (0)