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

Adding a FAQ for Common Transformations? #195

Open
grantkemp opened this issue Jul 18, 2017 · 2 comments
Open

Adding a FAQ for Common Transformations? #195

grantkemp opened this issue Jul 18, 2017 · 2 comments

Comments

@grantkemp
Copy link

grantkemp commented Jul 18, 2017

Hi
I have spent the weekend trying to get my head round using PureLayout - one of the improvements that I would love to see is to have an FAQ section for common elements with some sample code.

eg:
1.Creating a left aligned UILabel with 2 lines of text
( making two lines of text is not Supported by PureLayout)
logo.autoPinEdge(.left, to: .left, of: headerView, withOffset: 20)
2. Creating a right aligned icon that is 50% of the height of the Containing view?

headerView.addSubview(logo)
		logo.image = #imageLiteral(resourceName: "newslogo")
logo.autoSetDimensions(to: CGSize(width: headerView.bounds.height/2, height: headerView.bounds.height/2))
		logo.autoAlignAxis(.horizontal, toSameAxisOf: headerView)
		logo.autoPinEdge(.right, to: .right, of: headerView, withOffset: -20)

This would help others to learn and use the library really quickly.

@mickeyreiss
Copy link
Contributor

Please take a look at the example app demo code. PRs are welcome for improvements to that or to the README.

@grantkemp
Copy link
Author

HI @mickeyreiss

I am happy to do a PR for that. I have started working on it. ( along with a blog post about PureLayout.
I am trying to map the freatures against AutoLayout and have found a couple of queries.

  1. Is it possible to use a multiplier within PureLayout - eg ViewA Height is 0.5x ViewB Height.
  2. Is multiple lines of text supported?
    This is mainly to support smaller screen sizes- if not - how do you ensure that the UI scales to smaller and larger devices?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants