September 2013
Intermediate to advanced
112 pages
2h 42m
English
We whipped up a pretty interesting app using a relatively small amount of code; however, we also used some vestigial Objective-C patterns that look obviously out of place. This is one area where the RubyMotion community is stepping up and wrapping un-Ruby code into more idiomatic structures. Several libraries and RubyGems[11] are available that could have helped us manage our views.
For example, Sugarcube (https://github.com/rubymotion/sugarcube) would have allowed us to replace those long animation method names with very concise functions such as fade_out and move_to.
| | last_view.fade_out { |view| |
| | last_view.removeFromSuperview |
| | } |
| | |
| | other_views.each do |view| |
| | new_origin = [ |
| | view.frame.origin.x, |
| | view.frame.origin.y ... |
Read now
Unlock full access