Skip to content

orchetect/swift-plist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

139 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swift-plist

License: MIT

A multi-platform Swift library bringing functional methods and type safety to .plist (Property List) files.

Motivation

The challenges that Apple's standard PropertyListSerialization presents:

  1. Lack of type safety which allows the inadvertent injection of incompatible value types, which can lead to unexpected errors when saving a plist file later on, and are difficult to diagnose
  2. Root-level dictionary access only, making traversal of nested dictionaries very cumbersome
  3. Deals in NS value types which is not very Swifty and requires extra boilerplate at every interaction

swift-plist solves these issues by:

  1. Acting as a safe and convenient wrapper for PropertyListSerialization
  2. Providing clean functional syntax for
    • easily manipulating nested keys and values in dictionary trees
    • loading and saving plist files
  3. Dealing in native Swift value types for keys and values
  4. Preventing the inadvertent use of incompatible value types to avoid unexpected errors due to lack of type safety

Installation

Swift Package Manager (SPM)

To add this package to an Xcode app project, use:

https://github.com/orchetect/xctest-extensions as the URL.

To add this package to a Swift package, add the dependency to your package and target in Package.swift:

let package = Package(
    dependencies: [
        .package(url: "https://github.com/orchetect/swift-plist", from: "3.0.0")
    ],
    targets: [
        .target(
            dependencies: [
                .product(name: "SwiftPList", package: "swift-plist")
            ]
        )
    ]
)

Documentation

See the online documentation or view it in Xcode's documentation browser by selecting the Product → Build Documentation menu.

Resources

Author

Coded by a bunch of 🐹 hamsters in a trenchcoat that calls itself @orchetect.

License

Licensed under the MIT license. See LICENSE for details.

Community & Support

Please do not email maintainers for technical support. Several options are available for issues and questions:

  • Questions and feature ideas can be posted to Discussions.
  • If an issue is a verifiable bug with reproducible steps it may be posted in Issues.

Contributions

Contributions are welcome. Posting in Discussions first prior to new submitting PRs for features or modifications is encouraged.

Code Quality & AI Contribution Policy

In an effort to maintain a consistent level of code quality and safety, this repository was built by hand and is maintained without the use of AI code generation.

AI-assisted contributions are welcome, but must remain modest in scope, maintain the same degree of quality and care, and be thoroughly vetted before acceptance.

Legacy

This repository was formerly known as PListKit.

About

Swift library for easily reading/writing plist (Property List) files.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors

Languages