Skip to content

Instantly share code, notes, and snippets.

@zhulinpinyu
Created May 26, 2015 15:03
Show Gist options
  • Save zhulinpinyu/6b14b3c4a6e4201954af to your computer and use it in GitHub Desktop.
Save zhulinpinyu/6b14b3c4a6e4201954af to your computer and use it in GitHub Desktop.
rmq.append(UILabel, :hello_label)
rmq.append(UIButton, :hello_button).on(:tap) do |sender|
rmq(:hello_label).animate(
duration: 1,
animations: -> (q) {
q.style do |st|
st.scale = 0.6
st.view.alpha = 0.1
st.top = st.top - 50
end
},
completion: -> (did_finish, q) {
q.animate(
duration: 0.3,
animations: -> (cq) {
cq.style do |st|
st.scale = 1
st.view.alpha = 1
st.top = st.top + 50
st.text = (st.text == "Hello RMQ!" ? "Goodbye RMQ!" : "Hello RMQ!")
end
}
)
}
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment