Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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