Compare commits

...

6 Commits

10 changed files with 591 additions and 82 deletions

1
DAO Framework/Cartfile Normal file
View File

@ -0,0 +1 @@
github "realm/realm-cocoa"

View File

@ -0,0 +1 @@
github "realm/realm-cocoa" "v2.9.1"

View File

@ -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 */;
}

View File

@ -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>

19
DAO Framework/DAO/DAO.h Normal file
View File

@ -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>

View File

@ -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>

View File

@ -1,59 +0,0 @@
//
// Created by Ivan Vavilov on 5/22/17.
// Copyright (c) 2017 RedMadRobot LLC. All rights reserved.
//
import Foundation
import RealmSwift
/// `Realm DAO` configuration.
/// Incapsulates basic settings.
/// Used to initialize `Realm DAO`.
public struct RealmConfiguration {
/// Name of database file name.
public let databaseFileName: String
/// Version of database.
public let databaseVersion: UInt64
/// Migration block for manual migration.
public let migrationBlock: MigrationBlock?
/// Key to encrypt data.
public let encryptionKey: Data?
/**
A block called when opening a Realm for the first time during the life
of a process to determine if it should be compacted before being returned
to the user. It is passed the total file size (data + free space) and the total
bytes used by data in the file.
Return `true` to indicate that an attempt to compact the file should be made.
The compaction will be skipped if another process is accessing it.
*/
public let shouldCompactOnLaunch: ((Int, Int) -> Bool)?
/// Create an instance with specified `databaseFileName`, `databaseVersion`, `migrationBlock`.
///
/// - Parameters:
/// - databaseFileName: name. See above.
/// - databaseVersion: version. See above.
/// - migrationBlock: migration block. See above.
/// - encryptionKey: encryption key. See above.
public init(
databaseFileName: String = "Database.realm",
databaseVersion: UInt64 = 1,
migrationBlock: MigrationBlock? = nil,
encryptionKey: Data? = nil,
shouldCompactOnLaunch: ((Int, Int) -> Bool)? = nil) {
self.databaseFileName = databaseFileName
self.databaseVersion = databaseVersion
self.migrationBlock = migrationBlock
self.encryptionKey = encryptionKey
self.shouldCompactOnLaunch = shouldCompactOnLaunch
}
}

View File

@ -30,10 +30,10 @@ open class RealmDAO<Model: Entity, RealmModel: RLMEntry>: DAO<Model> {
/// - configuration: configuration. See also `RealmConfiguration`. /// - configuration: configuration. See also `RealmConfiguration`.
public init( public init(
_ translator: RealmTranslator<Model, RealmModel>, _ translator: RealmTranslator<Model, RealmModel>,
configuration: RealmConfiguration) { configuration: Realm.Configuration) {
self.translator = translator self.translator = translator
self.configuration = RealmDAO.makeRealmConfiguration(configuration) self.configuration = configuration
super.init() super.init()
} }
@ -44,26 +44,8 @@ open class RealmDAO<Model: Entity, RealmModel: RLMEntry>: DAO<Model> {
/// - translator: translator for current `Model` and `RealmModel` types. /// - translator: translator for current `Model` and `RealmModel` types.
public convenience init( public convenience init(
_ translator: RealmTranslator<Model, RealmModel>) { _ translator: RealmTranslator<Model, RealmModel>) {
self.init(translator, configuration: RealmConfiguration()) self.init(translator, configuration: Realm.Configuration.defaultConfiguration)
}
static func makeRealmConfiguration(_ configuration: RealmConfiguration) -> Realm.Configuration {
var config = Realm.Configuration.defaultConfiguration
guard let path = self.pathForFileName(configuration.databaseFileName) else {
fatalError("Cant find path for DB with filename: \(configuration.databaseFileName)"
+ " v.\(configuration.databaseVersion)")
}
config.fileURL = path
config.schemaVersion = configuration.databaseVersion
config.migrationBlock = configuration.migrationBlock
config.encryptionKey = configuration.encryptionKey
config.shouldCompactOnLaunch = configuration.shouldCompactOnLaunch
return config
} }
public static func pathForFileName(_ fileName: String) -> URL? { public static func pathForFileName(_ fileName: String) -> URL? {

View File

@ -63,7 +63,7 @@ Please look at the example project for more information.
## Requirements ## Requirements
- XCode 9 - Xcode 9
- Swift 4 - Swift 4
- iOS 9 - iOS 9