File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ The `ShareLinkButton` in SwiftUI allows developers to customize the sharing expe
9090``` swift
9191import UIKit
9292
93- // Step 1: Create a Custom UIActivityItemSource
9493class 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```
You can’t perform that action at this time.
0 commit comments