Rubymotion – new bug found

I’m using this motion-addressbook in my project. Reported http://hipbyte.myjetbrains.com/youtrack/issue/RM-630

fixed in 2.37


= RubyMotion 2.37 =

* Fixed a regression where Dispatch.once did not work correctly when it was
invoked in some points.
* Fixed a bug where the compiler would crash with an assertion message
`[BUG] Object: SubtypeUntil ...' when compiling certain Ruby files.
* Fixed a bug in the compiler when compiling for ARM64 where certain types
would still be emitted with a 32-bit architecture in mind.
* Fixed a bug in the compiler when compiling for ARM64 where certain structs
would not be properly available (such as NSDecimal).

Change image in UIImageView – RubyMotion

I needed to change image in my UIImageView, but simply setting new image using myImageView.setImage didn’t work. There’s simple workaround

and now set the image

you can remove resizableImageWithCapInsets – I’m using square images to make UIImageView of any size.

Download file using AFNetwork

set your Rakefile

when downloading multiple files, use NSOperationQueue

MD5/SHA1 gem for RubyMotion

I’ve released gem for making MD5/SHA1 hashes in RubyMotion. It’s handled by small ObjC code in vendor directory. You can get this gem from my github.

Add gem 'rm-digest'  into your  Gemfile , run bundle install  and you can generate MD5/SHA1 in your application.

 

Dismissing popup view tapping outside

 

PSTCollectionView in rubymotion

I need use UICollectionView, but target my app for iOS < 6.0. So I’ve found PSTCollectionView library and using it with my rubymotion project. You can find whole source code in my github repo.

You need to download and link PSTCollectionView directory into vendor/PSTCollectionView .

Then update your Rakefile :

create app/controllers  and add two files – cell.rb  and  view_controller.rb

cell.rb

and  view_controller.rb

Finally, change  app_delegate.rb

run rake  and voila! :)

Screen Shot 2013-02-20 at 21.56.21

PSPDFKit gem for rubymotion

I’ve just released simple gem to include PSPDFKit into rubymotion project – see https://rubygems.org/gems/pspdfkit.

Installation is pretty straightforward

add to your  Rakefile :

Create  Gemfile file and add:

and execute  bundle install .

Then you need to copy/link framework and bundle files:

That’s it. Run  rake and test your installation.

PSPDFKit in rubymotion

Update

If you’re using Bundler, you can simply add gem 'pspdfkit' to your Gemfile. See more on https://github.com/tmeinlschmidt/rm-pspdfkit


As I’ve started using this famous framework, I’d like to use it in my rubymotion application. So, there’s my setup to include this fmw in rubymotion project

  • extract PSPDFKit anywhere
  • create directory vendor  in your RM project
  • create symbolic link from your unzipped PSPDFKit to vendor/PSPDFKit.framework

and modify Rakefile accordingly

try rake , it should link and start simulator.

Next step

Add some PDF file into your app resources  folder.

And then you can try to modify app/app_delegate.rb  with simple example: