About SLComposeViewController in iOS 13, Xcode 11 GM
SLComposeViewController has been deprecated since iOS 11. You can either use Social Media's SDK or UIActivityViewController.
Please see this answer
Swift - SLComposeViewController automatically dismissing itself
This is working and for SLServiceTypeFacebook too but need to dismiss one to present the other. I am still working that out.
if let vc = SLComposeViewController(forServiceType: SLServiceTypeTwitter) {
//SLServiceTypeFacebook
//SLServiceTypeTwitter
vc.setInitialText(self.writeDBString)
//vc.add(UIImage(named: "myImage.jpg")!)
vc.add(URL(string: "https://itunes.apple.com/us/app"))
present(vc, animated: true )
}
Share on Facebook IOS 11 Swift
You can use the facebook sdk to share content
Like
Step 1:
install pod :- pod 'FacebookShare'
Step 2:
import FBSDKShareKit
Step 3:
func shareTextOnFaceBook() {
let shareContent = ShareLinkContent()
shareContent.contentURL = URL.init(string: "https://developers.facebook.com")! //your link
shareContent.quote = "Text to be shared"
ShareDialog(fromViewController: self, content: shareContent, delegate: self).show()
}
func sharer(_ sharer: Sharing, didCompleteWithResults results: [String : Any]) {
if sharer.shareContent.pageID != nil {
print("Share: Success")
}
}
func sharer(_ sharer: Sharing, didFailWithError error: Error) {
print("Share: Fail")
}
func sharerDidCancel(_ sharer: Sharing) {
print("Share: Cancel")
}
Step 4: Must add this in
Info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbauth2</string>
</array>
Related Topics
Uiview Drawrect: Draw the Inverted Pixels, Make a Hole, a Window, Negative Space
Searching Through Child Values Firebase/Swift
Fbsopenapplicationerrordomain Code=3
Auto-Implement Swift Protocol Methods in Xcode
iOS Google Sdk Map Cannot Create Dotted Polylines
Map Url Parameters to Objects Using Restkit
Why Is -Force_Load No Longer Required for My Three20 Dependencies in Xcode 4.2
Facebook Sdk - iOS - Fail to Share Url (Error 102)
Removing iPad Support from App
How to Detect When User Used Password Autofill on a Uitextfield
Page Based "Reloadrootcontrollerswithnames:" on Launch Loop
Fbsdkaccesstoken Currentaccesstoken Is Not Being Updated After Log In
Create Directory in App Group Container Swift
Sprite Kit Set Min. and Max. for Jump
Adding Views. Storyboard VS. Programmatically
Cannot Get My Location to Show Up in Google Maps in iOS 8
Expired Access Token After Openactivesession for Facebook iOS Sdk
Why Self.Locationmanager Stopupdatinglocation Doesn't Stop Location Update