Skip to content

Commit a06922a

Browse files
authored
Merge pull request #2097 from millenomi/nskeyedarchiver-no-openstep
Parity: NSKeyedArchiver: Consider response to setting an output format other than .xml or .binary
2 parents 1d9abe0 + bfa3d02 commit a06922a

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)