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 :/
Viewcontroller.m
FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];
loginButton.center = self.view.center;
[self.view addSubview:loginButton];
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];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With