modifier(ShareSheetModifer(shareSheetItems: 'Hello, world')) While this is already okay to use, I personally don’t like to write my modifiers in this way. This has something to do with FB messenger policy (lost link ref for this). Now, in this guide, I didn’t explicitly go over how to create posts for Twitter, but it’s as simple as switching SLServiceTypeFacebook to SLServiceTypeTwitter. Then to use it, add the modifier to your SwiftUI Element like the following with the items that you want to share. As far as my research went, you cannot share 'string' in FB messenger. Wrapping upĪs you can see, integrating social media sharing capability into your app has never been easier. If you need to perform an action when the user has finished their post (or cancelled the action), the completion closure is your opportunity to hook into that event and execute the code you need. SwiftUI has a fileExporter () modifier that lets us export files from our app to anywhere the user wants any folder in iCloud, or on their local device. The ShareLink view is designed to share any types of data. When users tap on the share link, it presents a share sheet for users to share content to other applications or copy the data for later use. Quaterly Results, 5:35PM Ind-Swift Laboratories wins ‘Asias best Company for the year 2022’ award, 2:58PM Ind-Swift Laboratories informs about loss of original share certificate, 12:41PM Ind-Swift Lab. In iOS 16, SwiftUI comes with a new view called ShareLink. Halcyon life Sciences, 10:29AM Ind-Swift Lab. Now, create a UITextView called messageTextView on the top of the screen that will contain our message and a button on the bottom of the screen that, when tapped, will show our share menu. Ind-Swift Laboratories gets nod to sell M/s. 1 func postToFacebookTapped ( sender : UIButton ) Getting Started First, open Xcode, and create a new project.
0 Comments
Leave a Reply. |