This commit is contained in:
Pfeil, Scott Robert 2019-11-05 12:32:32 -05:00
parent 5b8fce36e6
commit 4a1a196854
4 changed files with 6 additions and 6 deletions

View File

@ -466,13 +466,13 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
017BEB392360EEB40024EF95 /* PageModel.swift */, 017BEB392360EEB40024EF95 /* PageModel.swift */,
01EB368723609801006832FA /* Molecules */,
01EB3685236097F1006832FA /* MoleculeHolder.swift */, 01EB3685236097F1006832FA /* MoleculeHolder.swift */,
01EB3683236097C0006832FA /* MoleculeProtocol.swift */, 01EB3683236097C0006832FA /* MoleculeProtocol.swift */,
01EB367F236092AE006832FA /* Holder.swift */, 01EB367F236092AE006832FA /* Holder.swift */,
01EB3680236092AE006832FA /* HolderManager.swift */, 01EB3680236092AE006832FA /* HolderManager.swift */,
01EB367B2360929F006832FA /* Decoder.swift */, 01EB367B2360929F006832FA /* Decoder.swift */,
01EB367C2360929F006832FA /* Encoder.swift */, 01EB367C2360929F006832FA /* Encoder.swift */,
01EB368723609801006832FA /* Molecules */,
01EB367623609281006832FA /* JSON */, 01EB367623609281006832FA /* JSON */,
); );
path = Models; path = Models;

View File

@ -27,7 +27,7 @@ extension KeyedDecodingContainerProtocol {
} }
extension Decodable { extension Decodable {
public static func decode(fileName: String, bundle: Bundle = Bundle.main) throws -> Self{ public static func decode(fileName: String, bundle: Bundle = Bundle.main) throws -> Self {
guard let path = bundle.path(forResource: fileName, ofType: ".json") else { guard let path = bundle.path(forResource: fileName, ofType: ".json") else {
throw JSONError.pathNotFound throw JSONError.pathNotFound
} }

View File

@ -19,7 +19,7 @@ extension Encodable {
public func toJSONString() -> String? { public func toJSONString() -> String? {
guard let data = try? self.encode(), guard let data = try? self.encode(),
let string = String(data: data, encoding: .utf8) else{ let string = String(data: data, encoding: .utf8) else {
return nil return nil
} }
return string return string

View File

@ -12,5 +12,5 @@ public protocol Holder: Codable {
var name: String { get set } var name: String { get set }
var object: HoldableType { get set } var object: HoldableType { get set }
init (name: String, object: HoldableType) init(name: String, object: HoldableType)
} }