Open Classswift 6.0.1FoundationEssentials
PropertyListEncoder
PropertyListEncoder
facilitates the encoding of Encodable
values into property lists.
- iOS
- 8.0+
- macOS
- 10.10+
- tvOS
- 9.0+
- watchOS
- 2.0+
class PropertyListEncoder
PropertyListEncoder
facilitates the encoding of Encodable
values into property lists.
class PropertyListEncoder
import FoundationEssentials
protocol Sendable
init()
Initializes self
with default strategies.
var outputFormat: PropertyListDecoder.PropertyListFormat { get set }
The output format to write the property list data in. Defaults to .binary
.
var userInfo: [CodingUserInfoKey : Any] { get set }
Contextual user-provided information for use during encoding.
func encode<Value>(_ value: Value) throws -> Data where Value : Encodable
Encodes the given top-level value and returns its property list representation.
func encode<T>(_ value: T, configuration: T.EncodingConfiguration) throws -> Data where T : EncodableWithConfiguration
func encode<T, C>(_ value: T, configuration: C.Type) throws -> Data where T : EncodableWithConfiguration, C : EncodingConfigurationProviding, T.EncodingConfiguration == C.EncodingConfiguration