Skip to content

* Added ability to set options for layouts. NSLayoutFormatDirectionLeadi... - #1

Open
svyatogor wants to merge 1 commit into
dholst:masterfrom
svyatogor:flexible-dsl
Open

* Added ability to set options for layouts. NSLayoutFormatDirectionLeadi...#1
svyatogor wants to merge 1 commit into
dholst:masterfrom
svyatogor:flexible-dsl

Conversation

@svyatogor

Copy link
Copy Markdown

This branch adds to new features:

  • horizontal/vertical methods accept extra options argument. As in cocoa the default option is NSLayoutFormatDirectionLeadingToTrailing
  • Layout object can accept delegate call in initialiser, then subviews can be passed as an array of symbols pointing to methods or instance variables in the delegate. examples:
@from = UILabel.new
@subject = UILabel.new

Motion::Layout.new(self) do |layout|
      layout.view contentView
      layout.subviews :from, :subject
     layout.horizontal "|-15-[from]-[subject]-10-|", NSLayoutFormatAlignAllBottom
end

…adingToTrailing is default (as per cocoa)

* Mske DSL more flexible — subviews can accepts array of symbols which are methods or instance variables in the delegate class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant