Git Product home page Git Product logo

goodrequest / goodpersistence Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 1.0 407 KB

💾 GoodPersistence is an iOS library that simplifies caching data in keychain and UserDefaults. Using a property wrapper, it reduces the complexity of implementing caching mechanisms, making it easier for developers to focus on app functionality. Compatible with latest Swift and supports all iOS devices. Easy to install with SPM.

License: MIT License

Swift 100.00%
ios keychain library persistence swift userdefaults

goodpersistence's People

Contributors

andrej-jasso avatar dominikpetho avatar marekvrican avatar matusklasovity avatar sebastianmraz avatar xaferis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zshannon

goodpersistence's Issues

Cannot find 'KeychainWrapper' in scope

I am unable to use KeychainWrapper. It gives me Cannot find 'KeychainWrapper' in scope error. Xcode shows this class as unavailable in current scope. @KeychainValue decorator works correctly though. I imported required modules.

I did the Project Clean / Clean Derived Data / Xcode Restart.

image
  • Device: iPhone 15 Pro Simulator
  • Xcode: Version 15.4 (15F31d)
  • Version 2.3.0

Does anyone have an idea what might be wrong?

Keychain storage thread safety

Describe the bug
Accessing keychain value saving from multiple thread at ones fails to register into publisher.

To Reproduce
Steps to reproduce the behavior:
Tests that fail written in this branch
feature/multithreadedStorageTests

Expected behavior
All values are registered in the publisher.

Suggested
Actor support would fix this.

Using valuePublisher completes on first error

Describe the bug
In case we are subscribed to valuePublisher, after first error passed to subject, subject completes and is not reinitialized. After error we are unable to receive new values passed to keychain.

To Reproduce
Steps to reproduce the behavior:

  1. Create Keychain
  2. Subscribe to valuePublisher
  3. Try to force error inside keychain property
  4. Pass valid value to property
  5. New value is not receiver in valuePublisher

Expected behavior
After receiving error, I am able to receive next values.

Additional context
Suggested solution:

  1. private let newSubject: PassthroughSubject<Either<T, KeychainError>, Never> = PassthroughSubject()
  2. private let newSubject: PassthroughSubject<Event<T, KeychainError>, Never> = PassthroughSubject()

SwiftUI Dynamic Property integration

In SwiftUI there is a property wrapper @AppStorage that gives developer the ability to store raw data (Strings, numbers, booleans, URLs) in cache. User interface then automatically updates itself when the underlying data change.

It should be possible to integrate the same functionality using DynamicProperty protocol into GoodPersistence property wrappers to extend system functionality to save any Codable data as JSON string, automatically (de)serialize when required, and auto-update the UI on property change.

It might be possible to integrate the same functionality for values stored in keychain also.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.