Skip to content

Commit b53635d

Browse files
committed
Update README.md
1 parent a7d9961 commit b53635d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ The `ShareLinkButton` in SwiftUI allows developers to customize the sharing expe
9090
```swift
9191
import UIKit
9292

93-
// Step 1: Create a Custom UIActivityItemSource
9493
class CustomItemSource: NSObject, UIActivityItemSource {
9594
let text: String
9695
let url: URL
@@ -121,15 +120,16 @@ class CustomItemSource: NSObject, UIActivityItemSource {
121120
}
122121
}
123122
```
123+
124+
2. **Use the custom activity item source in ShareLinkButton**
125+
124126
```swift
125-
// Step 2: Create an instance of the custom activity item source
126-
let source = CustomItemSource(
127-
text: "Check out this amazing website!",
128-
url: URL(string: "https://www.example.com")!
129-
)
130-
131-
// Step 3: Use the custom activity item source in ShareLink
132-
ShareLink(item: source) {
127+
let source = CustomItemSource(
128+
text: "Check out this amazing website!",
129+
url: URL(string: "https://www.example.com")!
130+
)
131+
132+
ShareLinkButton(item: source) {
133133
Label("Share", systemImage: "square.and.arrow.up")
134134
}
135135
```

0 commit comments

Comments
 (0)