Releases: alexruperez/SecurePropertyStorage
Releases · alexruperez/SecurePropertyStorage
v0.8.2
v0.8.1
🔒 Concurrency and Sendable
This library is designed with Swift's modern concurrency features in mind. Access to the underlying storage mechanisms (UserDefaults, Keychain, etc.) is serialized through a global actor (StorageActor), preventing data races during read and write operations performed by the library itself.
However, for your application to be fully concurrency-safe when using this library, it is crucial that the types you store and retrieve are Sendable.
- Generic Types: When using generic property wrappers or methods like
@Store var item: MyType?,storage.value(forKey: "key") as? MyType, orstorage.decodable(forKey: "key") as? MyDecodableType, ensure thatMyTypeandMyDecodableTypeconform to theSendableprotocol. - Object Archiving: If you use methods that rely on
NSKeyedArchiver(such asstorage.set(object: myNSObject, forKey: "key")), the classmyNSObjectshould conform toNSSecureCodingfor security and also beSendablefor concurrency safety. - Why is
Sendableimportant?: While the library ensures that the act of storing or retrieving data is safe, if the data itself (e.g., a class instance) is notSendable, then passing it across different concurrent tasks or actors after retrieval can lead to data races if the data is mutable. Conforming toSendablehelps Swift enforce that such types can be safely shared.
Enabling strict concurrency checking in your project's build settings (e.g., "Strict Concurrency Checking" set to "Complete" in Xcode) is highly recommended to help identify potential concurrency issues at compile time.
v0.8.0
v0.7.1
v0.7.0
v0.6.0
In memory of my friend Haldo Spontón. Rest in peace. 😢
Added
- Register dependencies on error closure.
- More information in InjectError.
Improvements
- Swift Package Manager tools version update to 5.5
v0.5.0
v0.4.2
Fixed
- Carthage compatible fix. #20 Thanks @AlbGarciam!
Improvements
- Swift Package Manager tools version update to 5.3