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

Create xToCenterX and xToCenterY AutoLayout Helpers #258

Conversation

pedro-l-santos
Copy link
Contributor

Checklist

Motivation and Context

Currently Alicerce's AutoLayout helpers only provide a centerYToX variant for each of the respective anchors, with the corresponding xToCenterY APIs missing for said anchors. The same applies to some centerX APIs. While this doesn't limit the creation of constraints, it forces a view inversion when defining constraints, in order to define those particular constraints. This piece of work aims to implement these missing helpers in order to improve this.

Description

Changes

  • xToCenterY: add new AutoLayout helpers for Y anchors:

    • top
    • bottom
    • firstBaseline
    • lastBaseline
  • xToCenterX: and new AutoLayout helpers to missing X anchors:

    • left
    • right
  • Unit Tests: add new UTs to cover newly added helpers

@pedro-l-santos pedro-l-santos self-assigned this Jan 2, 2023
@pedro-l-santos pedro-l-santos requested review from p4checo and a team January 2, 2023 12:57
Copy link
Member

@p4checo p4checo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! 👏🏼

## Changes

- `xToCenterY`: add new AutoLayout helpers for Y anchors
(`top, bottom, firstBaseline` and `lastBaseline`)

- `xToCenterX`: and new AutoLayout helpers to missing X anchors
(`left` and `right`)

- `Unit Tests`:  add new UTs to cover newly added helpers
@pedro-l-santos pedro-l-santos force-pushed the feature/x-to-center-x-and-y-to-center-y-autolayout-helpers branch from 4457278 to 48351d9 Compare January 2, 2023 17:09
@codecov
Copy link

codecov bot commented Jan 2, 2023

Codecov Report

Base: 95.87% // Head: 95.92% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (48351d9) compared to base (a1f6d52).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #258      +/-   ##
==========================================
+ Coverage   95.87%   95.92%   +0.04%     
==========================================
  Files         100      100              
  Lines        4996     5056      +60     
==========================================
+ Hits         4790     4850      +60     
  Misses        206      206              
Impacted Files Coverage Δ
Sources/AutoLayout/ConstrainableProxy.swift 98.67% <100.00%> (+0.14%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pedro-l-santos pedro-l-santos merged commit 33b4a95 into master Jan 2, 2023
@pedro-l-santos pedro-l-santos deleted the feature/x-to-center-x-and-y-to-center-y-autolayout-helpers branch January 2, 2023 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants