Skip to content

Instantly share code, notes, and snippets.

@marcpalmer
Last active January 18, 2018 11:52
Show Gist options
  • Select an option

  • Save marcpalmer/a585cfc89da1c98944018d6d12f96320 to your computer and use it in GitHub Desktop.

Select an option

Save marcpalmer/a585cfc89da1c98944018d6d12f96320 to your computer and use it in GitHub Desktop.
UISpect example #4
override func viewDidLoad() {
super.viewDidLoad()
// Normally views would take care of this themselves, not the view controller.
// This is a just a quick example.
OnboardingUISpec.Card.headingFont.apply(to: headingLabel)
OnboardingUISpec.Card.bodyFont.apply(to: welcomeTextLabel)
OnboardingUISpec.Card.backgroundColor.apply(to: [
onboardingCardView,
innerCardView
])
// Apply `cornerRadius` and `clipsToBounds` on the view
OnboardingUISpec.Card.cornerRadius.apply(to: onboardingCardView)
// Set `constant` on all the constraints
OnboardingUISpec.Card.padding.apply(to: [
innerCardTopConstraint,
innerCardLeadingConstraint,
innerCardTrailingConstraint,
innerCardBottomConstraint
])
// Set both the `titleLabel.font` and `titleColor` for state "normal"
OnboardingUISpec.Buttons.font.apply(to: nextButton)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment