Brittany Brittany - 9 months ago 96
iOS Question

Custom Facebook Login button iOS

I've just integrated the Facebook iOS SDK with my app, and the login works great. That said, the SDK doesnt seem to give me the option to customize my login button (it provides me with that ugly default button in the middle of the screen). I'm using Storyboards with my app - how can I go about hooking up my own button to their provided code? I've seen some older answers posted to Stack, but the FB documentation has since changed :/


FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init]; =;
[self.view addSubview:loginButton];

Answer Source

Make you own custom button in the storyboard. Hook up the action to myButtonPressed.

- (void)viewDidLoad {
    [super viewDidLoad];
    self.loginButton = [[FBSDKLoginButton alloc] init];
    self.loginButton.hidden = YES;

- (void)myButtonPressed {
    [self.loginButton sendActionsForControlEvents: UIControlEventTouchUpInside];