Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

svyatogor
Copy link

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