ios9 - how to share content on facebook, twitter and instagram using SLComposeViewController swift -


i want share content , images on social media using slcomposeviewcontroller in swift. have done in objc new in swift development.please suggest me if there common class or library share content on social media in swift.

there no need of library. need is:

1) import social framework.

2) code post on facebook

let vc = slcomposeviewcontroller(forservicetype: slservicetypefacebook) vc.setinitialtext("picture text") vc.addimage(detailimageview.image!) vc.addurl(nsurl(string: "http://anyurl.com")) presentviewcontroller(vc, animated: true, completion: nil) 

3) code post on twitter

let vc = slcomposeviewcontroller(forservicetype: slservicetypetwitter) vc.setinitialtext("picture text") vc.addimage(detailimageview.image!) vc.addurl(nsurl(string: "http://anyurl.com")) presentviewcontroller(vc, animated: true, completion: nil) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -