Skip to content

Commit bfa3d02

Browse files
committed
Parity: NSKeyedArchiver: Parity: NSKeyedArchiver: Consider response to setting an output format other than .xml or .binary
NSUnimplemented() is a marker for yet-to-be-implemented functionality. We do not support .openStep as a format at all; move this to fatalError() instead, since setting .openStep is a programmer error on Darwin.
1 parent 049b8d4 commit bfa3d02

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Foundation/NSKeyedArchiver.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ open class NSKeyedArchiver : NSCoder {
9999
/// The available formats are `xml` and `binary`.
100100
open var outputFormat = PropertyListSerialization.PropertyListFormat.binary {
101101
willSet {
102-
if outputFormat != .xml &&
103-
outputFormat != .binary {
104-
NSUnimplemented()
102+
guard (newValue == .xml || newValue == .binary) else {
103+
fatalError("Unsupported format: \(newValue)")
105104
}
106105
}
107106
}

0 commit comments

Comments
 (0)