I'm creating a login page where I want to have a Facebook login button. I have a stack view where it I want the button to be. How do I insert the button into the stack view and customize the button to setUpElements()
? I currently have a normal UIButton where I want the facebook button to be, designed as how I want the FBButton to be designed. It’s just a placeholder for the FBButton right now. Pretty much, I just want to customize the facebook button to the specs of setUpElements()
and place it inside of the stack view (under the “Sign Up Apple Button”. I've attached a screenshot of how the stackview is designed, thanks for any help!
import UIKit
import FirebaseAuth
import FBSDKLoginKit
class WelcomeViewController: UIViewController {
@IBOutlet weak var stackView: UIStackView!
@IBOutlet weak var signInAppleButton: UIButton!
@IBOutlet weak var signInFacebookButton: UIButton!
let facebookLoginButton = FBLoginButton()
override func viewDidLoad() {
super.viewDidLoad()
setUpElements()
}
func setUpElements() {
let button = signInFacebookButton
button?.layer.borderWidth = 2
button?.layer.borderColor = UIColor.init(red: 93/255, green: 129/255, blue: 140/255, alpha: 1).cgColor
button?.layer.cornerRadius = 20.0
button?.tintColor = UIColor.black
}
}