Created
April 29, 2016 17:25
-
-
Save jbender/51cb2611a387184ada678aa076441abd to your computer and use it in GitHub Desktop.
MotionKit Cells
This file contains hidden or 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 CellLayout < MotionKit::Layout | |
include CommonStyles | |
def layout | |
root :cell do | |
add contentView, :content_view do | |
add(UIView, :container) { cell_content_layout } | |
end | |
end | |
end | |
def cell_content_layout | |
raise 'CellLayout requires cell_content_layout' | |
end | |
def container_style | |
constraints do | |
top.equals(:superview).plus(CONTAINER_PADDING[:top]) | |
bottom.equals(:superview).minus(CONTAINER_PADDING[:bottom]) | |
left.equals(:superview).plus(CONTAINER_PADDING[:left]) | |
right.equals(:superview).minus(CONTAINER_PADDING[:right]) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment