Version 0.8.0 released

New features, landscape done right, and RMQ plugins.

bundle update ruby_motion_query

People who worked on this version: @twerth, @GantMan, @squidpunch, and @mwise

New features

  • Automatically enable user interaction when an event is added
  • app_width, app_height, screen_width, and screen_height are now calculated by RMQ, not the SDK (as the SDK just changed this in iOS8 and broke everything, bad SDK, bad)
  • Added rmq.device.three_point_five_inch?, rmq.device.four_point_seven_inch?, and rmq.device.five_point_five_inch?
  • Added alpha styler for UIViews
  • Adds styler for text color in highlighted state
  • Added some additional stylers for UITextView including all UIScrollViewStyler stylers
  • Added support for finding controllers with frontViewController methods that specify their “main” controller
  • Added color= alias to ui_text_view styler
  • Default clipToBounds true if corner_radius give
  • Neato iOS version detection: rmq.device.ios_version rmq.device.is_version? 8 rmq.device.is_version? "7.1" rmq.device.is_version? "8.0"

New landscape features

RMQ’s support for landscape use to be “meh”. v0.8.0 has pretty great support now. A lot of little enhancements went into this version for landscape. If you add willChangeStatusBarOrientation to your app_delegate (see below), everything should work well automatically.

  • Added device.height_landscape and device.width_landscape
  • Grid now automatically supports landscape. Of course you can still assign a new grid for landscape, but now you don’t have to do that or clear the cache just for an orientation change
  • You can now set the orientation that RMQ uses everywhere (to :landscape normally). So you can tell RMQ what the orientation will be, not what it is. Add this to your app_delegate to do this automatically:
def application(application, willChangeStatusBarOrientation: new_orientation, duration: duration)
  # Manually set RMQ's orientation before the device is actually oriented
  # So that we can do stuff like style views before the rotation begins
  rmq.device.orientation = new_orientation
end

New plugin features

Plugins are coming to RMQ, one already exists (although it’s not 100% yet) https://github.com/infinitered/rmq-slide-over-control. RMQ v0.8.0 adds some important features for plugins. The next version will add many more and we’ll make some more plugins to highlight all the things one can build for RMQ.

  • Added the ability for a custom view to define its own styler. This is especially useful for upcoming RMQ plugins. rmq_styler is the method.
  • Added rmq_style_applied method for your custom views, it gets called anytime RMQ styles your view

Bug fixes

  • Fixed a bug where a view would have rmq_build called multiple times if it was added as a subview, removed, then added again. Ack.
  • Changed UITextViewStyler to inherit from UIScrollViewStyler, which it should have done already. This may break your code if you have a UITextViewStyler in your app, just change the super class to UIScrollViewStyler
  • Fixed a problem where you could not set .data to nil. This rmq(my_view).data(nil) was equivalent to rmq(my_view).data and it shouldn’t have been. Now the first one sets the view’s data to nil and the second one returns the view’s data
  • Fixed data assigning to UITextView and UITextField in SDK 8.x
  • Clarified where superview size comes from (it’s bounds)
  • Check for nil on super_width and super_height
  • Fixed bug when styling with :full and the view didn’t have a superview
  • Fixed minor bug in Rect

Version 0.7.1 released

New validation features and misc

bundle update ruby_motion_query

Read the updated validation documentation here.

New features

  • Added white_list ability to all validation rules
  • Added custom validation rule which takes a regex param
  • Added add_validator for easy access to add your own named validation methods and you can make them as complex as you’d like (not limited to regex, uses opts etc.)
  • Show a grid overlay. rmq.app.grid.show or some_grid.show
  • Added attributed_text styler to UILabel
  • Added line_break_mode styler to UILabel

Bug fixes

  • Changed email regex pattern
  • Fixed “Uninitialized constant RubyMotionQuery::Event::ValidationEvent” bug

Version 0.6.1 released

You’ll want to update your gem and in your bundles

gem update ruby_motion_query
# Then in your app
bundle update ruby_motion_query

Thanks to all the contributors in this release: @twerth, @gantman, @squidpunch, and @markrickert

New features

  • This may break your code! – Changed before_prev, right_of_prev, etc to refer to previous sibling, not the previous view that was laid out. This both makes more sense and solves some logic problems that came up in real-world use
  • Gant Laborde has started Validation features. The first part is in this release, which is a validation utility. More advanced Validations is coming. rmq.validation.valid?('taco loco', :digits) == false. See class Validation
  • Added rmq docs your_query feature to rmq command in console, which searches the docs in your browser
  • Styler for UIProgressView

Bug fixes

  • Fixed error when app.detect_dependencies was set to false
  • Fixed tests to use new frame features

Version 0.6.0 released

This is a major release

You’ll want to update your gem and in your bundles

gem update ruby_motion_query
# Then in your app
bundle update ruby_motion_query

Thanks to all the contributors in this release: @twerth, @gantman, @thinkclay, @alex-ross, @squidpunch, and @kemiller

New documentation and website

New website here

New features

  • Rect and frame system – see new docs
  • Grid system – see new docs
  • Inspector – rmq.all.inspector in repl
  • Added simple block to .animate
  • .data – rmq(UITextField).data or rmq(UITextField).data(‘foo’). .data is the most common data attribute on each type
  • has_tag? at rmq level – rmq(my_view).has_tag?(:foo)
  • weak_ref_value utilities
  • image_edge_insets for UIButton styler
  • styler for accessibility_label

Deprecation

  • st.padded
  • st.left
  • st.x
  • st.top
  • st.y
  • st.width
  • st.height
  • st.bottom
  • st.from_bottom
  • st.right
  • st.from_right
  • st.centered

Bug fixes

  • Fixed is_class?
  • Fixed send action – should only call method on views that support it
  • Misc bug fixes and many more tests