I am interested in RubyMotion, but would like to understand more about using 3rd party iOS frameworks before paying the license fee.
I see in section 2.2 here, it states:
“To vendor a 3rd-party library in a RubyMotion project, the source
code must be available somewhere on the filesystem.”
My understanding of an iOS framework is essentially a static library (.a file) and a bunch of header files, with no source code – this seems to suggest to me that it is not possible to use a 3rd party iOS framework with RubyMotion.
However, reading this documentation further states that it is possible to supply the project type :static to the vendor_project method along with :products (an array of static library names) and :headers_dir (path to the directory that contains public headers files). This seems to contradict the assertion that the source code must be available.
So my question – is it possible to use a closed-source 3rd party iOS framework with RubyMotion where there is no access to the source code?
Yes it’s totally possible. I think what the documentation means is just you need to include everything you use in the project.
You can either use a xcode project or as you said, a static library(.a file) with several header files (maybe some objective-c wrapper files too).
something like this in your Rakefile will do the job!
here is an article that I found really helpful, it explains well how to use 3rd party library in RubyMotion.
Other than including a library in your project manually, you can also use libraries available on Cocoapods. There is a RubyMotion wrapper – motioncocoapods for this, i recently done an article on this subject, you can have a look if you are interestd.