Sha256: 6fef883782c4ba5c93258215b65b6dca22795e62b09b99f61073f6ce27ed719a

Contents?: true

Size: 654 Bytes

Versions: 23

Compression:

Stored size: 654 Bytes

Contents

class PresentModalController < UIViewController
  attr :modal

  stylesheet :present_modal

  layout :root do
    @button = subview(UIButton.buttonWithType(UIButtonTypeRoundedRect), :open_modal_button)
    @button.addTarget(self, action: :open_modal_button, forControlEvents:UIControlEventTouchUpInside)
  end

  def open_modal_button
    @modal = ConstraintsController.new
    self.presentViewController(@modal, animated:true, completion:nil)
  end

end


Teacup::Stylesheet.new :present_modal do

  style :root,
    backgroundColor: UIColor.blackColor

  style :open_modal_button,
    title: 'Open Modal',
    constraints: [
      :centered
    ]

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
teacup-1.3.3 app/controllers/present_modal_controller.rb
teacup-1.3.2 app/controllers/present_modal_controller.rb
teacup-1.3.1 app/controllers/present_modal_controller.rb