Skip to content

add support for multiple preference types #61

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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

ZvonimirMedak
Copy link
Collaborator

Summary

Based on #32 I have added support for multiple preference types in SwiftUI

Changes

Type

  • Feature: This pull request introduces a new feature.
  • Bug fix: This pull request fixes a bug.
  • Refactor: This pull request refactors existing code.
  • Documentation: This pull request updates documentation.
  • Other: This pull request makes other changes.

Additional information

  • This pull request introduces a breaking change.

Description

This PR adds a PreferenceItem protocol which will be used on the Preferences screen.
Added the support for Text, Int, Float, Double, and picker (CustomStringConvertible + RawRepresentable).
There are also validators which can be used with those items.
The UI has also been updated to have a description label below the item which will show the description or the last error message from the Validator

Checklist

  • I have performed a self-review of my own code.
  • I have tested my changes, including edge cases.
  • I have added necessary tests for the changes introduced (if applicable).
  • I have updated the documentation to reflect my changes (if applicable).

Additional notes

The ToggleToolItem kept the same name due to it already existing in Sentinel, maybe we can create a type alias which would be PreferenceBoolItem, and then we could use both without creating a breaking change.

@ZvonimirMedak ZvonimirMedak added the enhancement New feature or request label Mar 21, 2025
@ZvonimirMedak ZvonimirMedak added this to the 2.3.0 milestone Mar 21, 2025
@ZvonimirMedak ZvonimirMedak self-assigned this Mar 21, 2025
Base automatically changed from feature/database-import-export to master April 16, 2025 12:23
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
None yet
Development

Successfully merging this pull request may close these issues.

1 participant