Motion-Awesome

as if more awesomeness was needed...

Download as .zip Download as .tar.gz View on GitHub

MotionAwesome - as if more awesomeness was needed...

MotionAwesome Screenshots

FontAwesome (http://fortawesome.github.io/Font-Awesome) is a really cool way to bring in some low cost bang! to your web applications. Following on that lead, MotionAwesome brings similar awesomeness to the IOS world...

For the star-gizzards ;-)

> git clone https://github.com/derailed/motion-awesome.git
> cd motion-awesome
> rake

Installation

gem install motion-awesome

Dependencies

Issues? Try this!

If you are adding motion-awesome to an existing project, you may run into a common issue with RubyMotion where the added font file is not copied from the resources. To fix this simply run a rake clean and then try again.

Usage

Creating awesome labels

class WannaBeCoolController < XXXController
  include MotionAwesome

  def viewDidLoad
    label( :flag, size: 200 ) do |label|
      self.view.addSubview(label)
    end
  end
end

Creating awesome buttons

class WannaBeCoolController < XXXController
  def viewDidLoad
    MotionAwesome.button( :legal, size: 40, text:%q{Hit me!} ) do |button|
      button.titleLabel.textColor = 0xFB3223.uicolor
      button.titleLabel.font      = UIFont.fontWithName( 'GillSans', size:30 )
      button.addTarget( self,
                        action: "cb:",
                        forControlEvents: UIControlEventTouchUpInside )
      self.view.addSubview( button )
    end
  end
end

Settings

What's my name?

With MotionAwesome you have access to all the latest icons available on the FontAwesome site.

In order to specify the icon name you can use a symbol for the name minus the 'icon-' prefix and sub out the '-' with '_'. Simple!

FontAwesome     => MotionAwesome
fa-flag         => :flag
fa-star-o       => :star_o

Options

Awesomization is currently in effect for UILabel and UIButton.

The method signatures following this strategy:

 awesome_label  = label( :icon_name, opts ) do {|comp| ... }
 awesome_button = button( :icon_name, opts ) do {|comp| ... }

Options are as follows:

ATTA BOY!

This gem was inspired by Hiroshi Horiki(@pchw) https://github.com/pchw/fontawesome

Contact

Fernand Galiana

Still work in progress. So please feel to fork or contact me if you run into issues or just want to send some good vibes...

License

MotionAwesome is released under the MIT license.

History