Skip to content

Instantly share code, notes, and snippets.

@adelevie
Created July 28, 2012 19:39
Show Gist options
  • Save adelevie/3194522 to your computer and use it in GitHub Desktop.
Save adelevie/3194522 to your computer and use it in GitHub Desktop.
class SubmitButton
def self.make(params={})
@submitButton = UIButton.buttonWithType(UIButtonTypeRoundedRect)
@submitButton.frame = params[:frame]
# defaults
@submitButton.titleLabel.font = UIFont.systemFontOfSize(14)
@submitButton.titleLabel.text = "Submit"
@submitButton.titleLabel.backgroundColor = UIColor.grayColor
@submitButton
end
end
# Usage:
# btn = SubmitButton.make(:frame => [[50, 325],[50, 50]])
# view.addSubview(btn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment