Skip to content

Instantly share code, notes, and snippets.

@laevandus
Last active October 22, 2021 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/fa64659444d1db28afcd2fef7dea8112 to your computer and use it in GitHub Desktop.
Save laevandus/fa64659444d1db28afcd2fef7dea8112 to your computer and use it in GitHub Desktop.
var configuration = UIButton.Configuration.filled() // or .plain() or something else
configuration.baseBackgroundColor = .systemCyan
configuration.buttonSize = .large
configuration.cornerStyle = .dynamic
configuration.showsActivityIndicator = false
configuration.image = UIImage(systemName: "pencil")
configuration.imagePlacement = .trailing
configuration.imagePadding = 6
configuration.title = "Title"
configuration.titleAlignment = .leading
configuration.titlePadding = 10
configuration.subtitle = "Subtitle"
// and more
button.configuration = configuration
// or
let button2 = UIButton(configuration: configuration, primaryAction: action)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment