Search code examples
objective-ciosrubymotion

Does RubyMotion support integration of objective-c code?


There are a ton of libraries/pieces of code that have already been built in Objective-C can RubyMotion use these bits without rewriting them in Ruby?


Solution

  • There are a couple ways to do this. One is by vendoring your 3rd party code into the vendor directory and then using the app.vendor_project method in your Rakefile. See Using 3rd Party Libraries for an example.

    Another option is using Cocoapods. With the motion-cocoapods Ruby gem, you can add any of the libraries here using something like this:

    app.pods do
      dependency 'JSONKit'
    end