Last active
August 29, 2015 14:05
-
-
Save dmoss18/badb89c7f6228bc1a0ad to your computer and use it in GitHub Desktop.
Custom motionkit view and layout
This file contains 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 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