Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cartfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ github "Anviking/Decodable" "master"
github "Hearst-DD/ObjectMapper" ~> 2.2
github "vdka/json" ~> 0.15
github "hkellaway/Gloss" "master"
github "LoganWright/Genome" == 3.0.3
github "LoganWright/Genome" == 3.0.3
github "evermeer/EVReflection" "master"
5 changes: 3 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
github "Anviking/Decodable" "5cbd5cf2a13376e11f8c8808c437c7e8f9e45e27"
github "evermeer/EVReflection" "a53304c7be4fb59faa6b5ff45e7345b410990022"
github "LoganWright/Genome" "3.0.3"
github "hkellaway/Gloss" "731d09219477c1765505473af6d5152dc968d778"
github "utahiosmac/Marshal" "5dac3b70996bbba099709528f183512ad01c7f55"
github "utahiosmac/Marshal" "ba0c55e5edfc216aae486229f6f5456ce3db4473"
github "Hearst-DD/ObjectMapper" "2.2.0"
github "SwiftyJSON/SwiftyJSON" "6a0c3a82e2b4a07723b4958146315c7928220189"
github "SwiftyJSON/SwiftyJSON" "ffbc7e4b8ee0e9ec76966007e7a7bef659aea284"
github "JohnSundell/Unbox" "0be5e80a43b247a10d4a2f08150b847c7e784967"
github "vdka/json" "0.15.0"
github "lyft/mapper" "8f5b51bee8627eaa162eb42953ef0a6521880041"
56 changes: 51 additions & 5 deletions JSONShootout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
7C3FCD311DC1B2A100C82DEE /* Program+Gloss.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C3FCD301DC1B2A100C82DEE /* Program+Gloss.swift */; };
7C3FCD331DC1B2AE00C82DEE /* Recording+Gloss.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C3FCD321DC1B2AE00C82DEE /* Recording+Gloss.swift */; };
7C3FCD351DC1B61600C82DEE /* Gloss_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C3FCD341DC1B61600C82DEE /* Gloss_Tests.swift */; };
7F53096D1DC7E53300BD0C9B /* EVReflection.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F53096C1DC7E53300BD0C9B /* EVReflection.framework */; };
7F53096F1DC7E56000BD0C9B /* EVReflection.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F53096E1DC7E56000BD0C9B /* EVReflection.framework */; };
7F5309711DC7E58800BD0C9B /* EVReflection.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F5309701DC7E58800BD0C9B /* EVReflection.framework */; };
7F5309721DC7E58800BD0C9B /* EVReflection.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7F5309701DC7E58800BD0C9B /* EVReflection.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
7F5309741DC7E63900BD0C9B /* RecordingObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F5309731DC7E63900BD0C9B /* RecordingObject.swift */; };
7F5309761DC7E65A00BD0C9B /* ProgramObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F5309751DC7E65A00BD0C9B /* ProgramObject.swift */; };
7F5309781DC7E66D00BD0C9B /* Recording+EVReflection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F5309771DC7E66D00BD0C9B /* Recording+EVReflection.swift */; };
7F53097A1DC7E67800BD0C9B /* Program+EVReflection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F5309791DC7E67800BD0C9B /* Program+EVReflection.swift */; };
7F53097C1DC7E68A00BD0C9B /* EVReflection_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F53097B1DC7E68A00BD0C9B /* EVReflection_Tests.swift */; };
AA2B38CB1DC0B4AE008CECCD /* JSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA2B38CA1DC0B4AE008CECCD /* JSON.framework */; };
AA2B38CC1DC0B4AE008CECCD /* JSON.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AA2B38CA1DC0B4AE008CECCD /* JSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
AA2B38D01DC0B4D2008CECCD /* Program+JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA2B38CD1DC0B4CC008CECCD /* Program+JSON.swift */; };
Expand Down Expand Up @@ -111,6 +120,7 @@
CC3023421CF9616600B51746 /* Unbox.framework in Embed Frameworks */,
CCFD5B571D0A71990021C2B3 /* SwiftyJSON.framework in Embed Frameworks */,
716A8A9B1DC1D10A00BF314B /* Gloss.framework in Embed Frameworks */,
7F5309721DC7E58800BD0C9B /* EVReflection.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -122,7 +132,7 @@
20A0B9561DC2584D001D8A14 /* Recording+Genome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Recording+Genome.swift"; sourceTree = "<group>"; };
20A0B9581DC25B60001D8A14 /* Program+Genome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Program+Genome.swift"; sourceTree = "<group>"; };
20A0B95A1DC25F03001D8A14 /* Genome_Test.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Genome_Test.swift; sourceTree = "<group>"; };
20A0B9691DC26803001D8A14 /* GenomeFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GenomeFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
20A0B9691DC26803001D8A14 /* GenomeFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GenomeFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5B69A1D91DBEC84200B12579 /* Recording+Decodable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Recording+Decodable.swift"; sourceTree = "<group>"; };
5B69A1DB1DBEC86A00B12579 /* Program+Decodable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Program+Decodable.swift"; sourceTree = "<group>"; };
5B69A1DD1DBEC9A400B12579 /* Decodable_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Decodable_Tests.swift; sourceTree = "<group>"; };
Expand All @@ -145,6 +155,14 @@
7C3FCD301DC1B2A100C82DEE /* Program+Gloss.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Program+Gloss.swift"; sourceTree = "<group>"; };
7C3FCD321DC1B2AE00C82DEE /* Recording+Gloss.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Recording+Gloss.swift"; sourceTree = "<group>"; };
7C3FCD341DC1B61600C82DEE /* Gloss_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Gloss_Tests.swift; sourceTree = "<group>"; };
7F53096C1DC7E53300BD0C9B /* EVReflection.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EVReflection.framework; path = "Carthage/Checkouts/EVReflection/EVReflection/build/Debug-iphoneos/EVReflection.framework"; sourceTree = "<group>"; };
7F53096E1DC7E56000BD0C9B /* EVReflection.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EVReflection.framework; path = "Carthage/Checkouts/EVReflection/EVReflection/build/Debug-iphoneos/EVReflection.framework"; sourceTree = "<group>"; };
7F5309701DC7E58800BD0C9B /* EVReflection.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = EVReflection.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7F5309731DC7E63900BD0C9B /* RecordingObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecordingObject.swift; sourceTree = "<group>"; };
7F5309751DC7E65A00BD0C9B /* ProgramObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgramObject.swift; sourceTree = "<group>"; };
7F5309771DC7E66D00BD0C9B /* Recording+EVReflection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Recording+EVReflection.swift"; sourceTree = "<group>"; };
7F5309791DC7E67800BD0C9B /* Program+EVReflection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Program+EVReflection.swift"; sourceTree = "<group>"; };
7F53097B1DC7E68A00BD0C9B /* EVReflection_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVReflection_Tests.swift; sourceTree = "<group>"; };
AA2B38CA1DC0B4AE008CECCD /* JSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JSON.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AA2B38CD1DC0B4CC008CECCD /* Program+JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = "Program+JSON.swift"; sourceTree = "<group>"; tabWidth = 4; };
AA2B38D11DC0B57F008CECCD /* Recording+JSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Recording+JSON.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -180,6 +198,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7F53096F1DC7E56000BD0C9B /* EVReflection.framework in Frameworks */,
20A0B96B1DC26810001D8A14 /* GenomeFoundation.framework in Frameworks */,
2098D54A1DC1F5E800A15075 /* Genome.framework in Frameworks */,
681299051DBFFCAB009960BE /* ObjectMapper.framework in Frameworks */,
Expand All @@ -190,6 +209,7 @@
AA2B38CB1DC0B4AE008CECCD /* JSON.framework in Frameworks */,
CC3023451CF9616700B51746 /* Mapper.framework in Frameworks */,
CC9786B31CEBABE7005A5DEA /* ModelObjects.framework in Frameworks */,
7F5309711DC7E58800BD0C9B /* EVReflection.framework in Frameworks */,
CC3023411CF9616600B51746 /* Unbox.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -206,6 +226,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7F53096D1DC7E53300BD0C9B /* EVReflection.framework in Frameworks */,
2098D54C1DC1F5FB00A15075 /* Genome.framework in Frameworks */,
716A8A9D1DC1D18B00BF314B /* JSON.framework in Frameworks */,
716A8A981DC1D0E900BF314B /* Gloss.framework in Frameworks */,
Expand All @@ -224,6 +245,8 @@
7C3FCD281DC1B16100C82DEE /* Frameworks */ = {
isa = PBXGroup;
children = (
7F53096E1DC7E56000BD0C9B /* EVReflection.framework */,
7F53096C1DC7E53300BD0C9B /* EVReflection.framework */,
2098D5491DC1F5E800A15075 /* Genome.framework */,
7C3FCD2D1DC1B19E00C82DEE /* Gloss.framework */,
AA2B38CA1DC0B4AE008CECCD /* JSON.framework */,
Expand All @@ -243,6 +266,7 @@
CC5A19F51CEADE59007238F3 = {
isa = PBXGroup;
children = (
7F5309701DC7E58800BD0C9B /* EVReflection.framework */,
CC5A1A001CEADE59007238F3 /* JSONShootout */,
CC5A1A151CEADE59007238F3 /* JSONShootoutTests */,
CC97869F1CEBABE7005A5DEA /* ModelObjects */,
Expand Down Expand Up @@ -286,6 +310,7 @@
681299171DC00DB1009960BE /* ObjectMapper_Test.swift */,
CC3023491CF9692700B51746 /* Unbox_Tests.swift */,
AA2B38D31DC0B6D3008CECCD /* JSON_Tests.swift */,
7F53097B1DC7E68A00BD0C9B /* EVReflection_Tests.swift */,
CC5A1A4C1CEAE182007238F3 /* Large.json */,
CC5A1A181CEADE59007238F3 /* Info.plist */,
);
Expand All @@ -298,6 +323,8 @@
CC9786A01CEBABE7005A5DEA /* ModelObjects.h */,
CC9786A21CEBABE7005A5DEA /* Info.plist */,
CC9786BB1CEBAC14005A5DEA /* Recording.swift */,
7F5309731DC7E63900BD0C9B /* RecordingObject.swift */,
7F5309751DC7E65A00BD0C9B /* ProgramObject.swift */,
CC9786BD1CEBAC21005A5DEA /* Program.swift */,
CC9786BF1CEBAC6C005A5DEA /* NSDate+JSON.swift */,
71337C8A1DBEBC6B00DCA374 /* Recording+Marshal.swift */,
Expand All @@ -309,6 +336,7 @@
AA2B38D11DC0B57F008CECCD /* Recording+JSON.swift */,
7C3FCD321DC1B2AE00C82DEE /* Recording+Gloss.swift */,
20A0B9561DC2584D001D8A14 /* Recording+Genome.swift */,
7F5309771DC7E66D00BD0C9B /* Recording+EVReflection.swift */,
71337C921DBEBFB400DCA374 /* Program+Marshal.swift */,
71337C941DBEBFC300DCA374 /* Program+Mapper.swift */,
71337C961DBEBFD000DCA374 /* Program+Unbox.swift */,
Expand All @@ -318,6 +346,7 @@
AA2B38CD1DC0B4CC008CECCD /* Program+JSON.swift */,
7C3FCD301DC1B2A100C82DEE /* Program+Gloss.swift */,
20A0B9581DC25B60001D8A14 /* Program+Genome.swift */,
7F5309791DC7E67800BD0C9B /* Program+EVReflection.swift */,
);
path = ModelObjects;
sourceTree = "<group>";
Expand Down Expand Up @@ -485,6 +514,7 @@
AA2B38D41DC0B6D3008CECCD /* JSON_Tests.swift in Sources */,
5B69A1DE1DBEC9A400B12579 /* Decodable_Tests.swift in Sources */,
CCD5105B1CFFFF7000E9C0D1 /* SwiftyJSON_Tests.swift in Sources */,
7F53097C1DC7E68A00BD0C9B /* EVReflection_Tests.swift in Sources */,
7C3FCD351DC1B61600C82DEE /* Gloss_Tests.swift in Sources */,
681299181DC00DB1009960BE /* ObjectMapper_Test.swift in Sources */,
);
Expand All @@ -496,6 +526,7 @@
files = (
71337C8F1DBEBC8600DCA374 /* Recording+Unbox.swift in Sources */,
6812991C1DC00DBB009960BE /* Recording+ObjectMapper.swift in Sources */,
7F5309741DC7E63900BD0C9B /* RecordingObject.swift in Sources */,
71337C971DBEBFD000DCA374 /* Program+Unbox.swift in Sources */,
CC9786BE1CEBAC21005A5DEA /* Program.swift in Sources */,
71337C8D1DBEBC7900DCA374 /* Recording+Mapper.swift in Sources */,
Expand All @@ -506,13 +537,16 @@
5B69A1DA1DBEC84200B12579 /* Recording+Decodable.swift in Sources */,
AA2B38D01DC0B4D2008CECCD /* Program+JSON.swift in Sources */,
7C3FCD311DC1B2A100C82DEE /* Program+Gloss.swift in Sources */,
7F5309781DC7E66D00BD0C9B /* Recording+EVReflection.swift in Sources */,
5B69A1DC1DBEC86A00B12579 /* Program+Decodable.swift in Sources */,
7C3FCD331DC1B2AE00C82DEE /* Recording+Gloss.swift in Sources */,
7F5309761DC7E65A00BD0C9B /* ProgramObject.swift in Sources */,
AA2B38D21DC0B57F008CECCD /* Recording+JSON.swift in Sources */,
71337C911DBEBCA300DCA374 /* Recording+SwiftyJSON.swift in Sources */,
20A0B9571DC2584D001D8A14 /* Recording+Genome.swift in Sources */,
71337C951DBEBFC300DCA374 /* Program+Mapper.swift in Sources */,
71337C8B1DBEBC6B00DCA374 /* Recording+Marshal.swift in Sources */,
7F53097A1DC7E67800BD0C9B /* Program+EVReflection.swift in Sources */,
20A0B9591DC25B60001D8A14 /* Program+Genome.swift in Sources */,
CC9786BC1CEBAC14005A5DEA /* Recording.swift in Sources */,
);
Expand Down Expand Up @@ -646,7 +680,10 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Checkouts/EVReflection/EVReflection/build/Debug-iphoneos",
);
INFOPLIST_FILE = JSONShootout/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.swift-bit.JSONShootout";
Expand All @@ -660,7 +697,10 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Checkouts/EVReflection/EVReflection/build/Debug-iphoneos",
);
INFOPLIST_FILE = JSONShootout/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.swift-bit.JSONShootout";
Expand Down Expand Up @@ -703,7 +743,10 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Checkouts/EVReflection/EVReflection/build/Debug-iphoneos",
);
INFOPLIST_FILE = ModelObjects/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand All @@ -728,7 +771,10 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Checkouts/EVReflection/EVReflection/build/Debug-iphoneos",
);
INFOPLIST_FILE = ModelObjects/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down
3 changes: 3 additions & 0 deletions JSONShootout.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions JSONShootoutTests/EVReflection_Tests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// EVReflection_Tests.swift
// JSONShootout
//
// Created by Edwin Vermeer on 26/10/2016.
// Copyright © 2016 SwiftBit. All rights reserved.
//

import XCTest
import ModelObjects
import EVReflection

class EVReflection_Tests: XCTestCase {

func testDeserialization() {
self.measure {
let d:NSDictionary = try! JSONSerialization.jsonObject(with: self.data, options: []) as! NSDictionary
XCTAssert(d.count > 0)
}
}

func testPerformance() {
EVReflection.setBundleIdentifier(ProgramObject.self)
self.measure {
let programs = [ProgramObject](data: self.data, forKeyPath: "ProgramList.Programs")
XCTAssert(programs.count > 1000)
}
}


private lazy var data:Data = {
let path = Bundle(for: type(of: self)).url(forResource: "Large", withExtension: "json")
let data = try! Data(contentsOf: path!)
return data
}()

}
16 changes: 16 additions & 0 deletions ModelObjects/Program+EVReflection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Program+EVReflection.swift
// JSONShootout
//
// Created by Edwin Vermeer on 26/10/2016.
// Copyright © 2016 SwiftBit. All rights reserved.
//

import EVReflection

// If you change the base class of ProgramObject from NSObject to EVObject then you don't need this extension.
extension ProgramObject : EVReflectable {
public override func setValue(_ value: Any?, forUndefinedKey key: String) {
// Easy way to ignore all unknown keys
}
}
20 changes: 20 additions & 0 deletions ModelObjects/ProgramObject.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// ProgramObject.swift
// JSONShootout
//
// Created by Edwin Vermeer on 27/10/2016.
// Copyright © 2016 SwiftBit. All rights reserved.
//

public class ProgramObject: NSObject {
var title:String?
var chanId:String?
// Date parsing is slow. Remove dates to better measure performance.
// let startTime:NSDate
// let endTime:NSDate
var Description:String?
var subtitle:String?
var recording:RecordingObject?
var season:NSNumber?
var episode:NSNumber?
}
16 changes: 16 additions & 0 deletions ModelObjects/Recording+EVReflection.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Recording+EVReflection.swift
// JSONShootout
//
// Created by Edwin Vermeer on 26/10/2016.
// Copyright © 2016 SwiftBit. All rights reserved.
//

import EVReflection

// If you change the base class of RecordingObject from NSObject to EVObject then you don't need this extension.
extension RecordingObject: EVReflectable {
public override func setValue(_ value: Any?, forUndefinedKey key: String) {
// Easy way to ignore all unknown keys
}
}
31 changes: 31 additions & 0 deletions ModelObjects/RecordingObject.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// RecordingObject.swift
// JSONShootout
//
// Created by Edwin Vermeer on 27/10/2016.
// Copyright © 2016 SwiftBit. All rights reserved.
//

class RecordingObject: NSObject {
enum Status: String {
case None = "0"
case Recorded = "-3"
case Recording = "-2"
case Unknown
}

enum RecGroup: String {
case Deleted = "Deleted"
case Default = "Default"
case LiveTV = "LiveTV"
case Unknown
}

// Date parsing is slow. Remove dates to better measure performance.
// var startTs:NSDate?
// var endTs:NSDate?
var startTsStr:String?
var status:Status?
var recordId:String?
var recGroup:RecGroup?
}