Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Share, Login Button for Facebook SDK iOS

Im sharing image to Facebook to using Facebook SDK. problem is i dont know how to change those buttons to custom buttons. ex: if i trigger button then it shares with facebook.

here my code. this is the one Facebook give as default

let button : FBSDKShareButton = FBSDKShareButton()
        button.shareContent = content

        self.view.addSubview(button) // how can i trigger with my button
        button.center = self.view.center // i dont want this in center either
like image 581
Im Batman Avatar asked Aug 01 '15 17:08

Im Batman


1 Answers

I found a way of doing this. just need to hide the button that FBSDK gives and insert following code in action button

button.sendActionsForControlEvents(.TouchUpInside)

it will Programmatically fire the SDK button if we click that UIButton

like image 185
Im Batman Avatar answered Sep 28 '22 11:09

Im Batman