A set of class extenstions I commonly use in my applications for RubyMotion.
Automatically resizes a UILabel's height based on its contents. Optionally, it can shrink the width as well.
Runs UIImage.imageNamed(self)
for the string.
Returns the string as an NSURL
Adds borders in specified locations on a UIView
. Possible locations are: [:top, :left, :right, :bottom]
and can be passed singularly or in an array.
These methods are used by the add_borders
method and can be called independently if needed.
Removes all borders you've added on a UIView (may also remove other things you've added to the view's layer
, so be careful with this one!)
Pads the size of an image to the specified size.
Returns a UIImage with UIImageRenderingModeAlwaysTemplate
Add this line to your application's Gemfile:
gem 'OTGHelpers'
And then execute:
$ bundle
Or install it yourself as:
$ gem install OTGHelpers
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request