KSFacebookButton is a simple custom button which look exactly the same as FBSDKLoginButton. The problem with FBSDKLoginButton is that it do not allow any customization on the look and feel of the button. With KSFacebookButton you can change the title, width and height or even corner radius of the button easily.
- Xcode 8 or later
- iOS 8.0 or later
- Swift 3.0 or later
- Support XCode storybord
Clone / download and open KSFacebookButtonExample.xcworkspace to see KSFacebookButton in action.
Here are few examples:
pod 'KSFacebookButton'github "LeeKahSeng/KSFacebookButton"- After finish building the framework using Carthage, open XCode and select you project in the project navigator.
- At
Build Phasestab, addKSFacebookButton.frameworktoLink Binary with Libraries. - At
Generaltab, addKSFacebookButton.frameworktoEmbedded Binaries.
Note: If using Carthage for installation, IBDesignable and IBInspectable will not work due to a bug in XCode. Details information can be found here.
- Download the project.
- Drag the
Sourcesfolder in\KSFacebookButton\KSFacebookButtoninto your XCode project. - Build & run.
- Drag a UIButton to your view controller.
- Open Indentity Inspector and change button class to KSFacebookButton.
- Open Indentity Inspector and change button module to KSFacebookButton. (This step only required when install using CocoaPods or Carthage)
- Open Attribute Inspector and select "Custom" as button type.
- Change the button size, corner radius and title base on your needs using storyboard.
- Build & run.
Make sure you import KSFacebookButton if you are using CocoaPods or Carthage.
import KSFacebookButtonKSFacebookButton can be initialize and configure just like normal UIButton.
let facebookButton = KSFacebookButton(frame: CGRect(x: 20, y: 20, width: 200, height: 55))
facebookButton.cornerRadius = 3.0
facebookButton.setTitle("Login with Facebook", for: .normal)
facebookButton.addTarget(self, action: #selector(facebookButtonDidTapped(sender:)), for: .touchUpInside)
view.addSubview(facebookButton)This code is distributed under the terms and conditions of the MIT license.


