Search code examples
rubymotion

RubyMotion with CoreAnimation constant issue


I'm trying to use some CATransition constants in my rubymotion app thusly:

transition = CATransition.animation
transition.duration = 0.4
transition.type = kCATransitionMoveIn
transition.subtype = kCATransitionFromBottom

But am getting undefined local variable or method `kCATransitionMoveIn'. I've added quartzcore to frameworks in my rake file:

app.frameworks += ['CoreLocation', 'MapKit', 'QuartzCore']

Does anyone know why I can't access this constant? Thanks.


Solution

  • Constants in Ruby can't start with a lowercase letter. You'll want to use KCATransitionMoveIn and KCATransitionFromBottom.