Skip to content

Commit

Permalink
Move functionality to EVReflectable protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
evermeer committed Oct 28, 2016
1 parent f23d7f8 commit b49c04b
Show file tree
Hide file tree
Showing 20 changed files with 670 additions and 473 deletions.
2 changes: 1 addition & 1 deletion EVReflection.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |s|
#

s.name = "EVReflection"
s.version = "3.1.4"
s.version = "3.2.0"
s.summary = "iOS: Swift helper library with reflection functions"
s.description = "Swift helper library with reflection functions including support for NSCoding, Printable, Hashable, Equatable and JSON"
s.homepage = "https://github.com/evermeer/EVReflection"
Expand Down
46 changes: 28 additions & 18 deletions EVReflection/EVReflection.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
2DC8AA401C24215500FA6B8E /* EVReflection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC8AA3F1C24215500FA6B8E /* EVReflection.h */; settings = {ATTRIBUTES = (Public, ); }; };
2DC8AA541C2421D600FA6B8E /* EVReflection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F07C5841AF10284000DF1F3 /* EVReflection.swift */; };
2DC8AA551C2421D600FA6B8E /* EVObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F0E5E591AF4D94000A10E51 /* EVObject.swift */; };
2DC8AA571C2421D600FA6B8E /* EVExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVExtensions.swift */; };
2DC8AA571C2421D600FA6B8E /* EVArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVArrayExtension.swift */; };
2DC8AA661C242E0600FA6B8E /* EVReflectionOSX.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC8AA651C242E0600FA6B8E /* EVReflectionOSX.h */; settings = {ATTRIBUTES = (Public, ); }; };
2DC8AA7C1C242ECC00FA6B8E /* EVReflection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F07C5841AF10284000DF1F3 /* EVReflection.swift */; };
2DC8AA7D1C242ECE00FA6B8E /* EVObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F0E5E591AF4D94000A10E51 /* EVObject.swift */; };
2DC8AA7F1C242ED200FA6B8E /* EVExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVExtensions.swift */; };
2DC8AA7F1C242ED200FA6B8E /* EVArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVArrayExtension.swift */; };
422668011CB77DD800145E17 /* EVReflectionCustomInitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 422667FF1CB77DD000145E17 /* EVReflectionCustomInitTests.swift */; };
422668021CB7802C00145E17 /* EVReflectionCustomInitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 422667FF1CB77DD000145E17 /* EVReflectionCustomInitTests.swift */; };
422668031CB7802D00145E17 /* EVReflectionCustomInitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 422667FF1CB77DD000145E17 /* EVReflectionCustomInitTests.swift */; };
Expand Down Expand Up @@ -92,6 +92,9 @@
7F83A6721D132F6200A4C508 /* EVReflectionIssue96.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F83A66F1D132F5400A4C508 /* EVReflectionIssue96.swift */; };
7F83A6731D132F6300A4C508 /* EVReflectionIssue96.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F83A66F1D132F5400A4C508 /* EVReflectionIssue96.swift */; };
7F8818F91C04447100E17072 /* EVReflectionPropertyMappingTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F8818F81C04447100E17072 /* EVReflectionPropertyMappingTest.swift */; };
7F925AB61DC325E50059F4F2 /* EVReflectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FF033F71DC2A0DF00B25070 /* EVReflectable.swift */; };
7F925AB71DC325E60059F4F2 /* EVReflectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FF033F71DC2A0DF00B25070 /* EVReflectable.swift */; };
7F925AB81DC325E70059F4F2 /* EVReflectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FF033F71DC2A0DF00B25070 /* EVReflectable.swift */; };
7F9336951C23F2EB00AF7076 /* EVReflectionEVObjectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F59F9DA1C07999300C14CF9 /* EVReflectionEVObjectTests.swift */; };
7F9336961C23F2F100AF7076 /* EVReflectionPropertyMappingTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F8818F81C04447100E17072 /* EVReflectionPropertyMappingTest.swift */; };
7F9336971C23F2F700AF7076 /* EVReflectionAssociatedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F59F9D81C07986200C14CF9 /* EVReflectionAssociatedTests.swift */; };
Expand All @@ -100,7 +103,7 @@
7F9336B11C28227400AF7076 /* EVReflectionTVOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 7F9336B01C28227400AF7076 /* EVReflectionTVOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
7F9336C51C28229C00AF7076 /* EVReflection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F07C5841AF10284000DF1F3 /* EVReflection.swift */; };
7F9336C61C28229F00AF7076 /* EVObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F0E5E591AF4D94000A10E51 /* EVObject.swift */; };
7F9336C81C2822A700AF7076 /* EVExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVExtensions.swift */; };
7F9336C81C2822A700AF7076 /* EVArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVArrayExtension.swift */; };
7F9336C91C2822B200AF7076 /* TestObjects.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F41ECA41B91F2E0003A2236 /* TestObjects.swift */; };
7F9336CA1C2822B700AF7076 /* EVReflectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F41ECA81B91F306003A2236 /* EVReflectionTests.swift */; };
7F9336CB1C2822B700AF7076 /* EVReflectionEVObjectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F59F9DA1C07999300C14CF9 /* EVReflectionEVObjectTests.swift */; };
Expand Down Expand Up @@ -131,10 +134,11 @@
7FD67D8E1C288B560071234B /* EVReflectionWatchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FD67D8D1C288B560071234B /* EVReflectionWatchOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
7FD67D931C288B760071234B /* EVReflection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F07C5841AF10284000DF1F3 /* EVReflection.swift */; };
7FD67D941C288B7A0071234B /* EVObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F0E5E591AF4D94000A10E51 /* EVObject.swift */; };
7FD67D961C288B840071234B /* EVExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVExtensions.swift */; };
7FDE786B1DC2154700C2AC1C /* sample.json in Resources */ = {isa = PBXBuildFile; fileRef = 7FDE78661DC2144700C2AC1C /* sample.json */; };
7FDE786C1DC2154900C2AC1C /* sample.json in Resources */ = {isa = PBXBuildFile; fileRef = 7FDE78661DC2144700C2AC1C /* sample.json */; };
7FDE786D1DC2154B00C2AC1C /* sample.json in Resources */ = {isa = PBXBuildFile; fileRef = 7FDE78661DC2144700C2AC1C /* sample.json */; };
7FD67D961C288B840071234B /* EVArrayExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F1BA5261B971CBF009F9DB8 /* EVArrayExtension.swift */; };
7FDC390F1DC358A40091D27E /* sample.json in Resources */ = {isa = PBXBuildFile; fileRef = 7FDC390D1DC3582F0091D27E /* sample.json */; };
7FDC39101DC358A60091D27E /* sample.json in Resources */ = {isa = PBXBuildFile; fileRef = 7FDC390D1DC3582F0091D27E /* sample.json */; };
7FDC39111DC358A70091D27E /* sample.json in Resources */ = {isa = PBXBuildFile; fileRef = 7FDC390D1DC3582F0091D27E /* sample.json */; };
7FF033F81DC2A0E000B25070 /* EVReflectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FF033F71DC2A0DF00B25070 /* EVReflectable.swift */; };
7FF4BEAF1CF0FBF50086F999 /* EVReflectionIssue84.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FF4BEAD1CF0FB920086F999 /* EVReflectionIssue84.swift */; };
7FF4BEB01CF0FBF60086F999 /* EVReflectionIssue84.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FF4BEAD1CF0FB920086F999 /* EVReflectionIssue84.swift */; };
7FF4BEB11CF0FBF80086F999 /* EVReflectionIssue84.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FF4BEAD1CF0FB920086F999 /* EVReflectionIssue84.swift */; };
Expand Down Expand Up @@ -203,7 +207,7 @@
7F07C58E1AF11861000DF1F3 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
7F0E5E591AF4D94000A10E51 /* EVObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = EVObject.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
7F159DFB1BA2FA2F00247CB1 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = "<group>"; };
7F1BA5261B971CBF009F9DB8 /* EVExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVExtensions.swift; sourceTree = "<group>"; };
7F1BA5261B971CBF009F9DB8 /* EVArrayExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVArrayExtension.swift; sourceTree = "<group>"; };
7F1DD7071D90946800E99D4D /* EVReflectionIssue124.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVReflectionIssue124.swift; sourceTree = "<group>"; };
7F1DD7091D90949100E99D4D /* EVReflectionIssue124.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = EVReflectionIssue124.plist; sourceTree = "<group>"; };
7F1E778F1CD343D300F88A9A /* EVReflectionConversionOptionsTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVReflectionConversionOptionsTest.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -262,7 +266,8 @@
7FD67D8B1C288B560071234B /* EVReflection.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EVReflection.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7FD67D8D1C288B560071234B /* EVReflectionWatchOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EVReflectionWatchOS.h; sourceTree = "<group>"; };
7FD67D8F1C288B560071234B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7FDE78661DC2144700C2AC1C /* sample.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = sample.json; path = ../../../AlamofireJsonToObjects/AlamofireJsonToObjectsTests/sample.json; sourceTree = "<group>"; };
7FDC390D1DC3582F0091D27E /* sample.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = sample.json; sourceTree = "<group>"; };
7FF033F71DC2A0DF00B25070 /* EVReflectable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVReflectable.swift; sourceTree = "<group>"; };
7FF4BEAD1CF0FB920086F999 /* EVReflectionIssue84.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVReflectionIssue84.swift; sourceTree = "<group>"; };
7FF4BEB31CF2DA6E0086F999 /* EVReflectionIssue86.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EVReflectionIssue86.swift; sourceTree = "<group>"; };
7FFCCC361BB440F400EE9312 /* coverage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = coverage.png; sourceTree = "<group>"; };
Expand Down Expand Up @@ -380,7 +385,7 @@
7F07C5751AF101A9000DF1F3 /* EVReflectionTests */ = {
isa = PBXGroup;
children = (
7FDE78661DC2144700C2AC1C /* sample.json */,
7FDC390D1DC3582F0091D27E /* sample.json */,
7F41ECA41B91F2E0003A2236 /* TestObjects.swift */,
7F41ECA81B91F306003A2236 /* EVReflectionTests.swift */,
7F59F9DA1C07999300C14CF9 /* EVReflectionEVObjectTests.swift */,
Expand Down Expand Up @@ -421,7 +426,8 @@
children = (
7F07C5841AF10284000DF1F3 /* EVReflection.swift */,
7F0E5E591AF4D94000A10E51 /* EVObject.swift */,
7F1BA5261B971CBF009F9DB8 /* EVExtensions.swift */,
7FF033F71DC2A0DF00B25070 /* EVReflectable.swift */,
7F1BA5261B971CBF009F9DB8 /* EVArrayExtension.swift */,
7F9E68111C67728200F0F4D3 /* EVWorkaroundHelpers.swift */,
);
path = pod;
Expand Down Expand Up @@ -773,7 +779,7 @@
buildActionMask = 2147483647;
files = (
7F1DD70A1D90949100E99D4D /* EVReflectionIssue124.plist in Resources */,
7FDE786B1DC2154700C2AC1C /* sample.json in Resources */,
7FDC390F1DC358A40091D27E /* sample.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -782,7 +788,7 @@
buildActionMask = 2147483647;
files = (
7F1DD70B1D90949100E99D4D /* EVReflectionIssue124.plist in Resources */,
7FDE786C1DC2154900C2AC1C /* sample.json in Resources */,
7FDC39101DC358A60091D27E /* sample.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -810,7 +816,7 @@
buildActionMask = 2147483647;
files = (
7F1DD70C1D90949100E99D4D /* EVReflectionIssue124.plist in Resources */,
7FDE786D1DC2154B00C2AC1C /* sample.json in Resources */,
7FDC39111DC358A70091D27E /* sample.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -863,7 +869,8 @@
7F9E68121C67728200F0F4D3 /* EVWorkaroundHelpers.swift in Sources */,
2DC8AA541C2421D600FA6B8E /* EVReflection.swift in Sources */,
2DC8AA551C2421D600FA6B8E /* EVObject.swift in Sources */,
2DC8AA571C2421D600FA6B8E /* EVExtensions.swift in Sources */,
7FF033F81DC2A0E000B25070 /* EVReflectable.swift in Sources */,
2DC8AA571C2421D600FA6B8E /* EVArrayExtension.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -872,8 +879,9 @@
buildActionMask = 2147483647;
files = (
4A779EC01C77D505006CE342 /* EVWorkaroundHelpers.swift in Sources */,
2DC8AA7F1C242ED200FA6B8E /* EVExtensions.swift in Sources */,
2DC8AA7F1C242ED200FA6B8E /* EVArrayExtension.swift in Sources */,
2DC8AA7C1C242ECC00FA6B8E /* EVReflection.swift in Sources */,
7F925AB61DC325E50059F4F2 /* EVReflectable.swift in Sources */,
2DC8AA7D1C242ECE00FA6B8E /* EVObject.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -968,9 +976,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7F9336C81C2822A700AF7076 /* EVExtensions.swift in Sources */,
7F9336C81C2822A700AF7076 /* EVArrayExtension.swift in Sources */,
7F9336C51C28229C00AF7076 /* EVReflection.swift in Sources */,
7F625FD51D7031DF00F9A304 /* EVWorkaroundHelpers.swift in Sources */,
7F925AB71DC325E60059F4F2 /* EVReflectable.swift in Sources */,
7F9336C61C28229F00AF7076 /* EVObject.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1017,9 +1026,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7FD67D961C288B840071234B /* EVExtensions.swift in Sources */,
7FD67D961C288B840071234B /* EVArrayExtension.swift in Sources */,
7FD67D931C288B760071234B /* EVReflection.swift in Sources */,
7F625FD61D7031E000F9A304 /* EVWorkaroundHelpers.swift in Sources */,
7F925AB81DC325E70059F4F2 /* EVReflectable.swift in Sources */,
7FD67D941C288B7A0071234B /* EVObject.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class EVReflectionEVObjectTests: XCTestCase {
let result = NSKeyedUnarchiver.unarchiveObject(withFile: filePath) as? TestObject2

// Test if the objects are the same
XCTAssert(theObject.isEqual(result), "Pass")
XCTAssert(theObject == result, "Pass")
}

Expand Down
2 changes: 1 addition & 1 deletion EVReflection/EVReflectionTests/EVReflectionIssue107.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class EVSubConfigurationModel: EVObject {
var evening: String?
var morning: String?

override internal func initValidation(_ dict: NSDictionary) {
internal override func initValidation(_ dict: NSDictionary) {
self.initMayNotContainKeys(["desc","morning","evening"], dict: dict)
}
}
Expand Down
2 changes: 1 addition & 1 deletion EVReflection/EVReflectionTests/EVReflectionIssue86.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Supports: EVObject {
var _attribute: String = ""
var _value: YesNoEnum = .none

override internal func propertyConverters() -> [(String?, ((Any?) -> ())?, (() -> Any?)?)] {
override func propertyConverters() -> [(String?, ((Any?) -> ())?, (() -> Any?)?)] {
return [
(
"_type"
Expand Down
1 change: 0 additions & 1 deletion EVReflection/EVReflectionTests/EVReflectionIssue91.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class TestIssue91: XCTestCase {
}

class BaseObject: EVObject {

}

class SimpleObject: BaseObject {
Expand Down
4 changes: 2 additions & 2 deletions EVReflection/EVReflectionTests/EVReflectionIssue99.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public class MyPrimaryObject: EVObject {

public var secondaryObjects: [MySecondaryObject]?

override public func propertyMapping() -> [(String?, String?)] {
public override func propertyMapping() -> [(String?, String?)] {
return [("myObjectDescription","Description")]

}
Expand All @@ -157,7 +157,7 @@ public class PublicInfusion: EVObject {

public var vodkaHistory: [PublicInfusionCheckmark] = []

override public func propertyMapping() -> [(String?, String?)] {
public override func propertyMapping() -> [(String?, String?)] {
return [("infusionDescription","Description")]
}
}
Expand Down
4 changes: 2 additions & 2 deletions EVReflection/EVReflectionTests/EVReflectionJsonTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ class EVReflectionJsonTests: XCTestCase {
let path = Bundle(for: type(of: self)).url(forResource: "sample", withExtension: "json")
let data = try! Data(contentsOf: path!)
let a = TestObject4(data: data)
XCTAssertEqual(a.myString, "1", "myString should contain 1")
XCTAssertEqual(a.myString, "test", "myString should contain 1")
XCTAssertEqual(a.myInt, 2, "myInt should contain 2")
XCTAssertEqual(a.myFloat, 2.1, "myFloat should contain 2.1")
XCTAssertEqual(a.myFloat, 2.5, "myFloat should contain 2.5")
XCTAssertEqual(a.myBool, true, "myBool should contain true")

}
Expand Down
6 changes: 3 additions & 3 deletions EVReflection/EVReflectionTests/EVReflectionMappingTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class EVReflectionMappingTests: XCTestCase {
player.gamesPlayed = 123
player.rating = 76

NSLog("\n\n===> This will output a warning because GameAdministrator does not have the propery gamesPlayes")
NSLog("\n\n===> This will output a warning because GameAdministrator does not have the propery gamesPlayed")
let administrator: GameAdministrator = player.mapObjectTo()

// Remember that printing will use the property converter and multiply the administrator level with 4. So it will print the same as the player.
Expand Down Expand Up @@ -107,11 +107,11 @@ public class GameAdministrator: GameUser {
var usersBanned: Int = 0
var level: Int = 0

override public func propertyMapping() -> [(String?, String?)] {
public override func propertyMapping() -> [(String?, String?)] {
return [("level","rating")]
}

override public func propertyConverters() -> [(String?, ((Any?)->())?, (() -> Any?)? )] {
public override func propertyConverters() -> [(String?, ((Any?)->())?, (() -> Any?)? )] {
return [
( // We want a custom converter for the field isGreat
"level",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class B: EVObject {
}
}

override public func propertyMapping() -> [(String?, String?)] {
public override func propertyMapping() -> [(String?, String?)] {
return [("intProp", nil)]
}
}
Expand Down
4 changes: 2 additions & 2 deletions EVReflection/EVReflectionTests/EVReflectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ class EVReflectionTests: XCTestCase {
Test the convenience methods for getting a dictionary and creating an object based on a dictionary.
*/
func testClassToAndFromDictionaryConvenienceMethods() {
let theObject = TestObject2()
let theObject: TestObject2 = TestObject2()
theObject.objectValue = "testing"
let toDict = theObject.toDictionary()
NSLog("toDictionary = \(toDict)")
let result = TestObject2(dictionary: toDict)
let result: TestObject2 = TestObject2(dictionary: toDict)
XCTAssert(theObject == result, "Pass")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ public class MyGenericObject<T>: MyGenericBase, EVGenericsKVC where T:NSObject {
super.init()
}

required public init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public func setGenericValue(_ value: AnyObject!, forUndefinedKey key: String) {
switch key {
case "data":
Expand All @@ -126,6 +130,10 @@ public class MyIncorrectGenericObject<T>: MyGenericBase, EVGenericsKVC where T:N
required public init() {
super.init()
}

required public init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public func setGenericValue(_ value: AnyObject!, forUndefinedKey key: String) {
// Not setting anything
Expand Down
Loading

0 comments on commit b49c04b

Please sign in to comment.