Reputation: 11
I am currently following this Topic: Social Framework iOS 8 swift and I have successfully finished it.
Here is my complete code in Swift:
import Social
and
@IBAction func shareFB(sender : AnyObject) {
if(SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook))
{
var SocialMedia :SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
SocialMedia.completionHandler = {
result -> Void in
var getResult = result as SLComposeViewControllerResult;
switch(getResult.toRaw()) {
case SLComposeViewControllerResult.Cancelled.toRaw(): println("Cancelled")
case SLComposeViewControllerResult.Done.toRaw(): println("It's Work!")
default: println("Error!")
}
self.dismissViewControllerAnimated(true, completion: nil)
}
self.presentViewController(SocialMedia, animated: true, completion: nil)
SocialMedia.setInitialText("Test a Post on Facebook")
}
}
If I want to attach or upload a video file to Publish on Facebook by Social Framework, how or not possible? if not What should I do? Thanks in advance for the answers.
Upvotes: 1
Views: 1018
Reputation: 335
You can only add text, urls and image.
Look on the Compose Post Section here for more information.
What you will have to share is the video url.
Upvotes: 0