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-2.1.12 app/controllers/present_modal_controller.rb
teacup-2.1.11 app/controllers/present_modal_controller.rb
teacup-2.1.10 app/controllers/present_modal_controller.rb
teacup-2.1.9 app/controllers/present_modal_controller.rb
teacup-2.1.8 app/controllers/present_modal_controller.rb
teacup-2.1.7 app/controllers/present_modal_controller.rb
teacup-2.1.6 app/controllers/present_modal_controller.rb
teacup-2.1.5 app/controllers/present_modal_controller.rb
teacup-2.1.4 app/controllers/present_modal_controller.rb
teacup-2.1.3 app/controllers/present_modal_controller.rb
teacup-2.1.2 app/controllers/present_modal_controller.rb
teacup-2.1.1 app/controllers/present_modal_controller.rb
teacup-2.1.0 app/controllers/present_modal_controller.rb
teacup-2.0.6 app/controllers/present_modal_controller.rb
teacup-2.0.5 app/controllers/present_modal_controller.rb
teacup-2.0.4 app/controllers/present_modal_controller.rb
teacup-2.0.3 app/controllers/present_modal_controller.rb
teacup-2.0.2 app/controllers/present_modal_controller.rb
teacup-2.0.0 app/controllers/present_modal_controller.rb
teacup-1.3.4 app/controllers/present_modal_controller.rb