Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RubyMotion @ MagmaConf

RubyMotion @ MagmaConf

An overview of the RubyMotion ecosystem and my experience using it while building http://www.meals.mx

Ivan Acosta-Rubio

June 11, 2013
Tweet

More Decks by Ivan Acosta-Rubio

Other Decks in Technology

Transcript

  1. ¿Que es un RubyMotion? Un conjunto de herramientas que permiten

    desarrollar para IOS y OSX usando Ruby. Friday, June 7, 13
  2. Delegates A delegate is an object that acts on behalf

    of, or in coordination with, another object when that object encounters an event in a program Friday, June 7, 13
  3. def test_converts_boolean_no(self): source = '[button setAttr:NO];' expected = '[button setAttr:false];'

    self.assertSentence(CodeConverter(source).convert_boolean().s, expected) Friday, June 7, 13
  4. UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Hola Magma" message:@"¿Donde es la

    fiesta?" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [message show]; Friday, June 7, 13
  5. class MyController < UIViewController stylesheet :main_screen layout do subview(UIButton, :hi_button)

    end end Teacup::Stylesheet.new :main_screen do style :hi_button, origin: [10, 10], title: 'Hi!' end Friday, June 7, 13
  6. class ExampleController < UIViewController def viewDidLoad @helu = Helu.new("loosing_weight_10") @helu.fail

    = fail_iap @helu.winning = successful_iap @helu.buy end def fail_iap lambda { |transaction| puts "something went wrong" } end def successful_iap lambda { |transaction| puts "We created the IAP :-)"} end end Friday, June 7, 13
  7. class Helu attr_reader :product_id def initialize(product_id) @product_id = product_id SKPaymentQueue.defaultQueue.addTransactionObserver(self)

    end def fail=(fail_block) @fail = fail_block end def winning=(winning_block) @winning = winning_block end Friday, June 7, 13
  8. def finishTransaction(transaction, wasSuccessful:wasSuccessful) end def completeTransaction(transaction) end def restoreTransaction(transaction) end

    def failedTransaction(transaction) end def paymentQueue(queue,updatedTransactions:transactions) end Friday, June 7, 13
  9. #0 0x005d3316 in rb_exc_raise () #1 0x006934b4 in rb_vm_method_missing ()

    #2 0x0065f6bf in rb_method_missing () #3 0x006827bf in rb_vm_dispatch () #4 0x0068408c in rb_vm_trigger_method_missing () #5 0x00683221 in rb_vm_dispatch () #6 0x003e1202 in vm_dispatch () at app_delegate.rb:3 #7 0x003e2c6d in rb_scope__application:didFinishLaunchingWithOptions:_ _ (self=0xb1881f0, application=0xb467b60, launchOptions=0x4) at app_delegate.rb:10 Friday, June 7, 13
  10. rubymotion.com/support/training/ Norberto started programming 20 years ago and has been

    using NextStep and OpenStep since 1995 @hiphoox Friday, June 7, 13