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 conditional view modifier transformation #33

Merged
merged 6 commits into from Feb 28, 2024

Conversation

philippzagar
Copy link
Member

Add conditional view modifier transformation

♻️ Current situation & Problem

As of now, there's no convenient way to conditionally apply view modifiers to a SwiftUI View.
This feature would be highly useful in order to prevent duplication of code.

⚙️ Release Notes

  • Add conditional view modifier transformation via .if(_:, transformation:) and .if(condition:, transformation:)

📚 Documentation

Properly documented added view modifiers with code examples

✅ Testing

Added proper UI tests

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@philippzagar philippzagar added the enhancement New feature or request label Feb 27, 2024
@philippzagar philippzagar self-assigned this Feb 27, 2024
@philippzagar philippzagar enabled auto-merge (squash) February 27, 2024 03:16
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.72%. Comparing base (1cf188c) to head (c6c462a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
+ Coverage   79.48%   79.72%   +0.24%     
==========================================
  Files          40       41       +1     
  Lines        1228     1242      +14     
==========================================
+ Hits          976      990      +14     
  Misses        252      252              
Files Coverage Δ
.../SpeziViews/ViewModifier/ConditionalModifier.swift 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1cf188c...c6c462a. Read the comment docs.

Copy link
Member

@Supereg Supereg left a comment

Choose a reason for hiding this comment

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

Handy feature. Great to see this implemented. Great documentation as well 🚀

@philippzagar philippzagar merged commit 4d2a724 into main Feb 28, 2024
13 checks passed
@philippzagar philippzagar deleted the feat/add-conditional-view-modifier branch February 28, 2024 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants