DocumentData

1.0.1

A data persistence library like SwiftData, and persist all the data into Property List Document.
Plan-V-Studio/DocumentData

What's New

v1.0.1

2024-01-27T20:24:28Z

New Features

  • New url methods allow to get the url of the persistence file.
  • New @ModelCodingKey macro allow developer customize the coding key of persistence model.

What's Changed

Full Changelog: v1.0.0...v1.0.1

To import documentation, see notes of Release v1.0.0

You can also view documentation in Swift Package Index.

Document Data

Swift Version Compatible Platforms

GitHub License GitHub Release

A data persistence library like SwiftData, and persist all the data into Property List Document.

Setup

First, you need to add this library to your project by using Swift Package Manager. Open your Xcode, go to File > Add Package Dependencies... Then, copy https://github.com/Plan-V-Studio/DocumentData to the search bar, choose the first library and configure your updating method.

If you are using Swift Package, add the code below to your dependencies in Package.swift file.

.package(url: "https://github.com/Plan-V-Studio", branch: "main")

Quick Start

To use Document Data, you need to create your data model first. This is an example for create a model to storing user's data.

class UserData {
    var username: String
    var password: Data
    var universalID: UUID
}

Then, add @PersistedModel macro before the class declaration.

@PersistedModel
class UserData {
  // ...
}

@PersistedModel macro will automatically convert this data model to a persistence data model, and store UserData.storage.plist file in /Container/Application Support/ of your app.

Tip

Persisence file's name will autimatically use its data model's name, to customize you model name, download documentation in release page.

Documentation

Document Data use DocC to generate documentation, you can download compiled document in release page.

Statememt

This is beta software, which means that none of the features and methods of the library have been systematically tested. Plan-V Studio will not be responsible for any direct or indirect loss caused by your use of this library.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Fri Apr 12 2024 21:53:48 GMT-0900 (Hawaii-Aleutian Daylight Time)