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 EdgeInsets helper inits #138

Merged
merged 3 commits into from
Nov 14, 2023
Merged

Add EdgeInsets helper inits #138

merged 3 commits into from
Nov 14, 2023

Conversation

olejnjak
Copy link
Member

@olejnjak olejnjak commented Nov 8, 2023

When working with EdgeInsets in SwiftUI, we often use same insets for all edges. Usually it can be solved by using .padding(5) modifier and not .padding(EdgeInsets(...)) but once insets become a parameter or return value, working with it becomes a bit annoying, thanks to these new initializers, it will be less annoying.

Wanted to add also expressible by literal conformances, but that makes view.padding(5) ambiguous so not doing that.

Checklist

  • Added tests (if applicable)

@olejnjak olejnjak self-assigned this Nov 8, 2023
@olejnjak olejnjak enabled auto-merge (squash) November 8, 2023 23:23
@olejnjak
Copy link
Member Author

@LukasHromadnik @leinhauplk 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in filename

Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Why do you have two identical files with tests? I would prefer one file in two target. As in the case of EdgeInsetsExtensions.swift.

Copy link
Member Author

Choose a reason for hiding this comment

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

That will be fixed once #140 is merged, so we can live with that for now I think 🙂

@olejnjak olejnjak merged commit cc68023 into main Nov 14, 2023
7 checks passed
@olejnjak olejnjak deleted the edgeinsets branch November 14, 2023 07:08
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