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

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: