Skip to content

Instantly share code, notes, and snippets.

@dmoss18
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmoss18/badb89c7f6228bc1a0ad to your computer and use it in GitHub Desktop.
Save dmoss18/badb89c7f6228bc1a0ad to your computer and use it in GitHub Desktop.
Custom motionkit view and layout
class MyCustomView < UIView
def top_title=(value)
@top_title = value
#Custom code here
end
end
class MyCustomLayout < MK::Layout
def layout
root(MyCustomView) do
add UILabel, :title_label
add UIButton, :action_button
end
end
end
class MyContainerLayout < MK::Layout
def layout
add MyCustomLayout, :custom_view do
target.top_title = "Hello"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment