Sha256: 8e6a2fdeef3e4bded53ca4636ae99e04ee4c84cf1246b83201ca9c64a27c067e

Contents?: true

Size: 842 Bytes

Versions: 8

Compression:

Stored size: 842 Bytes

Contents

include SugarCube::Adjust

class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
    ctlr = MyController.new
    first = UINavigationController.alloc.initWithRootViewController(ctlr)
    @window.rootViewController = first
    @window.makeKeyAndVisible

    true
  end
end


Teacup::Stylesheet.new(:teacup) do
  style :label,
    color: :white,
    background: :clear,
    constraints: [
      :center_x,
      :center_y,
    ]

  style :button,
    title: 'neat.',
    constraints: [
      :center_x,
      constrain_below(:label).plus(0),
    ]

end


class MyController < UIViewController
  stylesheet :teacup

  layout do
    @label = subview(UILabel, :label, text: 'nifty?')
    @button = subview(UIButton, :button)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
teacup-2.0.2 samples/OnePage/app/app_delegate.rb
teacup-2.0.0 samples/OnePage/app/app_delegate.rb
teacup-1.3.4 samples/OnePage/app/app_delegate.rb
teacup-1.3.3 samples/OnePage/app/app_delegate.rb
teacup-1.3.2 samples/OnePage/app/app_delegate.rb
teacup-1.3.1 samples/OnePage/app/app_delegate.rb
teacup-1.3.0 samples/OnePage/app/app_delegate.rb
teacup-1.2.9 samples/OnePage/app/app_delegate.rb