I have the following code:
override func viewDidLoad() {
super.viewDidLoad()
let fbLoginButton = FBSDKLoginButton()
fbLoginView.contentMode = UIViewContentMode.scaleAspectFit
fbLoginView.addSubview(fbLoginButton)
fbLoginButton.frame.origin = fbLoginView.frame.origin
fbLoginButton.frame = CGRect(x: fbLoginView.frame.origin.x, y: fbLoginView.frame.origin.y, width: fbLoginView.frame.width, height: fbLoginView.frame.height)
print("INFO width: \(fbLoginView.frame.width) height: \(fbLoginView.frame.height)")
print("INFO width: \(fbLoginButton.frame.width) height: \(fbLoginButton.frame.height)")
// fbLoginButton.delegate = self
}
I am trying to add the facebook login button within a small subview that I have in my main view. For some reason when I print out the width/height of the UIView, and facebook login button I see this:
INFO width: 1000.0 height: 1000.0 INFO width: 1000.0 height: 1000.0
BUT when I run the app on the simulator I see that the view isnt 1000.0 x 1000.0 (it would be overflowing off of the screen but it isn't. It looks like this:
You can se the blue of the button, and that its correctly WITHIN the smaller subview but, the button actually seems to be overflowing larger than the view. What I don't get why the view is the correct size in the simulator, but its saying that its size is so large. I've read posts here which tell me to resize the button to aspect fit, and I've played around with all of the other options but no luck.

