KSFacebookButton 1.0.4

KSFacebookButton 1.0.4

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Lee Kah Seng.


Downloads

Total6
Week3
Month6

Installs

Apps2
Apps WeekApps This Week 2
powered by Segment

GitHub

Stars1
Watchers1
Forks1
Issues0
Contributors1
Pull Requests0

Code

Files1
LOCLines of Code 43


  • By
  • Lee Kah Seng

KSFacebookButton

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.

Requirements

  • Xcode 8 or later
  • iOS 8.0 or later
  • Swift 3.0 or later

Features

  • Support XCode storybord

Example

Clone / download and run the KSFacebookButtonExample project to see KSFacebookButton in action. Here are few examples:

Installation

Manually

How to use

Storyboard

  1. Drag a UIButton to your view controller.
  2. Open Indentity Inspector and change class to KSFacebookButton.
  3. Open Attribute Inspector and select “Custom” as button type.
  4. Change the button size, corner radius and title base on your needs using storyboard.
  5. Build & run.

Code

KSFacebookButton can be initialize and configure just like normal UIButton

let facebookButton = KSFacebookButton(frame: CGRect(x: 0, y: 0, width: 140, 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)

License

This code is distributed under the terms and conditions of the MIT license.