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

Add Edges().to(_:) - Enables to attach the edge of the view to another view or LayoutGuide. #106

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

muukii
Copy link
Collaborator

@muukii muukii commented Jan 11, 2021

PR adds methods to enable to attach edges of view to other layout-guide or view.

Motivation

I often write the following code in order to attach the edges of the view to UILayoutGuide.
This code is a bit verbosity, and we could have a shorthand if we could add a method to Edges.

Before:

 myOverlayView.easy.layout([
    Top().to(overlayViewLayoutGuide, .top),
    Left().to(overlayViewLayoutGuide, .left),
    Right().to(overlayViewLayoutGuide, .right),
    Bottom().to(overlayViewLayoutGuide, .bottom),
  ])

After:

 myOverlayView.easy.layout(
   Edges().to(overlayViewLayoutGuide)
 )

@nakiostudio-bot
Copy link
Collaborator

Current coverage for EasyPeasy.framework is 94.26%

Files changed - -
PositionAttribute+UIKit.swift 80.17%

Powered by xcov

Generated by 🚫 Danger

@muukii muukii changed the title Add Edges().to(_:) Add Edges().to(_:) - Enables to attach the edge of the view to another view or LayoutGuide. Jan 11, 2021
@muukii
Copy link
Collaborator Author

muukii commented Jan 14, 2021

I've become a collaborator by @nakiostudio. Thanks.
I merge this PR.
And I'm going to continue enhancing this library.

@muukii muukii merged commit b79a2ea into nakiostudio:master Jan 14, 2021
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.

2 participants