CodingUserInfoKey

public extension CodingUserInfoKey

Provided for relative-path coding. See the instructions in our README.

  • If set on an Encoder’s userInfo all paths are encoded relative to this path.

    For example:

    let encoder = JSONEncoder()
    encoder.userInfo[.relativePath] = Path.home
    encoder.encode([Path.home, Path.home/"foo"])
    

    Remark

    See the README for more information.

    Declaration

    Swift

    static let relativePath: CodingUserInfoKey