Skip to content

Instantly share code, notes, and snippets.

@sxross
Created July 8, 2014 19:20
Show Gist options
  • Save sxross/7a4ddaa1fcf92a74f414 to your computer and use it in GitHub Desktop.
Save sxross/7a4ddaa1fcf92a74f414 to your computer and use it in GitHub Desktop.
RMQ Distribute
# stylesheet
def remember_me_label(st)
st.frame = {bp: PADDING, l:MARGIN, h:HEIGHT, w: WIDTH / 2}
st.text = 'remember me'
end
def remember_me_switch(st)
st.frame = {rop: 10, h:HEIGHT, w:WIDTH / 2} # bp: -32,
end
def distribute_remember_me
rmq(:remember_me_label, :remember_me_switch).distribute :horizontal, margin: 5
end
# controller viewDidLoad
rmq.append(UILabel, :remember_me_label)
q = rmq.append(UISwitch, :remember_me_switch).on(:change){|sender|
# blah, blah, blah
}
rmq.stylesheet.distribute_remember_me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment