Compare commits
5 Commits
master
...
feature/on
| Author | SHA1 | Date |
|---|---|---|
|
|
4dc4e05ffc | |
|
|
add4d6a436 | |
|
|
31f4ba57cc | |
|
|
47a0cde1cf | |
|
|
74fb0a2a3d |
|
|
@ -0,0 +1 @@
|
|||
github "realm/realm-cocoa"
|
||||
|
|
@ -0,0 +1 @@
|
|||
github "realm/realm-cocoa" "v2.9.1"
|
||||
|
|
@ -0,0 +1,461 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
AA0664561F31C97100AFED02 /* DAO.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0664541F31C97100AFED02 /* DAO.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AA06647A1F31CA1F00AFED02 /* DAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664651F31CA1F00AFED02 /* DAO.swift */; };
|
||||
AA06647B1F31CA1F00AFED02 /* Entity.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664661F31CA1F00AFED02 /* Entity.swift */; };
|
||||
AA06647C1F31CA1F00AFED02 /* CoreDataConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664691F31CA1F00AFED02 /* CoreDataConfiguration.swift */; };
|
||||
AA06647D1F31CA1F00AFED02 /* CoreDataDAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA06646B1F31CA1F00AFED02 /* CoreDataDAO.swift */; };
|
||||
AA06647E1F31CA1F00AFED02 /* CoreDataTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA06646D1F31CA1F00AFED02 /* CoreDataTranslator.swift */; };
|
||||
AA06647F1F31CA1F00AFED02 /* RealmConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664701F31CA1F00AFED02 /* RealmConfiguration.swift */; };
|
||||
AA0664801F31CA1F00AFED02 /* RealmDAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664721F31CA1F00AFED02 /* RealmDAO.swift */; };
|
||||
AA0664811F31CA1F00AFED02 /* CascadeDeletionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664741F31CA1F00AFED02 /* CascadeDeletionProtocol.swift */; };
|
||||
AA0664821F31CA1F00AFED02 /* RLMEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664751F31CA1F00AFED02 /* RLMEntry.swift */; };
|
||||
AA0664831F31CA1F00AFED02 /* RLMTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664761F31CA1F00AFED02 /* RLMTypes.swift */; };
|
||||
AA0664841F31CA1F00AFED02 /* RealmTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0664781F31CA1F00AFED02 /* RealmTranslator.swift */; };
|
||||
AA0664881F31CF1100AFED02 /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA0664861F31CF1100AFED02 /* Realm.framework */; };
|
||||
AA0664891F31CF1100AFED02 /* RealmSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA0664871F31CF1100AFED02 /* RealmSwift.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
AA0664511F31C97100AFED02 /* DAO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DAO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
AA0664541F31C97100AFED02 /* DAO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DAO.h; sourceTree = "<group>"; };
|
||||
AA0664551F31C97100AFED02 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
AA0664651F31CA1F00AFED02 /* DAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DAO.swift; sourceTree = "<group>"; };
|
||||
AA0664661F31CA1F00AFED02 /* Entity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Entity.swift; sourceTree = "<group>"; };
|
||||
AA0664691F31CA1F00AFED02 /* CoreDataConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataConfiguration.swift; sourceTree = "<group>"; };
|
||||
AA06646B1F31CA1F00AFED02 /* CoreDataDAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataDAO.swift; sourceTree = "<group>"; };
|
||||
AA06646D1F31CA1F00AFED02 /* CoreDataTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataTranslator.swift; sourceTree = "<group>"; };
|
||||
AA0664701F31CA1F00AFED02 /* RealmConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmConfiguration.swift; sourceTree = "<group>"; };
|
||||
AA0664721F31CA1F00AFED02 /* RealmDAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDAO.swift; sourceTree = "<group>"; };
|
||||
AA0664741F31CA1F00AFED02 /* CascadeDeletionProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CascadeDeletionProtocol.swift; sourceTree = "<group>"; };
|
||||
AA0664751F31CA1F00AFED02 /* RLMEntry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMEntry.swift; sourceTree = "<group>"; };
|
||||
AA0664761F31CA1F00AFED02 /* RLMTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMTypes.swift; sourceTree = "<group>"; };
|
||||
AA0664781F31CA1F00AFED02 /* RealmTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmTranslator.swift; sourceTree = "<group>"; };
|
||||
AA0664861F31CF1100AFED02 /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Realm.framework; path = Carthage/Build/iOS/Realm.framework; sourceTree = "<group>"; };
|
||||
AA0664871F31CF1100AFED02 /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RealmSwift.framework; path = Carthage/Build/iOS/RealmSwift.framework; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
AA06644D1F31C97100AFED02 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AA0664881F31CF1100AFED02 /* Realm.framework in Frameworks */,
|
||||
AA0664891F31CF1100AFED02 /* RealmSwift.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
AA0664471F31C97100AFED02 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664531F31C97100AFED02 /* DAO */,
|
||||
AA0664521F31C97100AFED02 /* Products */,
|
||||
AA0664851F31CF1100AFED02 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664521F31C97100AFED02 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664511F31C97100AFED02 /* DAO.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664531F31C97100AFED02 /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664621F31CA1F00AFED02 /* Classes */,
|
||||
AA0664541F31C97100AFED02 /* DAO.h */,
|
||||
AA0664551F31C97100AFED02 /* Info.plist */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664621F31CA1F00AFED02 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664641F31CA1F00AFED02 /* Core */,
|
||||
AA0664671F31CA1F00AFED02 /* CoreDataDAO */,
|
||||
AA06646E1F31CA1F00AFED02 /* RealmDAO */,
|
||||
);
|
||||
name = Classes;
|
||||
path = ../../DAO/Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664641F31CA1F00AFED02 /* Core */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664651F31CA1F00AFED02 /* DAO.swift */,
|
||||
AA0664661F31CA1F00AFED02 /* Entity.swift */,
|
||||
);
|
||||
path = Core;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664671F31CA1F00AFED02 /* CoreDataDAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664681F31CA1F00AFED02 /* Configuration */,
|
||||
AA06646A1F31CA1F00AFED02 /* DAO */,
|
||||
AA06646C1F31CA1F00AFED02 /* Translator */,
|
||||
);
|
||||
path = CoreDataDAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664681F31CA1F00AFED02 /* Configuration */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664691F31CA1F00AFED02 /* CoreDataConfiguration.swift */,
|
||||
);
|
||||
path = Configuration;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA06646A1F31CA1F00AFED02 /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA06646B1F31CA1F00AFED02 /* CoreDataDAO.swift */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA06646C1F31CA1F00AFED02 /* Translator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA06646D1F31CA1F00AFED02 /* CoreDataTranslator.swift */,
|
||||
);
|
||||
path = Translator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA06646E1F31CA1F00AFED02 /* RealmDAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA06646F1F31CA1F00AFED02 /* Configuration */,
|
||||
AA0664711F31CA1F00AFED02 /* DAO */,
|
||||
AA0664731F31CA1F00AFED02 /* Model */,
|
||||
AA0664771F31CA1F00AFED02 /* Translator */,
|
||||
);
|
||||
path = RealmDAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA06646F1F31CA1F00AFED02 /* Configuration */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664701F31CA1F00AFED02 /* RealmConfiguration.swift */,
|
||||
);
|
||||
path = Configuration;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664711F31CA1F00AFED02 /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664721F31CA1F00AFED02 /* RealmDAO.swift */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664731F31CA1F00AFED02 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664741F31CA1F00AFED02 /* CascadeDeletionProtocol.swift */,
|
||||
AA0664751F31CA1F00AFED02 /* RLMEntry.swift */,
|
||||
AA0664761F31CA1F00AFED02 /* RLMTypes.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664771F31CA1F00AFED02 /* Translator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664781F31CA1F00AFED02 /* RealmTranslator.swift */,
|
||||
);
|
||||
path = Translator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA0664851F31CF1100AFED02 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA0664861F31CF1100AFED02 /* Realm.framework */,
|
||||
AA0664871F31CF1100AFED02 /* RealmSwift.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
AA06644E1F31C97100AFED02 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AA0664561F31C97100AFED02 /* DAO.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
AA0664501F31C97100AFED02 /* DAO */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = AA0664591F31C97100AFED02 /* Build configuration list for PBXNativeTarget "DAO" */;
|
||||
buildPhases = (
|
||||
AA06644C1F31C97100AFED02 /* Sources */,
|
||||
AA06644D1F31C97100AFED02 /* Frameworks */,
|
||||
AA06644E1F31C97100AFED02 /* Headers */,
|
||||
AA06644F1F31C97100AFED02 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = DAO;
|
||||
productName = DAO;
|
||||
productReference = AA0664511F31C97100AFED02 /* DAO.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
AA0664481F31C97100AFED02 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0830;
|
||||
ORGANIZATIONNAME = RedMadRobot;
|
||||
TargetAttributes = {
|
||||
AA0664501F31C97100AFED02 = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
DevelopmentTeam = 42LRQS6X44;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = AA06644B1F31C97100AFED02 /* Build configuration list for PBXProject "DAO" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = AA0664471F31C97100AFED02;
|
||||
productRefGroup = AA0664521F31C97100AFED02 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
AA0664501F31C97100AFED02 /* DAO */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
AA06644F1F31C97100AFED02 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
AA06644C1F31C97100AFED02 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AA06647C1F31CA1F00AFED02 /* CoreDataConfiguration.swift in Sources */,
|
||||
AA06647B1F31CA1F00AFED02 /* Entity.swift in Sources */,
|
||||
AA0664811F31CA1F00AFED02 /* CascadeDeletionProtocol.swift in Sources */,
|
||||
AA06647A1F31CA1F00AFED02 /* DAO.swift in Sources */,
|
||||
AA0664841F31CA1F00AFED02 /* RealmTranslator.swift in Sources */,
|
||||
AA06647E1F31CA1F00AFED02 /* CoreDataTranslator.swift in Sources */,
|
||||
AA0664831F31CA1F00AFED02 /* RLMTypes.swift in Sources */,
|
||||
AA0664821F31CA1F00AFED02 /* RLMEntry.swift in Sources */,
|
||||
AA06647F1F31CA1F00AFED02 /* RealmConfiguration.swift in Sources */,
|
||||
AA0664801F31CA1F00AFED02 /* RealmDAO.swift in Sources */,
|
||||
AA06647D1F31CA1F00AFED02 /* CoreDataDAO.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
AA0664571F31C97100AFED02 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AA0664581F31C97100AFED02 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
AA06645A1F31C97100AFED02 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = 42LRQS6X44;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = DAO/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.DAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AA06645B1F31C97100AFED02 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = 42LRQS6X44;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
INFOPLIST_FILE = DAO/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.DAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
AA06644B1F31C97100AFED02 /* Build configuration list for PBXProject "DAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AA0664571F31C97100AFED02 /* Debug */,
|
||||
AA0664581F31C97100AFED02 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
AA0664591F31C97100AFED02 /* Build configuration list for PBXNativeTarget "DAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AA06645A1F31C97100AFED02 /* Debug */,
|
||||
AA06645B1F31C97100AFED02 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = AA0664481F31C97100AFED02 /* Project object */;
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AA0664501F31C97100AFED02"
|
||||
BuildableName = "DAO.framework"
|
||||
BlueprintName = "DAO"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AA0664501F31C97100AFED02"
|
||||
BuildableName = "DAO.framework"
|
||||
BlueprintName = "DAO"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AA0664501F31C97100AFED02"
|
||||
BuildableName = "DAO.framework"
|
||||
BlueprintName = "DAO"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// DAO.h
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 8/2/17.
|
||||
// Copyright © 2017 RedMadRobot. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for DAO.
|
||||
FOUNDATION_EXPORT double DAOVersionNumber;
|
||||
|
||||
//! Project version string for DAO.
|
||||
FOUNDATION_EXPORT const unsigned char DAOVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <DAO/PublicHeader.h>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -34,7 +34,6 @@ open class RealmTranslator<Model: Entity, RealmModel: RLMEntry> {
|
|||
/// - fromEntities: array of instances of `Model` type.
|
||||
open func fill(_ entries: List<RealmModel>, fromEntities: [Model]) {
|
||||
let oldEntries = entries.map { $0 }
|
||||
entries.removeAll()
|
||||
|
||||
fromEntities
|
||||
.map { entity -> (RealmModel, Model) in
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@
|
|||
AA3525971EEFDD13009C4375 /* CoreDataDAOFoldersTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525931EEFDD13009C4375 /* CoreDataDAOFoldersTests.swift */; };
|
||||
AA3525981EEFDD13009C4375 /* CoreDataDAOManyDAOTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525941EEFDD13009C4375 /* CoreDataDAOManyDAOTests.swift */; };
|
||||
AA3525991EEFDD13009C4375 /* CoreDataDAOMessagesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525951EEFDD13009C4375 /* CoreDataDAOMessagesTests.swift */; };
|
||||
AAE52ABC1F56E0DC00D2FE3D /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE52ABB1F56E0DC00D2FE3D /* User.swift */; };
|
||||
AAE52ABE1F56E18C00D2FE3D /* DBUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE52ABD1F56E18C00D2FE3D /* DBUser.swift */; };
|
||||
AAE52AC01F56E26B00D2FE3D /* RLMUserTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE52ABF1F56E26B00D2FE3D /* RLMUserTranslator.swift */; };
|
||||
E6862F802F1820084726DEB8 /* Pods_CoreDataDAOTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F42144986137E1707B5FAC0 /* Pods_CoreDataDAOTests.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
|
|
@ -109,6 +112,9 @@
|
|||
AA3525931EEFDD13009C4375 /* CoreDataDAOFoldersTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataDAOFoldersTests.swift; sourceTree = "<group>"; };
|
||||
AA3525941EEFDD13009C4375 /* CoreDataDAOManyDAOTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataDAOManyDAOTests.swift; sourceTree = "<group>"; };
|
||||
AA3525951EEFDD13009C4375 /* CoreDataDAOMessagesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataDAOMessagesTests.swift; sourceTree = "<group>"; };
|
||||
AAE52ABB1F56E0DC00D2FE3D /* User.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = "<group>"; };
|
||||
AAE52ABD1F56E18C00D2FE3D /* DBUser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBUser.swift; sourceTree = "<group>"; };
|
||||
AAE52ABF1F56E26B00D2FE3D /* RLMUserTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMUserTranslator.swift; sourceTree = "<group>"; };
|
||||
B3F6075B730F33239A8C0C16 /* Pods-DAO_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DAO_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-DAO_Tests/Pods-DAO_Tests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
B83929C10B53857ABAEBA293 /* Pods-CoreDataDAOTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDataDAOTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoreDataDAOTests/Pods-CoreDataDAOTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
BF445E2FB5382CAF4125954E /* Pods_DAO_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DAO_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
|
|
@ -260,6 +266,7 @@
|
|||
AA3525581EEFDBE2009C4375 /* RLMEntityTranslator.swift */,
|
||||
AA3525591EEFDBE2009C4375 /* RLMFolderTranslator.swift */,
|
||||
AA35255A1EEFDBE2009C4375 /* RLMMessageTranslator.swift */,
|
||||
AAE52ABF1F56E26B00D2FE3D /* RLMUserTranslator.swift */,
|
||||
);
|
||||
path = RealmTranslator;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -272,6 +279,7 @@
|
|||
AA3525641EEFDBE2009C4375 /* Folder.swift */,
|
||||
AA3525651EEFDBE2009C4375 /* Message.swift */,
|
||||
AA3525661EEFDBE2009C4375 /* RealmDatabase */,
|
||||
AAE52ABB1F56E0DC00D2FE3D /* User.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -296,6 +304,7 @@
|
|||
AA3525681EEFDBE2009C4375 /* DBEntity.swift */,
|
||||
AA3525691EEFDBE2009C4375 /* DBFolder.swift */,
|
||||
AA35256A1EEFDBE2009C4375 /* DBMessage.swift */,
|
||||
AAE52ABD1F56E18C00D2FE3D /* DBUser.swift */,
|
||||
);
|
||||
path = RealmDatabase;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -641,6 +650,8 @@
|
|||
AA3525821EEFDC24009C4375 /* Model.xcdatamodeld in Sources */,
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
|
||||
AA35257B1EEFDBE2009C4375 /* DBBook.swift in Sources */,
|
||||
AAE52ABE1F56E18C00D2FE3D /* DBUser.swift in Sources */,
|
||||
AAE52AC01F56E26B00D2FE3D /* RLMUserTranslator.swift in Sources */,
|
||||
AA3525701EEFDBE2009C4375 /* RLMFolderTranslator.swift in Sources */,
|
||||
AA35257E1EEFDBE2009C4375 /* DBMessage.swift in Sources */,
|
||||
AA35256F1EEFDBE2009C4375 /* RLMEntityTranslator.swift in Sources */,
|
||||
|
|
@ -651,6 +662,7 @@
|
|||
AA35256B1EEFDBE2009C4375 /* CDEntityTranslator.swift in Sources */,
|
||||
AA3525751EEFDBE2009C4375 /* CDFolder+CoreDataProperties.swift in Sources */,
|
||||
AA3525711EEFDBE2009C4375 /* RLMMessageTranslator.swift in Sources */,
|
||||
AAE52ABC1F56E0DC00D2FE3D /* User.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ class RLMFolderTranslator: RealmTranslator<Folder, DBFolder> {
|
|||
entity.entityId = fromEntry.entryId
|
||||
entity.name = fromEntry.name
|
||||
|
||||
if let creator = fromEntry.creator {
|
||||
entity.creator = User(entityId: creator.entryId, name: creator.name)
|
||||
}
|
||||
|
||||
RLMMessageTranslator().fill(&entity.messages, fromEntries: fromEntry.messages)
|
||||
}
|
||||
|
||||
|
|
@ -28,6 +32,16 @@ class RLMFolderTranslator: RealmTranslator<Folder, DBFolder> {
|
|||
}
|
||||
entry.name = fromEntity.name
|
||||
|
||||
if let creator = fromEntity.creator {
|
||||
if let dbCreator = entry.creator, creator.entityId == dbCreator.entryId {
|
||||
dbCreator.name = creator.name
|
||||
} else {
|
||||
entry.creator = DBUser.userWithId(creator.entityId, name: creator.name)
|
||||
}
|
||||
} else {
|
||||
entry.creator = nil
|
||||
}
|
||||
|
||||
RLMMessageTranslator().fill(entry.messages, fromEntities: fromEntity.messages)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// RLMUserTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 8/30/17.
|
||||
// Copyright © 2017 CocoaPods. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import DAO
|
||||
|
||||
class RLMUserTranslator: RealmTranslator<User, DBUser> {
|
||||
|
||||
required init() {}
|
||||
|
||||
|
||||
override func fill(_ entity: User, fromEntry: DBUser) {
|
||||
entity.entityId = fromEntry.entryId
|
||||
entity.name = fromEntry.name
|
||||
}
|
||||
|
||||
|
||||
override func fill(_ entry: DBUser, fromEntity: User) {
|
||||
if entry.entryId != fromEntity.entityId {
|
||||
entry.entryId = fromEntity.entityId
|
||||
}
|
||||
|
||||
entry.name = fromEntity.name
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,11 +13,13 @@ import DAO
|
|||
class Folder: Entity {
|
||||
|
||||
var name: String = ""
|
||||
var creator: User?
|
||||
var messages = [Message]()
|
||||
|
||||
|
||||
init(entityId: String, name: String, messages: [Message]) {
|
||||
init(entityId: String, name: String, creator: User? = nil, messages: [Message]) {
|
||||
self.name = name
|
||||
self.creator = creator
|
||||
self.messages = messages
|
||||
|
||||
super.init(entityId: entityId)
|
||||
|
|
|
|||
|
|
@ -12,13 +12,15 @@ import RealmSwift
|
|||
class DBFolder: DBEntity, CascadeDeletionProtocol {
|
||||
|
||||
dynamic var name: String = ""
|
||||
dynamic var creator: DBUser?
|
||||
var messages = List<DBMessage>()
|
||||
|
||||
|
||||
class func folderWithId(_ entryId: String, name: String, messages: List<DBMessage>) -> DBFolder {
|
||||
class func folderWithId(_ entryId: String, name: String, creator: DBUser? = nil, messages: List<DBMessage>) -> DBFolder {
|
||||
let folder = DBFolder()
|
||||
folder.entryId = entryId
|
||||
folder.name = name
|
||||
folder.creator = creator
|
||||
folder.messages.append(objectsIn: messages)
|
||||
return folder
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// DBUser.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 8/30/17.
|
||||
// Copyright © 2017 CocoaPods. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class DBUser: DBEntity {
|
||||
|
||||
dynamic var name: String = ""
|
||||
|
||||
|
||||
class func userWithId(_ entryId: String, name: String) -> DBUser {
|
||||
let user = DBUser()
|
||||
user.entryId = entryId
|
||||
user.name = name
|
||||
return user
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// User.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 8/30/17.
|
||||
// Copyright © 2017 CocoaPods. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
|
||||
class User: Entity {
|
||||
|
||||
var name: String = ""
|
||||
|
||||
init(entityId: String, name: String) {
|
||||
self.name = name
|
||||
|
||||
super.init(entityId: entityId)
|
||||
}
|
||||
|
||||
|
||||
required init() {
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
override func equals<T>(_ other: T) -> Bool where T : User {
|
||||
return super.equals(other) && self.name == other.name
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
PODS:
|
||||
- DAO (1.0.0):
|
||||
- DAO/CoreData (= 1.0.0)
|
||||
- DAO/Realm (= 1.0.0)
|
||||
- DAO/CoreData (1.0.0)
|
||||
- DAO/Realm (1.0.0):
|
||||
- DAO (1.0.3):
|
||||
- DAO/CoreData (= 1.0.3)
|
||||
- DAO/Realm (= 1.0.3)
|
||||
- DAO/CoreData (1.0.3)
|
||||
- DAO/Realm (1.0.3):
|
||||
- RealmSwift
|
||||
- Realm (2.8.1):
|
||||
- Realm/Headers (= 2.8.1)
|
||||
- Realm/Headers (2.8.1)
|
||||
- RealmSwift (2.8.1):
|
||||
- Realm (= 2.8.1)
|
||||
- Realm (2.9.1):
|
||||
- Realm/Headers (= 2.9.1)
|
||||
- Realm/Headers (2.9.1)
|
||||
- RealmSwift (2.9.1):
|
||||
- Realm (= 2.9.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- DAO (from `../`)
|
||||
|
|
@ -19,9 +19,9 @@ EXTERNAL SOURCES:
|
|||
:path: ../
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
DAO: 3e8e492bad862e8b804cd7d17dee0887658f5362
|
||||
Realm: 2627602ad6818451f0cb8c2a6e072f7f10a5f360
|
||||
RealmSwift: 4764ca7657f2193c256fb032c0b123926f70dbcd
|
||||
DAO: 375828ee8ea8d0479a2e094229ff9a353b7a8344
|
||||
Realm: f91fb43bd474c4f731a116ebf7392c75dd015920
|
||||
RealmSwift: 207f12a4a36b696c5183c60a1c06d70234a23e56
|
||||
|
||||
PODFILE CHECKSUM: 304d7b9f54070467c355fe795db431630f017f61
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import DAO
|
|||
|
||||
class RealmDAOBookTests: XCTestCase {
|
||||
|
||||
let dao = RealmDAO(RLMBookTranslator())
|
||||
let dao = RealmDAO(RLMBookTranslator(), configuration: RealmConfiguration(databaseVersion: 2))
|
||||
|
||||
|
||||
func testPersist() {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import DAO
|
|||
|
||||
final class RealmDAOEntityTests: XCTestCase {
|
||||
|
||||
let dao = RealmDAO(RLMEntityTranslator())
|
||||
let dao = RealmDAO(RLMEntityTranslator(), configuration: RealmConfiguration(databaseVersion: 2))
|
||||
|
||||
|
||||
func testReadById() {
|
||||
|
|
|
|||
|
|
@ -13,10 +13,93 @@ import DAO
|
|||
|
||||
final class RealmDAOFolderTests: XCTestCase {
|
||||
|
||||
let messageDAO = RealmDAO(RLMMessageTranslator())
|
||||
let messageDAO = RealmDAO(RLMMessageTranslator(), configuration: RealmConfiguration(databaseVersion: 2))
|
||||
let folderDAO = RealmDAO(RLMFolderTranslator(), configuration: RealmConfiguration(databaseVersion: 2))
|
||||
let userDAO = RealmDAO(RLMUserTranslator(), configuration: RealmConfiguration(databaseVersion: 2))
|
||||
|
||||
let folderDAO = RealmDAO(RLMFolderTranslator())
|
||||
override func setUp() {
|
||||
try? messageDAO.erase()
|
||||
try? folderDAO.erase()
|
||||
try? userDAO.erase()
|
||||
}
|
||||
|
||||
func testUserRelationship() {
|
||||
let user = User(entityId: "U1", name: "Vova")
|
||||
let folder = Folder(entityId: "F1", name: "Created", creator: user, messages: [])
|
||||
|
||||
do {
|
||||
try folderDAO.persist(folder)
|
||||
} catch {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
let savedFolder = folderDAO.read("F1")
|
||||
|
||||
XCTAssertNotNil(savedFolder?.creator)
|
||||
}
|
||||
|
||||
func testUpdateUserInRelationship() {
|
||||
let user = User(entityId: "U1", name: "Vova")
|
||||
let folder = Folder(entityId: "F1", name: "Created", creator: user, messages: [])
|
||||
|
||||
do {
|
||||
try folderDAO.persist(folder)
|
||||
} catch {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
let savedFolder = folderDAO.read("F1")!
|
||||
savedFolder.creator = nil
|
||||
|
||||
do {
|
||||
try folderDAO.persist(savedFolder)
|
||||
} catch {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
if let savedFolder = folderDAO.read("F1") {
|
||||
XCTAssertNil(savedFolder.creator)
|
||||
} else {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
let user2 = User(entityId: "U2", name: "Vova")
|
||||
|
||||
savedFolder.creator = user2
|
||||
|
||||
do {
|
||||
try folderDAO.persist(savedFolder)
|
||||
} catch {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
if let savedFolder = folderDAO.read("F1") {
|
||||
XCTAssertEqual(savedFolder.creator?.entityId, "U2")
|
||||
} else {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
do {
|
||||
try userDAO.erase()
|
||||
} catch {
|
||||
XCTFail("Erase user is failed")
|
||||
}
|
||||
|
||||
savedFolder.creator = user
|
||||
|
||||
do {
|
||||
try folderDAO.persist(savedFolder)
|
||||
} catch {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
if let savedFolder = folderDAO.read("F1") {
|
||||
XCTAssertEqual(savedFolder.creator?.entityId, "U1")
|
||||
} else {
|
||||
XCTFail("Persist folder is failed")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func testCascadeErase() {
|
||||
let message = Message(entityId: "V.message", text: "V.message.text")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import DAO
|
|||
|
||||
final class RealmDAOMessagesTests: XCTestCase {
|
||||
|
||||
let dao = RealmDAO(RLMMessageTranslator())
|
||||
let dao = RealmDAO(RLMMessageTranslator(), configuration: RealmConfiguration(databaseVersion: 2))
|
||||
|
||||
|
||||
override func setUp() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue