-
-
Save jamonholmgren/e8f7a304c1a346d3e4c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainScreen | |
stylesheet MainControllerStylesheet | |
def on_load | |
set_state({ first_name: "Jamon", last_name: "Holmgren" }) | |
attach_events | |
end | |
def attach_events | |
find(:button).on(:tap) { set_state({ first_name: "Todd", last_name: "Werth" }) } | |
end | |
end | |
class MainControllerStylesheet < ApplicationStylesheet | |
def setup | |
# Add stylesheet specific setup stuff here. | |
# Add application specific setup stuff in application_stylesheet.rb | |
end | |
def layout | |
find_or_append(UILabel, :first_name_label) | |
find_or_append(UILabel, :first_name).data(state[:first_name]) | |
find_or_append(UILabel, :last_name_label) | |
find_or_append(UILabel, :last_name).data(state[:first_name]) | |
end | |
# ... styles here | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment