Sha256: bc88a6623cf9f6a9e28a0cf551158a028dce10b687a9d80c1e49bbbbaef6484c

Contents?: true

Size: 861 Bytes

Versions: 1

Compression:

Stored size: 861 Bytes

Contents

class CustomViewController1 < UIViewController
  TAG_IDLABEL = 1
  TAG_TEXTBOX = 2

  def viewDidLoad
    puts "#{self.to_s}: CustomViewController1::viewDidLoad"
    self.title = "CustomVC1"

    @idlabel = retrieve_subview_with_tag(self, TAG_IDLABEL)
    @idlabel.text = self.to_s

    @textbox = retrieve_subview_with_tag(self, TAG_TEXTBOX)
    @textbox.delegate = self
  end

  def prepareForSegue(segue, sender:sender)
    puts "#{self.to_s}: CustomViewController1::prepareForSegue '#{segue.identifier}'"

    if segue.identifier == "Subview"
      customVC2 = segue.destinationViewController
      customVC2.set_parent_id(self.to_s)
      customVC2.customtext.text = @textbox.text
    end
  end

  # UITextFieldDelegate protocol (required to dismiss the keyboard)
  def textFieldShouldReturn(textfield)
    textfield.resignFirstResponder
    true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubymotionr-0.0.1 spec/multiple-rubymotion-apps/StoryboardCustoms/app/custom_view_controller1.rb