Skip to content

Instantly share code, notes, and snippets.

@makthrow
Created January 13, 2016 03:28
Show Gist options
  • Save makthrow/1930998a4a520aec893f to your computer and use it in GitHub Desktop.
Save makthrow/1930998a4a520aec893f to your computer and use it in GitHub Desktop.
class LoginViewController: PFLogInViewController {
var backgroundImage : UIImageView!
// let fbPermissions = ["fields": "public_profile, user_friends, user_education_history, user_birthday"]
// public_profile accesses id, name, first_name, last_name, age_range, link, gender, locale, timezone, updated_time, verified
override func viewDidLoad() {
super.viewDidLoad()
// set our custom background image
backgroundImage = UIImageView(image: UIImage(named: "butterfly.jpg"))
backgroundImage.contentMode = UIViewContentMode.ScaleAspectFill
self.logInView!.insertSubview(backgroundImage, atIndex: 0)
// remove the parse Logo
let logo = UILabel()
logo.text = "Butterfly"
logo.textColor = UIColor.whiteColor()
logo.font = UIFont(name: "Pacifico", size: 70)
logo.shadowColor = UIColor.lightGrayColor()
logo.shadowOffset = CGSizeMake(2, 2)
logInView?.logo = logo
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
// stretch background image to fill screen
backgroundImage.frame = CGRectMake( 0, 0, self.logInView!.frame.width, self.logInView!.frame.height)
// // position logo at top with larger frame
// logInView!.logo!.sizeToFit()
// let logoFrame = logInView!.logo!.frame
// logInView!.logo!.frame = CGRectMake(logoFrame.origin.x, logInView!.usernameField!.frame.origin.y - logoFrame.height - 16, logInView!.frame.width, logoFrame.height)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment