{"repo":"pointfreeco/swift-sharing","free":true,"listed":false,"github":"https://github.com/pointfreeco/swift-sharing","clone":"git clone https://github.com/pointfreeco/swift-sharing.git","description":"A universal solution to persistence and data sharing in surprisingly little code.","language":"Swift","stars":797,"topics":["appstorage","filestorage","persistence","swiftui","userdefaults"],"license":"MIT","category":"mobile-apps","readme_excerpt":"Sharing Instantly share state among your app's features and external persistence layers, including user defaults, the file system, and more. Learn more Overview Demos Documentation Installation Community License Learn more This library was motivated and designed over the course of many episodes on Point-Free, a video series exploring advanced programming topics in the Swift language, hosted by Brandon Williams and Stephen Celis. Overview This library comes with a few tools that allow one to share state with multiple parts of your application, as well as external systems such as user defaults, the file system, and more. The tool works in a variety of contexts, such as SwiftUI views, @Observable models, and UIKit view controllers, and it is completely unit testable. As a simple example, you can have two different observable models hold onto a collection of data that is also synchronized to the file system: [!NOTE] Due to the fact that Swift macros do not play nicely with property wrappers, you must annotate each @Shared held by an @Observable model with @ObservationIgnored . Views will still update when shared state changes since @Shared handles its own observation. If either model makes a change to meetings , the other model will instantly see those changes. And further, if the file on disk changes from an external write, both instances of @Shared will also update to hold the freshest data. Automatic persistence The [ @Shared ][shared-article] property wrapper gives you a succ","default_branch":null,"files":null,"tree":[],"storefront":"/r/pointfreeco","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pointfreeco/swift-sharing/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}