A SwiftUI View for Easily Modifying UserDefaults Values for Debugging.
| UserDefaultsEditor | Edit Date | Edit Array |
|---|---|---|
UserDefaultsEditor uses the EditValueView for its value modification views. For more information about EditValueView, please visit their GitHub repository.
For displaying the view with a push transition, please set presentationStyle to .push. For modal presentation, select .modal.
UserDefaultsEditor( userDefaults: .standard, presentationStyle: .push // or .modal )
You can filter which keys are displayed using the keyFilter parameter. This is useful for debugging specific parts of your app or hiding sensitive data.
// Only show keys that start with "app" UserDefaultsEditor( userDefaults: .standard, keyFilter: { key in key.hasPrefix("app") }, presentationStyle: .push ) // Hide system keys and only show custom keys UserDefaultsEditor( userDefaults: .standard, keyFilter: { key in !key.hasPrefix("NS") && !key.hasPrefix("Apple") && !key.hasPrefix("com.apple") }, presentationStyle: .modal )