Giter VIP home page Giter VIP logo

rmq's Introduction

RMQ logo


RMQ - RubyMotion Front-end Library

Dependency Status Build Status Gem Version Crusher.io optimized

A fast, non-polluting, chaining, front-end library. It’s like jQuery for RubyMotion plus templates, stylesheets, events, animations, etc.

One of RMQ's goals is to have the best documentation of any RubyMotion UI library.

RMQ is maintained by Infinite Red, a web and mobile development company based in Portland, OR and San Francisco, CA.





image

Read the RMQ Documentation here

If you like RMQ, check out RedPotion, the ultimate gem for RubyMotion.





Requires SDK 7 or higher, and iOS 7 or higher

Quick Start

gem install ruby_motion_query
# Create an app
rmq create my_app
# Then
cd my_app
bundle
rake

rbenv rehash after gem install if you use rbenv


Installation

RMQ requires no other gems. If you use stuff like scale and certain animations it will require some frameworks (like QuartzCore or CoreGraphics)

  • gem install ruby_motion_query

If you use rbenv

  • rbenv rehash

Require it

  • require 'ruby_motion_query'

or add it to your Gemfile:

  • gem 'ruby_motion_query'

for edge RMQ, add this to your Gemfile:


License

RMQ is available under the MIT license. See the LICENSE file for more info.


Created by Todd Werth (http://toddwerth.com)



Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Read the RMQ Documentation here


Premium Support

RMQ, as an open source project, is free to use and always will be. Infinite Red offers premium RMQ support and general mobile app design/development services. Email us at [email protected] to get in touch with us for more details.

rmq's People

Contributors

alex-ross avatar andrewhavens avatar bmichotte avatar chrislerum avatar crusherio avatar diogoandre avatar emson avatar fvonhoven avatar gantman avatar gguerini avatar halo avatar hboon avatar jamonholmgren avatar jjnevis avatar kemiller avatar kevinvangelder avatar malkomalko avatar markrickert avatar mwise avatar shreeve avatar skandragon avatar skellock avatar squidpunch avatar sxross avatar thinkclay avatar twerth avatar vaughankg avatar willrax avatar yuc-zhu avatar zhigang1992 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rmq's Issues

Automatically enable user interaction

When you call .on() for a UIView, RMQ should enable user interaction for that UIView (because why wouldn't you?).

99.99% of the time, you want that item enabled.

Tests for the merging of options in Animations

This came from PR #56

I would love to also help with this, but I'm not sure how to test the merging of options

Test bellow wouldn't really test it, right?

it 'should throb with custom durations' do
 @viewq.animations.throb(duration: 0.0, duration_out: 0.0).is_a(RubyMotionQuery::RMQ).should == true
end

I think we could pass any options there and the test would still pass.

Any ideas?

And thanks for RMQ, it's really easy to get going with and and quite useful!

Frame setters don't work right on iPad modal views

I've got a view that I'm applying this style to:

  def container(st)
    st.frame = {
      l: 10,
      fr: 10,
      h: 320,
    }
    st.background_color = color.green
  end
end

When I run it in a fullscreen modal on iPhone, it works great. But when I run it as a UIModalPresentationFormSheet modal on iPad it doesn't calculate the parent view size correctly and things get all wonky. I tried rotating the device to get it to reapply the styles, but to no avail.

screen shot 2014-07-04 at 9 36 08 am

Centering in landscape

When I run your Hello World demo in landscape, there seems to be a problem with horizontal centering of subviews created in the viewDidLoad method. This problem persists with views created in new ViewControllers created later.

The problem can be corrected by running rmq.all.reapply_styles after the view is visible. I'm not sure what causes it. Rotating also fixes it. It really only appears when content is setup in viewDidLoad. It may have something to do with device/view rotation since it's always correct in portrait.

RMQ with motion-require

when get rmq with motion-require work in one project. it will turn a error:

➜  my_app  rake --trace
rake aborted!
no implicit conversion of Array into String
/Library/Ruby/Gems/2.0.0/gems/motion-require-0.0.7/lib/motion-require.rb:78:in `read'
/Library/Ruby/Gems/2.0.0/gems/motion-require-0.0.7/lib/motion-require.rb:78:in `requires_in'
/Library/Ruby/Gems/2.0.0/gems/motion-require-0.0.7/lib/motion-require.rb:56:in `block in dependencies_for'
/Library/Ruby/Gems/2.0.0/gems/motion-require-0.0.7/lib/motion-require.rb:55:in `each'
/Library/Ruby/Gems/2.0.0/gems/motion-require-0.0.7/lib/motion-require.rb:55:in `dependencies_for'
/Library/Ruby/Gems/2.0.0/gems/motion-require-0.0.7/lib/motion-require.rb:94:in `block in all'
/Library/RubyMotion/lib/motion/project/config.rb:109:in `call'
/Library/RubyMotion/lib/motion/project/config.rb:109:in `block in setup'
/Library/RubyMotion/lib/motion/project/config.rb:109:in `each'
/Library/RubyMotion/lib/motion/project/config.rb:109:in `setup'
/Library/RubyMotion/lib/motion/project/app.rb:64:in `config'
/Library/RubyMotion/lib/motion/project/app.rb:72:in `setup'
/Users/chareice/rmo/my_app/Rakefile:12:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:637:in `raw_load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'

iOS 8 compatibility?

Hello,

When using RMQ in an iOS 8 environment, the calculations related to app/screen size, width, and height break when the device is in a landscape orientation. This seems to be related to the following change (from the iOS 8 docs):

Prior to iOS 8, a screen’s bounds rectangle always reflected the screen dimensions relative to a portrait-up orientation. Rotating the device to a landscape or upside-down orientation did not change the bounds. In iOS 8 and later, a screen’s bounds property takes the interface orientation of the screen into account. This behavior means that the bounds for a device in a portrait orientation may not be the same as the bounds for the device in a landscape orientation. Apps that rely on the screen dimensions can use the object in the fixedCoordinateSpace property as a fixed point of reference for any calculations they must make.

This is fixed for app_width and app_height via the following hacks in ApplicationStylesheet:

  def app_width
    if device.screen.respond_to?(:coordinateSpace)
      app_size.width
    else
      portrait? ? app_size.width : app_size.height
    end
  end

  def app_height
    if device.screen.respond_to?(:coordinateSpace)
      app_size.height
    else
      portrait? ? app_size.height : app_size.width
    end
  end

I would like to have submitted a PR for this, but there seems to be other iOS 8-related issues and I'm still wrapping my head around how to run the specs confidently against Xcode 5 / iOS 7.1 and Xcode 6 GM / iOS 8. So I guess my question is this: do you have a strategy for handling iOS compatibility/issues? More specifically, do you intend to support both iOS versions in a given version of RMQ, or will there be a hard line where iOS 8 is requirement?

Custom regex arguments in validations.

Maybe something like this. Would also help eliminate the problem of trying to build the ultimate regex! :rage4:

rmq.append(UITextField, :user).validates(:email, regex: /whatever/)

Significant memory leak when using rmq

I seem to have found a significant memory leak issue when using rmq. It may be my usage of it, and I'm forgetting to call some rmq.cleanup method or something...

I have code like this in a view controller:

self.scrollView = rmq.append(UIScrollView).get
scrollView.tap do |sv|
  sv.frame = view.frame
  sv.contentSize = view.frame.size
end

# Name

self.nameField = rmq(scrollView).append(UITextField, :name_field).get.tap do |o|
  o.text = record ? record.name : ""
  o.delegate = self
end

This causes a significant memory leak each time a controller is created. However, I am certain the controller's dealloc method is being called, so it is itself being destroyed.

Note that I get a memory leak (although less objects are leaked) if I do not assign a stylesheet via rmq.stylesheet = TagDetailStylesheet so I do not believe this is a defect in the stylesheet processing code.

I have tried explicitly setting self.nameField and self.scrollView to nil prior to popping the controller off the navigation stack, but this does not release this mystery memory.

The call path which allocates this memory starts with CA::Transaction::observer_callback, and proceeds through CA::Layer::layout_and_display_if_needed, up to [CALayer display] and CABackingStoreUpdate_.

I'm really not sure where to go next in debugging this. Reverting the rmq usage in the controller and manually configuring everything removes the memory leak issue entirely from this controller.

Cannot find template `rmq-template`

I'm trying to play around with RMQ but having trouble even created a new project.

Here are my versions:

~/motionapps $ ruby --version
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin12.2.0]
~/motionapps $ motion --version
2.24
~/motionapps $ rmq --version
0.5.6

Here is the error:

~/motionapps $ rmq create my_new_app
Cloning into '/Users/omni/Library/RubyMotion/template/rmq-template'...
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
     Creating app
Cannot find template `rmq-template' in /Library/RubyMotion/lib/motion/project/template or /Users/omni/Library/RubyMotion/template. Available templates: gem, ios, osx, promotion-template

      Complete. Things you should do:
      > cd my_new_app
      > bundle
      > rake spec
      > rake
      (main)> exit

      Then try these:
      > rake retina=3.5
      > rake retina=4 
      > rake device_family=ipad 
      > rake device 

Feature request: frame accepts options relative to center

I'm consistently finding myself doing the following anti-pattern:

def some_style(st)
  st.frame = {centered: :both, h: 10, w: 10}
  rmq(st.view).nudge(l: 10)
end

It'd be really nice to be able to set the frame from its center.
(Thinking out loud) options for frame:

:left_of_center
:right_of_center
:below_center
:above_center

Feature request: dynamic style methods

It would be really nice to have stylesheets/style methods be more dynamic. That way, stylesheets can more fully own the responsibility of styling views. As RMQ currently stands, that responsibility moves up into the controller when an element of the style is dynamic.

For example, I find myself frequently doing the following inside the controller:

view.append(UILabel, :some_style).style do |st|
      st.text = obj.text
      st.resize_to_fit_text
    end

I would really like to be able to pass that object into the style method, so that I don't have to have style code in my controller.

Perhaps something like this:

view.append(UILabel, :some_style, {options: hash, of: arguments})

One potential barrier: I'm not sure how style reapplication works, and if objects passed into the style method would need to be cached in some way.

Thoughts? I'd be happy to implement this feature if it would be accepted.

Problem with generators

➜  Desktop  rmq create table_view_controller people

     Creating table_view_controller: people

  Δ  Creating directory: app/controllers
/Users/squixy/.rvm/gems/ruby-2.1.2/gems/ruby_motion_query-0.7.0/bin/rmq:133:in `mkdir': No such file or directory @ dir_s_mkdir - app/controllers (Errno::ENOENT)
    from /Users/squixy/.rvm/gems/ruby-2.1.2/gems/ruby_motion_query-0.7.0/bin/rmq:133:in `block in insert_from_template'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/gems/ruby_motion_query-0.7.0/bin/rmq:115:in `each'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/gems/ruby_motion_query-0.7.0/bin/rmq:115:in `insert_from_template'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/gems/ruby_motion_query-0.7.0/bin/rmq:47:in `create'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/gems/ruby_motion_query-0.7.0/bin/rmq:170:in `<top (required)>'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/bin/rmq:23:in `load'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/bin/rmq:23:in `<main>'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
    from /Users/squixy/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'

Random crash

"undefined method `cached_rmq' for #<RubyMotionQuery::ViewData:0xdc1a790 ...>"

There's like nothing in the backtrace at all. This happened randomly twice while just browsing around in my application. This is on 0.5.8 btw.

Just wanted to create a ticket and put it on your radar to see if this one ever popped up.

Specs just seem to die off; or at times getting a malloc error

running specs on master, using xcode 6.1 and RM 2.37, specs seem to just die off (only sometimes) but often the last spec seems to be

focus

  • should set focus to a selected view`

rarely I also have been able to get an error instead of no output

mq(50414,0x48f91a8) malloc: *** error for object 0x112adfe4: incorrect checksum for freed object - >object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

if I get some time I will try and see if I can track down further details / solutions... but figured I'd log it since I was seeing it around every other full run of tests...

Styling subviews (children)

I have a view controller that contains a couple of subviews (UIView). While I can apply style for UIViewController, I'd like to have separated stylesheets for these subviews and just append these views already styled. How can I achieve that?

The problem is to decouple stylesheets from ViewController and provide them with custom views. Is there any way to do that?

Grouped Table Generator

RMQ Generators are awesome. Should add a template for Grouped tables, and not just single table screens.

What does distribute actually do?

I've been trying to figure this out. I thought it would distribute views evenly vertically or horizontally but it doesn't seem to do anything.

Rounded Rectangle Button Doesn't Work Even in Example

I built the example on RubyMotion v.2.24 and can't get this code to draw a button with a border:

@button = rmq(view).append(UIButton.buttonWithType(UIButtonTypeRoundedRect), :cancel).get

So I tried the Kitchen Sink example. Throb Buttons also doesn't draw a border. I also tried this:

@button = rmq(view).append(UIButton.buttonWithType(UIButtonTypeRoundedRect), :cancel).get
@button.layer.cornerRadius = 2
@button.layer.borderWidth = 1
@button.layer.setBorderColor rmq.color.blue

Still not working. Any thoughts what might be going wrong here?

Recognizers for swipes in more than one direction

Hey,

I've been trying to use RMQ's events to allow different behavior based on whether a view is swiped left or right, but I've been having trouble getting it to work. I'm perfectly willing to believe there's just something I'm missing, but I've tried a number of different approaches and nothing's proved successful. Here's what I've tried:

rmq.append(@main_screen.view).on(:swipe, direction: UISwipeGestureRecognizerDirectionRight) do
    puts "swipe right"
end
rmq.append(@main_screen.view).on(:swipe, direction: UISwipeGestureRecognizerDirectionLeft) do
    puts "swipe right"
end

but this returns [RMQ Error] Event already exists on this object: swipe. Remove first, using .off (RuntimeError)

I've also tried:

rmq.append(@main_screen.view).on(swipe) do |sender, event|
  puts event.recognizer.direction
  case event.recognizer.direction
  when UISwipeGestureRecognizerDirectionLeft
    puts "swipe left"
  when UISwipeGestureRecognizerDirectionRight
    puts "swipe right"
  end
end

This version will print out "1" (the direction), and "swipe right" when swiping right, but does not print anything when swiping in any other direction (not even the event.recognizer.direction).

It seems I can define a swipe handler for one direction, but I cannot figure out how to setup a way to recognize and handle swipes in more than one direction at a time.

Thanks.

distribute(:flow)

It would be great to be able to append a bunch of views and then call something like:

.distribute(:flow, options = {
  padding: 5,
  center_last: true
})

to turn the views into a flow based on the width of the parent view:

  X  X  X
  X  X  X
     X

or without the center_last

  X  X  X
  X  X  X
  X

Grid framework for rmq?

Thinking about porting over something like this: http://jeet.gs/

Basically create some layout functions in application stylesheet that allows you to specify your elements in a grid for easily laying things out.

I've found motion-layout and autolayout to be rather annoying, and sometimes trying to center things and getting them to be exactly right are a little challenging, so I'm going to try my hand at what a grid framework for rmq might look like.

Questions around integer divisors for hex values

One thing that has always seemed off with any hex converter is how to handle the case of "clean" values such as "#808080". This represents a value that is supposed to be 128 units of red, green, and blue. Yet, in most libraries, this will map to 128 / 255.0, which is not exactly 0.5 and may cause some subtle variations from a hard-coded value of 0.5. It seems that sometimes, we actually want to use 256.0 as the divisor instead of 255.0.

One approach I've used in the past is something like this:

use = (val / (val % 16 == 0 ? 256.0 : 255.0))

This basically says, if you're given a value that is an integer multiple of 16, then use 256.0 as the divisor, otherwise use 255.0 as the divisor. This would yield "clean" results when given values such as 128 (which would be exactly 0.5, instead of the current 0.502) or 64 (which would be exactly 0.25, instead of the current 0.251).

Another approach would be to always use 256.0 as the divisor, unless given 255 (in which case 255.0 would be the divisor).

Thoughts?

Use method_missing in stylers

I think we should add method_missing to the stylers so that we don't have to explicitly create new styles for every property and so that setting a property in a stylesheet that doesn't exist in the styler will still apply to the object.

Case in point: there is not content_inset style method for the UIScrollViewStyler, however the property contentInset exists on UIScrollView. Using method_missing would mean i could still do something like:

def my_styler(st)
  st.contentInset = UIEdgeInsetsMake(0, 0, -50, 0)
end

Currently that code would throw an error.

If we really wanted to get fancy with it, we could check if the @view responds to the camel_case or snakeCase selector in method_missing. Thoughts, @twerth?

rmq create my_app fails silently

So, maybe Im missing something, but when I do

rmq create my_app
Nothing is actually created. It says creating app, complete, but shows no actual created files, and no folder or files are created.

https://www.dropbox.com/s/2ol7bx5kvp7jmml/Screenshot%202014-02-05%2019.01.11.png

Im newish to ruby motion (played around with it like a year ago for a day), so maybe Im missing something important :) But, using RVM, tried in 2.0.347, as well as 1.9.3, ruby motion query 0.5.1 is installed, motion 2.22

Also same issue on both my imac running lion and mbook pro running mavericks

Any ideas?

has_style? method

I keep finding myself wanting to check to see if a style is defined before applying it and getting the drawing delay and the style name can't be found error. Sometimes I build controls that sometimes want to be styled if the style exists but I don't have anyway of checking it currently.

Thoughts?

View is rotated... weird, can't figure it out

http://cl.ly/image/1R0u3h2A113l

module App

  module_function

  def overlay
    rmq(rmq.app.window).tap do |o|
      @overlay ||= o.append(Overlay, :overlay_dark)
    end
    @overlay.get
  end

end

class Overlay < UIView

  def rmq_build
    @rmq.append(LoginOverlay)
  end

  def rmq_created
    @rmq = rmq(self)
  end

  def close
    @rmq.animations.fade_out
  end

  def open
    @rmq.off(:tap)
    @rmq.animations.fade_in.on(:tap) do |sender|
      close
    end
  end

end

class LoginOverlay < UIView

  def rmq_build
    rmq.stylesheet = OverlayStylesheet

    rmq(self).tap do |view|
      view.append(UIView, :login_wrapper).tap do |section|
        view.append(UILabel, :login_header)
      end
    end
  end

end

App.overlay.open

RMQ Documentation is inaccurate

TL;DR - The following documentation is inaccurate. It implies that .append applies the applicable style, then rmq_created, rmq_appended, rmq_build. Source diving reveals that the order is actually rmq_created, rmq_build, rmq_appended, then the style is applied.

Either the documentation or the code should change. I'm happy to do the later.

Current documentation:

image

Current implementation of append:

def append(view_or_constant, style=nil, opts = {})
  opts[:style] = style
  add_subview(view_or_constant, opts)
end

Current implementation of add_subview:

    if created
      new_view.rmq_did_create(self.wrap(new_view))
      new_view.rmq_created
    end
    new_view.rmq_build
    new_view.rmq_appended if appended

    if self.stylesheet
      apply_style_to_view(new_view, style) if style
    end

RMQ create fails to create a new app

When I installed the ruby_motion_query gem for the first time and ran the create app command no app was created.

On checking the code it appears that the ./bin/rmq file with the motion create [email protected] command is the culprit.

Also by changing that line to a system "motion create --template=rmq-template #{app_name}", as opposed to the "`" I think you might be better exposed to the errors.

Also if your ~/Library/RubyMotion/template/rmq-template directory already exists you are unlikely to see this error.

RMQ Selected Validation

As of right now there are individual validations for input. This is the issue request on the feature to add validation to the selected.

Example usage should work in the following style:

# Utility
rmq.validations.valid?('some string', :email)
rmq.validations.valid?('some string', :email, {some_option: 1})


# On the fly
rmq.append(UITextField, :email).validates(:email).data(row.email).on(:change) do |sender|
  rmq(sender).validate
end.on(:invalid) do |sender|
  # do something
end.on(:valid) do |sender|
  # do something
end

# check everything
puts rmq.all.valid?

# Batch
rmq.append(UITextField, :email).validates(:email).validates(:presence).data(row.email)
rmq.append(UITextField, :age).validates(:numeric, min: 1, max: 120).data(row.email)

rmq(UITextField).validates(:presence)

rmq.append(UIButton, :save).on(:touch) do
  fields = rmq(UITextField).invalid
  if fields.blank?
    # just some info
  else
    fields.each do |view|
      puts rmq(view).validation_errors.join("\n")
    end
  end
end



----------------------------------------------------------------------------------------------------
Stylesheet
----------------------------------------------------------------------------------------------------

def email(st)
  st.frame = "a1:b2"
  st.validation_errors = {
    presence: "You must enter an email",
    email: "Must be a valid email, 8 chars or more, yadda yadda yadda"
  }
end

Validation Feature Checklist:

  • RMQ validation utility with parameters
  • RMQ valid and invalid events
  • rmq.all.valid? to check all
  • Add validations to selections
  • Query for all valid and invalid validated items
  • Get all validation error messages from stylesheet

Releasing Events on Controller Pop

I presume .on is implemented as an observer. If so, when a controller is popped (or even hidden) it's likely you need to shut off these observers. Consider this:

rmq(:something).on(:tap) do
  # pop view controller
end

How is this handled?

rmq.stylesheet with multiple controllers on screen?

For instance when having a split view controller where you have a sidebar with multiple controllers on the screen at once. It seems like sometimes views for a specific controller/stylesheet combo get confused and start thinking that the style should be in another stylesheet.

Have you seen this happen before?

Spec Failures on master using RM 3.0

Looks like number precision - haven't dug into the code to check into it. Just logging an issue and will try and check it out soon if someone doesnt pick it up first!

grid - should return 2 member hash if specifying 1 letter and digits with colon
Bacon::Error: {:r=>61.6, :b=>221.8}.==({:r=>61.5999755859375, :b=>221.799987792969}) failed

grid - should return 4 member hash when specifying a full grid
Bacon::Error: {:l=>7.0, :t=>5.0, :r=>61.6, :b=>221.8}.==({:l=>7.0, :t=>5.0, :r=>61.5999755859375, :b=>221.799987792969}) failed

grid - should return 2 member hash when specifying only column:number
Bacon::Error: {:l=>7.0, :b=>221.8}.==({:l=>7, :b=>221.799987792969}) failed

580 specifications (1660 requirements), 3 failures, 0 errors

fl for from_left and fr for from_right, but nothing between

Frame settings of left and right can sometimes be thought of as from_leftbut fl will silently fail.

This issue is 2 fold:

  • First, add our friendly aliases for fl
  • Second, stop being silent and throw a warning when we get strange frame demands

The check for strange frame keys should be extremely performant

Best practices for rmq.stylesheet in a custom view?

I've noticed that setting rmq.stylesheet sets the style globally. So I have a table view controller with a MainStylesheet and then create cells with different custom cell classes and in there try and call rmq.stylesheet = WhateverStylesheetForCustomClass, it seems that the original stylesheet is replaced. So when the last stylesheet is loaded, and it's still looping through the cells that had the old stylesheet applied to the rmq instance, I get a ton of errors like this:

[RMQ ERROR] style_name :speed doesn't exist for a UILabel. Add 'def speed(st)' to DataCellStylesheet class

2014-03-03 18:11:05.897 aloft[32744:80b] stylesheet.rb:92:in `apply_style_to_view:': private method `temperature' called for #<DataCellStylesheet:0xd525ef0 ...> (NoMethodError)
    from stylesheet.rb:31:in `block in apply_style:'
    from stylesheet.rb:30:in `apply_style:'
    from wind_cell.rb:26:in `layoutSubviews'
    from delegate_module.rb:70:in `open_screen:'
    from app_delegate.rb:14:in `on_load:'
    from delegate_module.rb:20:in `application:didFinishLaunchingWithOptions:'

I've found that not calling the stylesheet= in the lower cells doesn't cause these errors, but I can't figure out from the readme how to apply a stylesheet to a single custom class (in this case a subclass of UITableViewCell).

Any help would be appreciated!

WeakRef error

What about this one? This is happening with a split view controller as well when I'm pushing views in the details nav bar from clicks in the master.

(main)> 2014-05-01 15:04:40.704 XXX[20186:90b] traverse.rb:281:in `weak_view_controller': Invalid Reference - probably recycled (WeakRef::RefError)
        from stylesheet.rb:6:in `stylesheet=:'
        from screen.rb:11:in `viewDidLoad'
2014-05-01 15:04:40.713 XXX[20186:90b] *** Terminating app due to uncaught exception 'WeakRef::RefError', reason: 'traverse.rb:281:in `weak_view_controller': Invalid Reference - probably recycled (WeakRef::RefError)
        from stylesheet.rb:6:in `stylesheet=:'
        from screen.rb:11:in `viewDidLoad'

Have you seen these come up ever? Any good strategies to try?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.