MotionInMotion Episode 10 - Teacup
teacupなどを使ってスタイルやconstraintsを設定
- teacup
- sugarcube
- sweettea (teacup + sugarcube = sweettea)
- class PostView < UIView
- layout self do
- subview UITextView, :content_view, {
- layout self do
app/styles/
- Teacup::Stylesheet.new :main_window do
- style :hi_button,
- Teacup::Stylesheet.new :main_window do
- class PostDetailController < UIViewController
- viewDidLoad
- layout self.view, :post_view
- viewDidLoad
- constraints
- style :post_view,
- constraints: [
- constrain_left(0),
- constrain(:width).equals(:superview, :width),
- PostView
- self.stylesheet = Teacup::Stylesheet[:main]
- apply_constraints
- style :post_view,