Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
savePlist arg added: format, Default .binary
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonm23 committed Sep 6, 2023
1 parent 6584e98 commit 7a3fe20
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public func loadPlist(path: String) -> [String: Any] {
return plist
}

public func savePlist(path: String, plist: [String: Any]) {
public func savePlist(path: String, plist: [String: Any], format: PropertyListSerialization.PropertyListFormat = .binary) {
guard let data = try? PropertyListSerialization.data(
fromPropertyList: plist,
format: .xml,
format: format,
options: 0
) else {
fatalError("Cannot convert plist to data")
Expand Down

0 comments on commit 7a3fe20

Please sign in to comment.