Skip to content

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

Merged
muukii merged 1 commit intonakiostudio:masterfrom
muukii:master
Jan 14, 2021
Merged

Add Edges().to(_:) - Enables to attach the edge of the view to another view or LayoutGuide.#106
muukii merged 1 commit intonakiostudio:masterfrom
muukii:master

Conversation

@muukii
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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