Compare commits
No commits in common. "master" and "swift4" have entirely different histories.
|
|
@ -1,8 +1,67 @@
|
|||
# OS X
|
||||
.DS_Store
|
||||
|
||||
# Created by https://www.gitignore.io/api/appcode,swift,objective-c,xcode
|
||||
|
||||
### AppCode ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||
|
||||
*.iml
|
||||
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
# if you remove the above rule, at least ignore the following:
|
||||
|
||||
# User-specific stuff:
|
||||
# .idea/workspace.xml
|
||||
# .idea/tasks.xml
|
||||
# .idea/dictionaries
|
||||
# .idea/shelf
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
# .idea/dataSources.ids
|
||||
# .idea/dataSources.xml
|
||||
# .idea/sqlDataSources.xml
|
||||
# .idea/dynamic.xml
|
||||
# .idea/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
# .idea/gradle.xml
|
||||
# .idea/libraries
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
# .idea/mongoSettings.xml
|
||||
|
||||
## File-based project format:
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
## Plugin-specific files:
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
|
||||
### Swift ###
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
|
|
@ -11,27 +70,136 @@ build/
|
|||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata/
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
profile
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
|
||||
# Bundler
|
||||
.bundle
|
||||
## Playgrounds
|
||||
timeline.xctimeline
|
||||
playground.xcworkspace
|
||||
|
||||
Carthage
|
||||
# Swift Package Manager
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
|
||||
# Packages/
|
||||
.build/
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
|
||||
#
|
||||
# Note: if you ignore the Pods directory, make sure to uncomment
|
||||
# `pod install` in .travis.yml
|
||||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||
#
|
||||
|
||||
Pods/
|
||||
|
||||
Source/.idea
|
||||
Example/pod_install.command
|
||||
Example/pod_update.command
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
# fastlane
|
||||
#
|
||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||
# screenshots whenever they are needed.
|
||||
# For more information about the recommended setup visit:
|
||||
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
|
||||
|
||||
fastlane/report.xml
|
||||
fastlane/screenshots
|
||||
|
||||
|
||||
### Objective-C ###
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
*.xcscmblueprint
|
||||
|
||||
## Obj-C/Swift specific
|
||||
*.hmap
|
||||
*.ipa
|
||||
|
||||
# CocoaPods
|
||||
#
|
||||
# We recommend against adding the Pods directory to your .gitignore. However
|
||||
# you should judge for yourself, the pros and cons are mentioned at:
|
||||
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||
#
|
||||
# Pods/
|
||||
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
# fastlane
|
||||
#
|
||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||
# screenshots whenever they are needed.
|
||||
# For more information about the recommended setup visit:
|
||||
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
|
||||
|
||||
fastlane/report.xml
|
||||
fastlane/screenshots
|
||||
|
||||
### Objective-C Patch ###
|
||||
*.xcscmblueprint
|
||||
|
||||
|
||||
### Xcode ###
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
.DS_Store
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
github "realm/realm-cocoa" "v10.1.4"
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "CoreDAO"
|
||||
s.version = "1.1.0"
|
||||
s.summary = "CoreDAO Library"
|
||||
s.description = "Library provide easy way to cache entities."
|
||||
s.homepage = "http://git.redmadrobot.com/foundation-iOS/DAO.git"
|
||||
s.license = { :type => "MIT", :file => "LICENSE" }
|
||||
s.author = { "Ivan Vavilov" => "vi@redmadrobot.com", "Mikhail Konovalov" => "m.konovalov@redmadrobot.com" }
|
||||
s.platform = :ios, "8.0"
|
||||
s.source = { :git => "git@git.redmadrobot.com:foundation-ios/DAO.git" }
|
||||
s.source_files = "Source/CoreDAO/Classes/**/*"
|
||||
s.requires_arc = true
|
||||
s.dependency "RealmSwift", '~> 3.0'
|
||||
end
|
||||
24
DAO.podspec
24
DAO.podspec
|
|
@ -1,24 +0,0 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = 'DAO'
|
||||
s.version = '1.6.1'
|
||||
s.summary = 'DAO Library'
|
||||
s.description = 'Library provides easy way to cache entities.'
|
||||
s.homepage = 'https://github.com/RedMadRobot/DAO'
|
||||
s.license = { :type => 'MIT', :file => 'LICENSE' }
|
||||
s.author = { 'vani2' => 'iv@redmadrobot.com', 'hoppus' => 'e.popov@redmadrobot.com' }
|
||||
s.source = { :git => 'https://github.com/RedMadRobot/DAO.git', :tag => s.version, :submodules => true }
|
||||
s.platform = :ios, '9.0'
|
||||
s.swift_version = '5.3'
|
||||
s.source_files = 'DAO/Classes/Core/**/*'
|
||||
|
||||
s.subspec 'Realm' do |r|
|
||||
r.source_files = 'DAO/Classes/RealmDAO/**/*', 'DAO/Classes/Core/**/*'
|
||||
r.dependency "Realm", '~> 10.1'
|
||||
r.dependency "RealmSwift", '~> 10.1'
|
||||
end
|
||||
|
||||
s.subspec 'CoreData' do |cd|
|
||||
cd.source_files = 'DAO/Classes/CoreDataDAO/**/*', 'DAO/Classes/Core/**/*'
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,802 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
48BC874C4FE8134679B29670 /* Pods_CoreDataDAO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2E8A9BAF7ECAEC811F5ACE3C /* Pods_CoreDataDAO.framework */; };
|
||||
A5A85A8625ADBD73B3EEA43F /* Pods_RealmDAO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CA293F66C575881DDE04B1E /* Pods_RealmDAO.framework */; };
|
||||
CC741223237414070032D352 /* RealmConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC741218237414070032D352 /* RealmConfiguration.swift */; };
|
||||
CC741224237414070032D352 /* RealmDAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC74121A237414070032D352 /* RealmDAO.swift */; };
|
||||
CC741225237414070032D352 /* RealmTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC74121C237414070032D352 /* RealmTranslator.swift */; };
|
||||
CC741226237414070032D352 /* CascadeDeletionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC74121E237414070032D352 /* CascadeDeletionProtocol.swift */; };
|
||||
CC741227237414070032D352 /* RLMEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC74121F237414070032D352 /* RLMEntry.swift */; };
|
||||
CC741228237414070032D352 /* Entity.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC741221237414070032D352 /* Entity.swift */; };
|
||||
CC741229237414070032D352 /* DAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC741222237414070032D352 /* DAO.swift */; };
|
||||
CC741234237414420032D352 /* Entity.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC74122B237414420032D352 /* Entity.swift */; };
|
||||
CC741235237414420032D352 /* DAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC74122C237414420032D352 /* DAO.swift */; };
|
||||
CC741236237414420032D352 /* CoreDataConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC74122F237414420032D352 /* CoreDataConfiguration.swift */; };
|
||||
CC741237237414420032D352 /* CoreDataDAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC741231237414420032D352 /* CoreDataDAO.swift */; };
|
||||
CC741238237414420032D352 /* CoreDataTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC741233237414420032D352 /* CoreDataTranslator.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
CC741207237412EB0032D352 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2E8A9BAF7ECAEC811F5ACE3C /* Pods_CoreDataDAO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoreDataDAO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3CA293F66C575881DDE04B1E /* Pods_RealmDAO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RealmDAO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
50E6127A1CFFD5C64BD5C4C0 /* Pods-RealmDAO.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RealmDAO.debug.xcconfig"; path = "Target Support Files/Pods-RealmDAO/Pods-RealmDAO.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
5EEB202F6918AB3DB4D5F157 /* Pods-CoreDataDAO.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDataDAO.release.xcconfig"; path = "Target Support Files/Pods-CoreDataDAO/Pods-CoreDataDAO.release.xcconfig"; sourceTree = "<group>"; };
|
||||
B2C2591874CB39D025BA9678 /* Pods-CoreDataDAO.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDataDAO.debug.xcconfig"; path = "Target Support Files/Pods-CoreDataDAO/Pods-CoreDataDAO.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
BB6593BCAA1FA4DC2224EB94 /* Pods-RealmDAO.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RealmDAO.release.xcconfig"; path = "Target Support Files/Pods-RealmDAO/Pods-RealmDAO.release.xcconfig"; sourceTree = "<group>"; };
|
||||
CC7411D62374124D0032D352 /* RealmDAO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RealmDAO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
CC7411E4237412650032D352 /* CoreDataDAO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreDataDAO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
CC741218237414070032D352 /* RealmConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmConfiguration.swift; sourceTree = "<group>"; };
|
||||
CC74121A237414070032D352 /* RealmDAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDAO.swift; sourceTree = "<group>"; };
|
||||
CC74121C237414070032D352 /* RealmTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmTranslator.swift; sourceTree = "<group>"; };
|
||||
CC74121E237414070032D352 /* CascadeDeletionProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CascadeDeletionProtocol.swift; sourceTree = "<group>"; };
|
||||
CC74121F237414070032D352 /* RLMEntry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMEntry.swift; sourceTree = "<group>"; };
|
||||
CC741221237414070032D352 /* Entity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Entity.swift; sourceTree = "<group>"; };
|
||||
CC741222237414070032D352 /* DAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DAO.swift; sourceTree = "<group>"; };
|
||||
CC74122B237414420032D352 /* Entity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Entity.swift; sourceTree = "<group>"; };
|
||||
CC74122C237414420032D352 /* DAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DAO.swift; sourceTree = "<group>"; };
|
||||
CC74122F237414420032D352 /* CoreDataConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataConfiguration.swift; sourceTree = "<group>"; };
|
||||
CC741231237414420032D352 /* CoreDataDAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataDAO.swift; sourceTree = "<group>"; };
|
||||
CC741233237414420032D352 /* CoreDataTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataTranslator.swift; sourceTree = "<group>"; };
|
||||
CC74123923741CB20032D352 /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RealmSwift.framework; path = Carthage/Build/iOS/RealmSwift.framework; sourceTree = "<group>"; };
|
||||
CCF3733D2375451600536DE9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "DAO/Supporting Files/Info.plist"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
CC7411D32374124D0032D352 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A5A85A8625ADBD73B3EEA43F /* Pods_RealmDAO.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CC7411E1237412650032D352 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
48BC874C4FE8134679B29670 /* Pods_CoreDataDAO.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
9BBD4E66B9CEA0C2F7995438 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B2C2591874CB39D025BA9678 /* Pods-CoreDataDAO.debug.xcconfig */,
|
||||
5EEB202F6918AB3DB4D5F157 /* Pods-CoreDataDAO.release.xcconfig */,
|
||||
50E6127A1CFFD5C64BD5C4C0 /* Pods-RealmDAO.debug.xcconfig */,
|
||||
BB6593BCAA1FA4DC2224EB94 /* Pods-RealmDAO.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC7411CA2374116F0032D352 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CCF3733D2375451600536DE9 /* Info.plist */,
|
||||
CC7411D82374124D0032D352 /* RealmDAO */,
|
||||
CC7411E5237412650032D352 /* CoreDataDAO */,
|
||||
CC7411D72374124D0032D352 /* Products */,
|
||||
CC7411FD237412E30032D352 /* Frameworks */,
|
||||
9BBD4E66B9CEA0C2F7995438 /* Pods */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC7411D72374124D0032D352 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC7411D62374124D0032D352 /* RealmDAO.framework */,
|
||||
CC7411E4237412650032D352 /* CoreDataDAO.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC7411D82374124D0032D352 /* RealmDAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC741220237414070032D352 /* Core */,
|
||||
CC741216237414070032D352 /* RealmDAO */,
|
||||
);
|
||||
name = RealmDAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC7411E5237412650032D352 /* CoreDataDAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74122A237414420032D352 /* Core */,
|
||||
CC74122D237414420032D352 /* CoreDataDAO */,
|
||||
);
|
||||
name = CoreDataDAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC7411FD237412E30032D352 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74123923741CB20032D352 /* RealmSwift.framework */,
|
||||
2E8A9BAF7ECAEC811F5ACE3C /* Pods_CoreDataDAO.framework */,
|
||||
3CA293F66C575881DDE04B1E /* Pods_RealmDAO.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC741216237414070032D352 /* RealmDAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC741217237414070032D352 /* Configuration */,
|
||||
CC741219237414070032D352 /* DAO */,
|
||||
CC74121B237414070032D352 /* Translator */,
|
||||
CC74121D237414070032D352 /* Model */,
|
||||
);
|
||||
name = RealmDAO;
|
||||
path = DAO/Classes/RealmDAO;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CC741217237414070032D352 /* Configuration */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC741218237414070032D352 /* RealmConfiguration.swift */,
|
||||
);
|
||||
path = Configuration;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC741219237414070032D352 /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74121A237414070032D352 /* RealmDAO.swift */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC74121B237414070032D352 /* Translator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74121C237414070032D352 /* RealmTranslator.swift */,
|
||||
);
|
||||
path = Translator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC74121D237414070032D352 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74121E237414070032D352 /* CascadeDeletionProtocol.swift */,
|
||||
CC74121F237414070032D352 /* RLMEntry.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC741220237414070032D352 /* Core */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC741221237414070032D352 /* Entity.swift */,
|
||||
CC741222237414070032D352 /* DAO.swift */,
|
||||
);
|
||||
name = Core;
|
||||
path = DAO/Classes/Core;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CC74122A237414420032D352 /* Core */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74122B237414420032D352 /* Entity.swift */,
|
||||
CC74122C237414420032D352 /* DAO.swift */,
|
||||
);
|
||||
name = Core;
|
||||
path = DAO/Classes/Core;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CC74122D237414420032D352 /* CoreDataDAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74122E237414420032D352 /* Configuration */,
|
||||
CC741230237414420032D352 /* DAO */,
|
||||
CC741232237414420032D352 /* Translator */,
|
||||
);
|
||||
name = CoreDataDAO;
|
||||
path = DAO/Classes/CoreDataDAO;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
CC74122E237414420032D352 /* Configuration */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC74122F237414420032D352 /* CoreDataConfiguration.swift */,
|
||||
);
|
||||
path = Configuration;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC741230237414420032D352 /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC741231237414420032D352 /* CoreDataDAO.swift */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CC741232237414420032D352 /* Translator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CC741233237414420032D352 /* CoreDataTranslator.swift */,
|
||||
);
|
||||
path = Translator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
CC7411D12374124D0032D352 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CC7411DF237412650032D352 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
CC7411D52374124D0032D352 /* RealmDAO */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = CC7411DE2374124D0032D352 /* Build configuration list for PBXNativeTarget "RealmDAO" */;
|
||||
buildPhases = (
|
||||
17FFAD6DEDF561AB3CECEB03 /* [CP] Check Pods Manifest.lock */,
|
||||
CC7411D12374124D0032D352 /* Headers */,
|
||||
CC7411D22374124D0032D352 /* Sources */,
|
||||
CC7411D32374124D0032D352 /* Frameworks */,
|
||||
CC7411D42374124D0032D352 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = RealmDAO;
|
||||
productName = RealmDAO;
|
||||
productReference = CC7411D62374124D0032D352 /* RealmDAO.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
CC7411E3237412650032D352 /* CoreDataDAO */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = CC7411E9237412650032D352 /* Build configuration list for PBXNativeTarget "CoreDataDAO" */;
|
||||
buildPhases = (
|
||||
FEB9F6DAC170B0F648B677DE /* [CP] Check Pods Manifest.lock */,
|
||||
CC7411DF237412650032D352 /* Headers */,
|
||||
CC7411E0237412650032D352 /* Sources */,
|
||||
CC7411E1237412650032D352 /* Frameworks */,
|
||||
CC7411E2237412650032D352 /* Resources */,
|
||||
CC741207237412EB0032D352 /* Embed Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = CoreDataDAO;
|
||||
productName = CoreDataDAO;
|
||||
productReference = CC7411E4237412650032D352 /* CoreDataDAO.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
CC7411CB2374116F0032D352 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1120;
|
||||
TargetAttributes = {
|
||||
CC7411D52374124D0032D352 = {
|
||||
CreatedOnToolsVersion = 11.2;
|
||||
};
|
||||
CC7411E3237412650032D352 = {
|
||||
CreatedOnToolsVersion = 11.2;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = CC7411CE2374116F0032D352 /* Build configuration list for PBXProject "DAO" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = CC7411CA2374116F0032D352;
|
||||
productRefGroup = CC7411D72374124D0032D352 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
CC7411D52374124D0032D352 /* RealmDAO */,
|
||||
CC7411E3237412650032D352 /* CoreDataDAO */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
CC7411D42374124D0032D352 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CC7411E2237412650032D352 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
17FFAD6DEDF561AB3CECEB03 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RealmDAO-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
FEB9F6DAC170B0F648B677DE /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-CoreDataDAO-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
CC7411D22374124D0032D352 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CC741229237414070032D352 /* DAO.swift in Sources */,
|
||||
CC741225237414070032D352 /* RealmTranslator.swift in Sources */,
|
||||
CC741224237414070032D352 /* RealmDAO.swift in Sources */,
|
||||
CC741228237414070032D352 /* Entity.swift in Sources */,
|
||||
CC741226237414070032D352 /* CascadeDeletionProtocol.swift in Sources */,
|
||||
CC741227237414070032D352 /* RLMEntry.swift in Sources */,
|
||||
CC741223237414070032D352 /* RealmConfiguration.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CC7411E0237412650032D352 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CC741236237414420032D352 /* CoreDataConfiguration.swift in Sources */,
|
||||
CC741235237414420032D352 /* DAO.swift in Sources */,
|
||||
CC741234237414420032D352 /* Entity.swift in Sources */,
|
||||
CC741238237414420032D352 /* CoreDataTranslator.swift in Sources */,
|
||||
CC741237237414420032D352 /* CoreDataDAO.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
CC7411CF2374116F0032D352 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
CC7411D02374116F0032D352 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
CC7411DC2374124D0032D352 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 50E6127A1CFFD5C64BD5C4C0 /* Pods-RealmDAO.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
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;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/DAO/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ru.redmadrobot.RealmDAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
CC7411DD2374124D0032D352 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = BB6593BCAA1FA4DC2224EB94 /* Pods-RealmDAO.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Carthage/Build/iOS",
|
||||
);
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
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;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/DAO/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ru.redmadrobot.RealmDAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
CC7411EA237412650032D352 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = B2C2591874CB39D025BA9678 /* Pods-CoreDataDAO.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
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;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/DAO/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ru.redmadrobot.CoreDataDAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
CC7411EB237412650032D352 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 5EEB202F6918AB3DB4D5F157 /* Pods-CoreDataDAO.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
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;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/DAO/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ru.redmadrobot.CoreDataDAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
CC7411CE2374116F0032D352 /* Build configuration list for PBXProject "DAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
CC7411CF2374116F0032D352 /* Debug */,
|
||||
CC7411D02374116F0032D352 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
CC7411DE2374124D0032D352 /* Build configuration list for PBXNativeTarget "RealmDAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
CC7411DC2374124D0032D352 /* Debug */,
|
||||
CC7411DD2374124D0032D352 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
CC7411E9237412650032D352 /* Build configuration list for PBXNativeTarget "CoreDataDAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
CC7411EA237412650032D352 /* Debug */,
|
||||
CC7411EB237412650032D352 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = CC7411CB2374116F0032D352 /* Project object */;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1120"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "CC7411E3237412650032D352"
|
||||
BuildableName = "CoreDataDAO.framework"
|
||||
BlueprintName = "CoreDataDAO"
|
||||
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>
|
||||
</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">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "CC7411E3237412650032D352"
|
||||
BuildableName = "CoreDataDAO.framework"
|
||||
BlueprintName = "CoreDataDAO"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1120"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "CC7411D52374124D0032D352"
|
||||
BuildableName = "RealmDAO.framework"
|
||||
BlueprintName = "RealmDAO"
|
||||
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>
|
||||
</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">
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "CC7411D52374124D0032D352"
|
||||
BuildableName = "RealmDAO.framework"
|
||||
BlueprintName = "RealmDAO"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
//
|
||||
// DAO.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
/// Parent class for DAO pattern implemetation (aka interface).
|
||||
open class DAO<Model: Entity> {
|
||||
|
||||
// MARK: - Insert/update
|
||||
|
||||
|
||||
/// Saving new entity or update existing.
|
||||
///
|
||||
/// - Parameter entity: entity should be saved.
|
||||
/// - Throws: error if entity can not be saved.
|
||||
open func persist(_ entity: Model) throws {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
/// Saving new entities or update existing.
|
||||
///
|
||||
/// - Parameter entities: entities should be saved.
|
||||
/// - Throws: error if any entity can not be saved.
|
||||
open func persist(_ entities: [Model]) throws {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Read
|
||||
|
||||
/// Read entity from database of `Model` type.
|
||||
///
|
||||
/// - Parameter entityId: entity identifier.
|
||||
/// - Returns: instance of existant entity or nil.
|
||||
open func read(_ entityId: String) -> Model? {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
/// Read all entities from database of `Model` type.
|
||||
///
|
||||
/// - Returns: array of entities.
|
||||
open func read() -> [Model] {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
/// Read all entities from database of `Model` type filtered by predicate.
|
||||
///
|
||||
/// - Parameter predicate: predicate to filter entities.
|
||||
/// - Returns: filtered array of entities.
|
||||
open func read(predicatedBy predicate: NSPredicate?) -> [Model] {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
/// Read all entities from database of `Model` type ordered by field.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - field: ordering field.
|
||||
/// - ascending: ascending flag (descending otherwise).
|
||||
/// - Returns: ordered array of entities.
|
||||
open func read(orderedBy field: String?, ascending: Bool) -> [Model] {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
/// Read all entities from database of `Model` type filtered by predicate and ordered by field.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - predicate: predicate to filter entities.
|
||||
/// - field: ordering field.
|
||||
/// - ascending: ascending flag (descending otherwise).
|
||||
/// - Returns: filtered and ordered array of entities.
|
||||
open func read(predicatedBy predicate: NSPredicate?, orderedBy field: String?,
|
||||
ascending: Bool) -> [Model] {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Delete
|
||||
|
||||
/// Delete all entities of `Model` type.
|
||||
///
|
||||
/// - Throws: error if any entity can not be deleted.
|
||||
open func erase() throws {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
|
||||
/// Delete entity of `Model` type by identifier.
|
||||
///
|
||||
/// - Throws: error if any entity can not be deleted.
|
||||
open func erase(_ entityId: String) throws {
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
//
|
||||
// Entity.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 05.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
/// Parent class for all entities.
|
||||
open class Entity: Hashable {
|
||||
|
||||
/// Hash value for compare entities.
|
||||
open func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(entityId)
|
||||
}
|
||||
|
||||
|
||||
/// Unique entity identifer.
|
||||
open var entityId: String
|
||||
|
||||
|
||||
required public init() {
|
||||
entityId = UUID().uuidString
|
||||
}
|
||||
|
||||
|
||||
/// Creates an instance with identifier.
|
||||
///
|
||||
/// - Parameter entityId: unique entity identifier.
|
||||
public init(entityId: String) {
|
||||
self.entityId = entityId
|
||||
}
|
||||
|
||||
|
||||
/// Redefine this function in child class for proper equality.
|
||||
///
|
||||
/// - Parameter other: entity compare with.
|
||||
/// - Returns: result of comparison.
|
||||
open func equals<T>(_ other: T) -> Bool where T: Entity {
|
||||
return self.entityId == other.entityId
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Custom operator `==` for `Entity` and subclasses.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - lhs: left entity to compare.
|
||||
/// - rhs: right entity to compare.
|
||||
/// - Returns: result of comparison.
|
||||
public func ==<T>(lhs: T, rhs: T) -> Bool where T: Entity {
|
||||
return lhs.equals(rhs)
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
//
|
||||
// CoreDataConfiguration.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 12/05/2017.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
/// `CoreData DAO` configuration.
|
||||
/// Incapsulates basic settings.
|
||||
/// Used to initialize `CoreData DAO`.
|
||||
public struct CoreDataConfiguration {
|
||||
|
||||
/// Name of container also is filename for `*.xcdatamodelid` file.
|
||||
public let containerName: String
|
||||
|
||||
/// Store type like in `CoreData`. `NSInMemoryStoreType`, for instance.
|
||||
public let storeType: String
|
||||
|
||||
/// Options for persistence store
|
||||
public let options: [String: NSObject]
|
||||
|
||||
/// URL of persistent store file
|
||||
public let persistentStoreURL:URL?
|
||||
|
||||
|
||||
/// Create an instance with specified `containerName`, `storeType`, `options`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - containerName: name. See above.
|
||||
/// - storeType: store type. See above.
|
||||
/// - options: persistence store options.
|
||||
/// - persistentStoreURL: URL of persistent store file.
|
||||
public init(
|
||||
containerName: String,
|
||||
storeType: String = NSSQLiteStoreType,
|
||||
options: [String : NSObject] =
|
||||
[
|
||||
NSMigratePersistentStoresAutomaticallyOption: true as NSObject,
|
||||
NSInferMappingModelAutomaticallyOption: true as NSObject
|
||||
],
|
||||
persistentStoreURL:URL? = nil) {
|
||||
|
||||
self.containerName = containerName
|
||||
self.storeType = storeType
|
||||
self.options = options
|
||||
self.persistentStoreURL = persistentStoreURL
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,395 +0,0 @@
|
|||
//
|
||||
// CoreDataDAO.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 2/4/16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import CoreData
|
||||
|
||||
|
||||
/// `DAO` pattern implementation for `CoreData`.
|
||||
open class CoreDataDAO<Model: Entity, CDModel: NSManagedObject> : DAO<Model> {
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
/// Translator for current `Model` and `CDModel` types.
|
||||
private var translator: CoreDataTranslator<Model, CDModel>
|
||||
|
||||
|
||||
/// Persistent store cooridnator. Can be configured by `CoreDataConfiguration`.
|
||||
private let persistentStoreCoordinator: NSPersistentStoreCoordinator
|
||||
|
||||
|
||||
/// Managed object context. Context is created every transaction due to current queue –
|
||||
/// main or background.
|
||||
private var context: NSManagedObjectContext {
|
||||
let context = Thread.isMainThread
|
||||
? NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)
|
||||
: NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
|
||||
|
||||
context.persistentStoreCoordinator = persistentStoreCoordinator
|
||||
context.shouldDeleteInaccessibleFaults = true
|
||||
if #available(iOS 10.0, *) {
|
||||
context.automaticallyMergesChangesFromParent = true
|
||||
}
|
||||
return context
|
||||
}
|
||||
|
||||
|
||||
//MARK: - Public
|
||||
|
||||
/// Creates an instance with specified `translator` and `configuration`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - translator: translator for current `Model` and `CDModel` types.
|
||||
/// - configuration: configuration. See also `CoreDataConfiguration`.
|
||||
/// - Throws: error if loading or adding persistence store is failed.
|
||||
public convenience init(
|
||||
_ translator: CoreDataTranslator<Model, CDModel>,
|
||||
configuration: CoreDataConfiguration) throws {
|
||||
|
||||
if #available(iOS 10, *) {
|
||||
let persistentContainer = NSPersistentContainer(name: configuration.containerName)
|
||||
|
||||
persistentContainer.persistentStoreDescriptions
|
||||
.forEach { description in
|
||||
configuration.options
|
||||
.forEach {
|
||||
description.setOption($0.value, forKey: $0.key)
|
||||
}
|
||||
description.type = configuration.storeType
|
||||
|
||||
if configuration.persistentStoreURL != nil {
|
||||
description.url = configuration.persistentStoreURL
|
||||
}
|
||||
}
|
||||
|
||||
var error: Error?
|
||||
|
||||
persistentContainer.loadPersistentStores { _, e in
|
||||
error = e
|
||||
}
|
||||
|
||||
if let error = error { throw error }
|
||||
|
||||
self.init(translator, persistentContainer: persistentContainer)
|
||||
} else {
|
||||
let url = Bundle(for: CDModel.self).url(
|
||||
forResource: configuration.containerName,
|
||||
withExtension: "momd"
|
||||
)!
|
||||
|
||||
let persistentStoreCoordinator = NSPersistentStoreCoordinator(
|
||||
managedObjectModel: NSManagedObjectModel(contentsOf: url)!
|
||||
)
|
||||
|
||||
let persistentStoreUrl = configuration.persistentStoreURL
|
||||
?? CoreDataDAO.url(storeName: "\(configuration.containerName).db")
|
||||
|
||||
try persistentStoreCoordinator.addPersistentStore(
|
||||
ofType: configuration.storeType,
|
||||
configurationName: nil,
|
||||
at: persistentStoreUrl,
|
||||
options: configuration.options)
|
||||
|
||||
self.init(translator, persistentStoreCoordinator: persistentStoreCoordinator)
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates an instance with specified `translator` and `persistentContainer`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - translator: translator for current `Model` and `CDModel` types.
|
||||
/// - persistentContainer: initialized NSPersistentContainer with loaded persistent stores
|
||||
@available(iOS 10.0, *)
|
||||
public convenience init(
|
||||
_ translator: CoreDataTranslator<Model, CDModel>,
|
||||
persistentContainer: NSPersistentContainer) {
|
||||
|
||||
self.init(
|
||||
translator,
|
||||
persistentStoreCoordinator: persistentContainer.persistentStoreCoordinator
|
||||
)
|
||||
}
|
||||
|
||||
/// Creates an instance with specified `translator` and `persistentStoreCoordinator`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - translator: translator for current `Model` and `CDModel` types.
|
||||
/// - persistentStoreCoordinator: initialized NSPersistentStoreCoordinator with loaded persistent stores
|
||||
public init(
|
||||
_ translator: CoreDataTranslator<Model, CDModel>,
|
||||
persistentStoreCoordinator: NSPersistentStoreCoordinator) {
|
||||
|
||||
self.translator = translator
|
||||
self.persistentStoreCoordinator = persistentStoreCoordinator
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
//MARK: - DAO
|
||||
|
||||
override open func persist(_ entity: Model) throws {
|
||||
var error: Error?
|
||||
|
||||
let context = self.context
|
||||
|
||||
context.performAndWait { [weak self] in
|
||||
guard let `self` = self else { return }
|
||||
|
||||
do {
|
||||
if self.isEntryExist(entity.entityId, inContext: context) {
|
||||
try self.update(entity, inContext: context)
|
||||
} else {
|
||||
try self.create(entity, inContext: context)
|
||||
}
|
||||
} catch let e {
|
||||
error = e
|
||||
}
|
||||
}
|
||||
|
||||
if let error = error { throw error }
|
||||
}
|
||||
|
||||
|
||||
open override func persist(_ entities: [Model]) throws {
|
||||
var error: Error?
|
||||
|
||||
let context = self.context
|
||||
|
||||
context.performAndWait { [weak self] in
|
||||
guard let `self` = self else { return }
|
||||
|
||||
entities.forEach{ entity in
|
||||
if self.isEntryExist(entity.entityId, inContext: context) {
|
||||
let existingEntries = self.fetchEntries(entity.entityId, inContext: context)
|
||||
existingEntries.forEach {
|
||||
self.translator.fill($0, fromEntity: entity, in: context)
|
||||
}
|
||||
} else if let entry = NSEntityDescription.insertNewObject(
|
||||
forEntityName: self.translator.entryClassName,
|
||||
into: context) as? CDModel {
|
||||
|
||||
self.translator.fill(entry, fromEntity: entity, in: context)
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
try context.save()
|
||||
} catch let e {
|
||||
error = e
|
||||
context.rollback()
|
||||
}
|
||||
}
|
||||
|
||||
if let error = error { throw error }
|
||||
}
|
||||
|
||||
|
||||
open override func read(_ entityId: String) -> Model? {
|
||||
|
||||
let context = self.context
|
||||
var entity: Model?
|
||||
|
||||
context.performAndWait { [weak self] in
|
||||
guard
|
||||
let `self` = self,
|
||||
let entries = try? context.fetch(self.request(entityId)),
|
||||
let entry = entries.first
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
let model = Model()
|
||||
self.translator.fill(model, fromEntry: entry)
|
||||
entity = model
|
||||
}
|
||||
|
||||
return entity
|
||||
}
|
||||
|
||||
|
||||
open override func read() -> [Model] {
|
||||
return read(predicatedBy: nil)
|
||||
}
|
||||
|
||||
|
||||
open override func read(predicatedBy predicate: NSPredicate?) -> [Model] {
|
||||
return read(predicatedBy: predicate, orderedBy: nil, ascending: false)
|
||||
}
|
||||
|
||||
|
||||
open override func read(
|
||||
predicatedBy predicate: NSPredicate?,
|
||||
orderedBy field: String?,
|
||||
ascending: Bool) -> [Model] {
|
||||
|
||||
let sortDescriptors = field != nil ? [NSSortDescriptor(key: field, ascending: ascending)] : []
|
||||
|
||||
let context = self.context
|
||||
var models: [Model]?
|
||||
|
||||
context.performAndWait { [weak self] in
|
||||
guard let `self` = self else { return }
|
||||
|
||||
models = self.fetchEntries(
|
||||
predicate,
|
||||
sortDescriptors: sortDescriptors,
|
||||
inContext: context)
|
||||
.compactMap {
|
||||
let entity = Model()
|
||||
self.translator.fill(entity, fromEntry: $0)
|
||||
return entity
|
||||
}
|
||||
}
|
||||
|
||||
return models ?? []
|
||||
}
|
||||
|
||||
|
||||
open override func read(orderedBy field: String?, ascending: Bool) -> [Model] {
|
||||
return read(predicatedBy: nil, orderedBy: field, ascending: ascending)
|
||||
}
|
||||
|
||||
|
||||
override open func erase() throws {
|
||||
var error: Error?
|
||||
|
||||
let context = self.context
|
||||
|
||||
context.performAndWait { [weak self] in
|
||||
guard let `self` = self else { return }
|
||||
|
||||
self.fetchEntries(inContext: context)
|
||||
.forEach(context.delete)
|
||||
|
||||
do {
|
||||
try context.save()
|
||||
} catch let e {
|
||||
error = e
|
||||
context.rollback()
|
||||
}
|
||||
}
|
||||
|
||||
if let error = error { throw error }
|
||||
}
|
||||
|
||||
|
||||
override open func erase(_ entityId: String) throws {
|
||||
var error: Error?
|
||||
|
||||
let context = self.context
|
||||
|
||||
context.performAndWait { [weak self] in
|
||||
guard let `self` = self else { return }
|
||||
|
||||
self.fetchEntries(entityId, inContext: context)
|
||||
.forEach(context.delete)
|
||||
do {
|
||||
try context.save()
|
||||
} catch let e {
|
||||
error = e
|
||||
context.rollback()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if let error = error { throw error }
|
||||
}
|
||||
|
||||
|
||||
//MARK: - Private
|
||||
|
||||
private func fetchEntries(
|
||||
_ entryId: String,
|
||||
inContext context: NSManagedObjectContext) -> [CDModel] {
|
||||
|
||||
let request = self.request(entryId)
|
||||
let entries = try? context.fetch(request)
|
||||
return entries ?? []
|
||||
}
|
||||
|
||||
|
||||
private func fetchEntries(
|
||||
_ predicate: NSPredicate? = nil,
|
||||
sortDescriptors: [NSSortDescriptor] = [],
|
||||
inContext context: NSManagedObjectContext) -> [CDModel] {
|
||||
|
||||
let request = self.request(predicate, sortDescriptors: sortDescriptors)
|
||||
let entries = try? context.fetch(request)
|
||||
return entries ?? []
|
||||
}
|
||||
|
||||
|
||||
private func request(_ entryId: String) -> NSFetchRequest<CDModel> {
|
||||
let request = NSFetchRequest<CDModel>(entityName: translator.entryClassName)
|
||||
request.predicate = NSPredicate(format: "entryId == %@", argumentArray: [entryId])
|
||||
|
||||
return request
|
||||
}
|
||||
|
||||
|
||||
private func request(
|
||||
_ predicate: NSPredicate?,
|
||||
sortDescriptors: [NSSortDescriptor]) -> NSFetchRequest<CDModel> {
|
||||
|
||||
let request = NSFetchRequest<CDModel>(entityName: translator.entryClassName)
|
||||
request.predicate = predicate
|
||||
request.sortDescriptors = sortDescriptors
|
||||
|
||||
return request
|
||||
}
|
||||
|
||||
|
||||
//MARK: - Transactions
|
||||
|
||||
private func isEntryExist(
|
||||
_ entryId: String,
|
||||
inContext context: NSManagedObjectContext) -> Bool {
|
||||
|
||||
let existingEntries = fetchEntries(entryId, inContext: context)
|
||||
return !existingEntries.isEmpty
|
||||
}
|
||||
|
||||
|
||||
private func update(_ entity: Model, inContext context: NSManagedObjectContext) throws {
|
||||
let existingEntries = fetchEntries(entity.entityId, inContext: context)
|
||||
|
||||
existingEntries.forEach {
|
||||
translator.fill($0, fromEntity: entity, in: context)
|
||||
}
|
||||
|
||||
try context.save()
|
||||
}
|
||||
|
||||
|
||||
private func create(_ entity: Model, inContext context: NSManagedObjectContext) throws {
|
||||
guard let entry = NSEntityDescription.insertNewObject(
|
||||
forEntityName: translator.entryClassName,
|
||||
into: context) as? CDModel
|
||||
else {
|
||||
return
|
||||
}
|
||||
|
||||
translator.fill(entry, fromEntity: entity, in: context)
|
||||
|
||||
try context.save()
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Helper
|
||||
|
||||
private class func url(storeName: String) -> URL {
|
||||
var url: URL! = nil
|
||||
|
||||
if let libraryDirectory = FileManager.default.urls(for: .libraryDirectory, in: .userDomainMask).last {
|
||||
url = libraryDirectory.appendingPathComponent(storeName)
|
||||
}
|
||||
|
||||
return url
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
//
|
||||
// RealmTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 06.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
/// Parent class for `CoreData` translators.
|
||||
/// Translators fill properties of new/existant entities from entries and other way.
|
||||
open class CoreDataTranslator<Model: Entity, CDModel: NSManagedObject> {
|
||||
|
||||
/// Helper property for `CoreDataDAO`.
|
||||
open var entryClassName: String {
|
||||
return NSStringFromClass(CDModel.self).components(separatedBy: ".").last!
|
||||
}
|
||||
|
||||
|
||||
/// Creates an instance of class.
|
||||
required public init() { }
|
||||
|
||||
|
||||
/// All properties of entity will be overridden by entry properties.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - entity: instance of `Model` type.
|
||||
/// - fromEntry: instance of `CDModel` type.
|
||||
open func fill(_ entity: Model, fromEntry: CDModel) {
|
||||
fatalError("Abstact method")
|
||||
}
|
||||
|
||||
|
||||
/// All properties of entry will be overridden by entity properties.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - entry: instance of `CDModel` type.
|
||||
/// - fromEntity: instance of `Model` type.
|
||||
/// - context: managed object context for current transaction.
|
||||
open func fill(_ entry: CDModel, fromEntity: Model, in context: NSManagedObjectContext) {
|
||||
fatalError("Abstact method")
|
||||
}
|
||||
|
||||
|
||||
/// All properties of entities will be overridden by entries properties.
|
||||
/// For simplicity create new entries w/o changing existent.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - entries: array of instances of `CDModel` type.
|
||||
/// - fromEntities: array of instances of `Model` type.
|
||||
/// - context: managed object context for current transaction.
|
||||
open func fill(
|
||||
_ entries: inout Set<CDModel>,
|
||||
fromEntities: [Model],
|
||||
in context: NSManagedObjectContext) {
|
||||
|
||||
fromEntities
|
||||
.compactMap { entity -> (CDModel, Model)? in
|
||||
if let entry = NSEntityDescription.insertNewObject(
|
||||
forEntityName: self.entryClassName,
|
||||
into: context) as? CDModel {
|
||||
entries.insert(entry)
|
||||
return (entry, entity)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
.forEach {
|
||||
self.fill($0.0, fromEntity: $0.1, in: context)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// All properties of entries will be overridden by entities properties.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - entities: array of instances of `Model` type.
|
||||
/// - fromEntries: array of instances of `CDModel` type.
|
||||
open func fill(_ entities: inout [Model], fromEntries: Set<CDModel>?) {
|
||||
entities.removeAll()
|
||||
|
||||
fromEntries?.forEach {
|
||||
let model = Model()
|
||||
entities.append(model)
|
||||
self.fill(model, fromEntry: $0)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,65 +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
|
||||
|
||||
/// URL of database.
|
||||
public let databaseURL: URL?
|
||||
|
||||
/// 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`, `dataBaseURL`, `databaseVersion`, `migrationBlock`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - databaseFileName: name. See above.
|
||||
/// - databaseURL: url. See above.
|
||||
/// - databaseVersion: version. See above.
|
||||
/// - migrationBlock: migration block. See above.
|
||||
/// - encryptionKey: encryption key. See above.
|
||||
public init(
|
||||
databaseFileName: String = "Database.realm",
|
||||
databaseURL: URL? = nil,
|
||||
databaseVersion: UInt64 = 1,
|
||||
migrationBlock: MigrationBlock? = nil,
|
||||
encryptionKey: Data? = nil,
|
||||
shouldCompactOnLaunch: ((Int, Int) -> Bool)? = nil) {
|
||||
|
||||
self.databaseFileName = databaseFileName
|
||||
self.databaseURL = databaseURL
|
||||
self.databaseVersion = databaseVersion
|
||||
self.migrationBlock = migrationBlock
|
||||
self.encryptionKey = encryptionKey
|
||||
self.shouldCompactOnLaunch = shouldCompactOnLaunch
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,299 +0,0 @@
|
|||
//
|
||||
// RealmDAO.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import Realm
|
||||
import RealmSwift
|
||||
|
||||
/// `DAO` pattern implementation for `Realm`.
|
||||
open class RealmDAO<Model: Entity, RealmModel: RLMEntry>: DAO<Model> {
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
/// Translator for current `RLMEntry` and `RealmModel` types.
|
||||
private let translator: RealmTranslator<Model, RealmModel>
|
||||
private let configuration: Realm.Configuration
|
||||
/// In-memory Realm instance.
|
||||
private var inMemoryRealm: Realm?
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
/// Creates an instance with specified `translator` and `configuration`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - translator: translator for current `Model` and `RealmModel` types.
|
||||
/// - configuration: configuration. See also `Realm.Configuration`.
|
||||
public init(
|
||||
_ translator: RealmTranslator<Model, RealmModel>,
|
||||
configuration: Realm.Configuration) {
|
||||
|
||||
self.translator = translator
|
||||
self.configuration = configuration
|
||||
super.init()
|
||||
}
|
||||
|
||||
/// Creates an instance with specified `translator` and `configuration`.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - translator: translator for current `Model` and `RealmModel` types.
|
||||
/// - configuration: configuration. See also `RealmConfiguration`.
|
||||
public init(
|
||||
_ translator: RealmTranslator<Model, RealmModel>,
|
||||
configuration: RealmConfiguration) {
|
||||
|
||||
self.translator = translator
|
||||
self.configuration = RealmDAO.makeRealmConfiguration(configuration)
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Creates an instance with specified `translator` and default configuration.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - translator: translator for current `Model` and `RealmModel` types.
|
||||
public convenience init(
|
||||
_ translator: RealmTranslator<Model, RealmModel>) {
|
||||
|
||||
self.init(translator, configuration: RealmConfiguration())
|
||||
}
|
||||
|
||||
|
||||
static func makeRealmConfiguration(_ configuration: RealmConfiguration) -> Realm.Configuration {
|
||||
|
||||
var config = Realm.Configuration.defaultConfiguration
|
||||
|
||||
guard let path = configuration.databaseURL ?? 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? {
|
||||
let documentDirectory = NSSearchPathForDirectoriesInDomains(
|
||||
.documentDirectory,
|
||||
.userDomainMask,
|
||||
true).first as NSString?
|
||||
|
||||
guard let realmPath = documentDirectory?.appendingPathComponent(fileName) else {
|
||||
return nil
|
||||
}
|
||||
return URL(string: realmPath)
|
||||
}
|
||||
|
||||
|
||||
//MARK: - DAO
|
||||
|
||||
override open func persist(_ entity: Model) throws {
|
||||
if let entry = try readFromRealm(entity.entityId) {
|
||||
try autoreleasepool {
|
||||
try realm().beginWrite()
|
||||
translator.fill(entry, fromEntity: entity)
|
||||
try realm().commitWrite()
|
||||
}
|
||||
} else {
|
||||
let entry = RealmModel()
|
||||
translator.fill(entry, fromEntity: entity)
|
||||
try write(entry)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open override func persist(_ entities: [Model]) throws {
|
||||
|
||||
let entries = List<RealmModel>()
|
||||
for entity in entities {
|
||||
if let entry = try? readFromRealm(entity.entityId) {
|
||||
entries.append(entry)
|
||||
}
|
||||
}
|
||||
|
||||
let realm = try self.realm()
|
||||
try autoreleasepool {
|
||||
realm.beginWrite()
|
||||
translator.fill(entries, fromEntities: entities)
|
||||
|
||||
entries.forEach {
|
||||
realm.create(RealmModel.self, value: $0, update: .all)
|
||||
}
|
||||
|
||||
try realm.commitWrite()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override open func read(_ entityId: String) -> Model? {
|
||||
|
||||
guard let entry = try? readFromRealm(entityId) else { return nil }
|
||||
|
||||
let entity = Model()
|
||||
translator.fill(entity, fromEntry: entry)
|
||||
|
||||
return entity
|
||||
}
|
||||
|
||||
|
||||
open override func read() -> [Model] {
|
||||
do {
|
||||
let results = try readFromRealm()
|
||||
return results.map {
|
||||
let entity = Model()
|
||||
self.translator.fill(entity, fromEntry: $0)
|
||||
return entity
|
||||
}
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open override func read(predicatedBy predicate: NSPredicate?) -> [Model] {
|
||||
return read(predicatedBy: predicate, orderedBy: nil)
|
||||
}
|
||||
|
||||
|
||||
open override func read(
|
||||
orderedBy field: String?,
|
||||
ascending: Bool) -> [Model] {
|
||||
|
||||
return read(predicatedBy: nil, orderedBy: field, ascending: ascending)
|
||||
}
|
||||
|
||||
|
||||
open override func read(
|
||||
predicatedBy predicate: NSPredicate?,
|
||||
orderedBy field: String?,
|
||||
ascending: Bool = true) -> [Model] {
|
||||
|
||||
var entries: Results<RealmModel>
|
||||
do {
|
||||
entries = try readFromRealm(predicate)
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
|
||||
if let field = field {
|
||||
entries = entries.sorted(byKeyPath: field, ascending: ascending)
|
||||
}
|
||||
|
||||
return entries.map {
|
||||
let entity = Model()
|
||||
self.translator.fill(entity, fromEntry: $0)
|
||||
return entity
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override open func erase() throws {
|
||||
let results = try readFromRealm()
|
||||
let entries: List<RealmModel> = List<RealmModel>()
|
||||
|
||||
entries.append(objectsIn: results.map {
|
||||
$0 as RealmModel
|
||||
})
|
||||
|
||||
try self.delete(entries)
|
||||
}
|
||||
|
||||
|
||||
override open func erase(_ entityId: String) throws {
|
||||
guard let entry = try readFromRealm(entityId) else {
|
||||
return
|
||||
}
|
||||
try delete(entry)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func write(_ entry: RealmModel) throws {
|
||||
let realm = try self.realm()
|
||||
try realm.write {
|
||||
realm.create(RealmModel.self, value: entry, update: .all)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func write(_ entries: List<RealmModel>) throws {
|
||||
let realm = try self.realm()
|
||||
try realm.write {
|
||||
entries.forEach { (e: RealmModel) -> () in
|
||||
realm.create(RealmModel.self, value: e, update: .all)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func readFromRealm(_ entryId: String) throws -> RealmModel? {
|
||||
let realm = try self.realm()
|
||||
return realm.object(ofType: RealmModel.self, forPrimaryKey: entryId)
|
||||
}
|
||||
|
||||
|
||||
private func readFromRealm(_ predicate: NSPredicate? = nil) throws -> Results<RealmModel> {
|
||||
let realm = try self.realm()
|
||||
let results: Results<RealmModel> = realm.objects(RealmModel.self)
|
||||
guard let predicate = predicate else {
|
||||
return results
|
||||
}
|
||||
return results.filter(predicate)
|
||||
}
|
||||
|
||||
|
||||
private func delete(_ entry: RealmModel) throws {
|
||||
try self.realm().write {
|
||||
cascadeDelete(entry)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func delete(_ entries: List<RealmModel>) throws {
|
||||
try self.realm().write {
|
||||
cascadeDelete(entries)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func cascadeDelete(_ object: Any?) {
|
||||
switch object {
|
||||
case let listObject as List<RealmModel>:
|
||||
for object in listObject {
|
||||
cascadeDelete(object)
|
||||
}
|
||||
|
||||
case let object as Object:
|
||||
if !object.isInvalidated, let deletable = object as? CascadeDeletionProtocol {
|
||||
deletable.objectsToDelete.forEach { child in
|
||||
cascadeDelete(child)
|
||||
}
|
||||
|
||||
try? self.realm().delete(object)
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
private func realm() throws -> Realm {
|
||||
let realm = try Realm(configuration: configuration)
|
||||
|
||||
if configuration.inMemoryIdentifier != nil {
|
||||
inMemoryRealm = realm
|
||||
}
|
||||
|
||||
return realm
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
//
|
||||
// RLMEntry.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import RealmSwift
|
||||
|
||||
|
||||
/// Parent class for `Realm` entries.
|
||||
open class RLMEntry: Object {
|
||||
|
||||
/// Entry identifier. Must be unique.
|
||||
@objc dynamic open var entryId: String
|
||||
|
||||
|
||||
/// Creates an instance with specified `entryId`.
|
||||
///
|
||||
/// - Parameter entryId: entry identifier.
|
||||
public init(entryId: String) {
|
||||
self.entryId = entryId
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
||||
/// Creates an instance with emppty `entryId`.
|
||||
public required override init() {
|
||||
self.entryId = ""
|
||||
super.init()
|
||||
}
|
||||
|
||||
open override class func primaryKey() -> String? {
|
||||
return "entryId"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
//
|
||||
// RealmTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import RealmSwift
|
||||
|
||||
|
||||
open class RealmTranslator<Model: Entity, RealmModel: RLMEntry> {
|
||||
|
||||
public required init() {}
|
||||
|
||||
|
||||
open func fill(_ entry: RealmModel, fromEntity: Model) {
|
||||
fatalError("Abstract method")
|
||||
}
|
||||
|
||||
|
||||
open func fill(_ entity: Model, fromEntry: RealmModel) {
|
||||
fatalError("Abstract method")
|
||||
}
|
||||
|
||||
|
||||
/// All properties of entities will be overridden by entries properties.
|
||||
/// If entry doesn't exist, it'll be created.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - entries: list of instances of `RealmModel` type.
|
||||
/// - fromEntities: array of instances of `Model` type.
|
||||
open func fill(_ entries: List<RealmModel>, fromEntities: [Model]) {
|
||||
var newEntries = [RealmModel]()
|
||||
|
||||
fromEntities
|
||||
.map { entity -> (RealmModel, Model) in
|
||||
let entry = entries.first { $0.entryId == entity.entityId }
|
||||
|
||||
if let entry = entry {
|
||||
return (entry, entity)
|
||||
} else {
|
||||
let entry = RealmModel()
|
||||
newEntries.append(entry)
|
||||
return (entry, entity)
|
||||
}
|
||||
}
|
||||
.forEach {
|
||||
self.fill($0.0, fromEntity: $0.1)
|
||||
}
|
||||
|
||||
if fromEntities.count < entries.count {
|
||||
let entityIds = fromEntities.map { $0.entityId }
|
||||
let deletedEntriesIndexes = entries
|
||||
.filter { !entityIds.contains($0.entryId) }
|
||||
deletedEntriesIndexes.forEach {
|
||||
if let index = entries.index(of: $0) {
|
||||
entries.remove(at: index)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
entries.append(objectsIn: newEntries)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// All properties of entries will be overridden by entities properties.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - entities: array of instances of `Model` type.
|
||||
/// - fromEntries: list of instances of `RealmModel` type.
|
||||
open func fill( _ entities: inout [Model], fromEntries: List<RealmModel>) {
|
||||
entities.removeAll()
|
||||
|
||||
fromEntries.forEach {
|
||||
let model = Model()
|
||||
entities.append(model)
|
||||
self.fill(model, fromEntry: $0)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?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>$(DEVELOPMENT_LANGUAGE)</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>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
//
|
||||
// CoreDataDAOEntityTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 4/25/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
import CoreData
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class CoreDataDAOEntityTests: XCTestCase {
|
||||
|
||||
private var dao: CoreDataDAO<Entity, CDEntity>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
let translator = CDEntityTranslator()
|
||||
let configuration = CoreDataConfiguration(
|
||||
containerName: "Model",
|
||||
storeType: NSInMemoryStoreType
|
||||
)
|
||||
|
||||
dao = try! CoreDataDAO(
|
||||
translator,
|
||||
configuration: configuration
|
||||
)
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! dao.erase()
|
||||
dao = nil
|
||||
}
|
||||
|
||||
func testReadById() {
|
||||
let entity = Entity(entityId: "2")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Read by id is failed")
|
||||
XCTAssertEqual(dao.read("2")?.entityId, entity.entityId, "Read by id is failed")
|
||||
}
|
||||
|
||||
|
||||
func testAsyncReadById() {
|
||||
let entity = Entity(entityId: "2_back")
|
||||
let exp = expectation(description: "")
|
||||
|
||||
DispatchQueue.global().async {
|
||||
|
||||
XCTAssertNotNil(try? self.dao.persist(entity), "Async read by id is failed")
|
||||
|
||||
DispatchQueue.global().async {
|
||||
XCTAssertEqual(self.dao.read("2_back")?.entityId, entity.entityId, "Async read by id is failed")
|
||||
exp.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
|
||||
func testPersist() {
|
||||
let entity = Entity(entityId: "1")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Persist is failed")
|
||||
}
|
||||
|
||||
|
||||
func testPersistAll() {
|
||||
let firstEntity = Entity(entityId: "2")
|
||||
let secondEntity = Entity(entityId: "3")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist([firstEntity, secondEntity]), "Persist All is failed")
|
||||
}
|
||||
|
||||
|
||||
func testAsyncPersist() {
|
||||
let entity = Entity(entityId: "1_back")
|
||||
let exp = expectation(description: "")
|
||||
|
||||
DispatchQueue.global().async {
|
||||
XCTAssertNotNil(try? self.dao.persist(entity), "Saving entity in background is failed")
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
|
||||
func testEraseById() {
|
||||
let entity = Entity(entityId: "3")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Erase is failed")
|
||||
XCTAssertNoThrow(try dao.erase("3"), "Erase is failed")
|
||||
}
|
||||
|
||||
|
||||
func testAsyncEraseById() {
|
||||
let entity = Entity(entityId: "2_back")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Async erase by id is failed")
|
||||
|
||||
let exp = expectation(description: "")
|
||||
DispatchQueue.global().async {
|
||||
XCTAssertNotNil(try? self.dao.erase("2_back"), "Async erase by id is failed")
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
//
|
||||
// CoreDataDAOFoldersTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/23/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
import CoreData
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class CoreDataDAOFoldersTests: XCTestCase {
|
||||
|
||||
private var dao: CoreDataDAO<Folder, CDFolder>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
let translator = CDFolderTranslator()
|
||||
let configuration = CoreDataConfiguration(
|
||||
containerName: "Model",
|
||||
storeType: NSInMemoryStoreType
|
||||
)
|
||||
|
||||
dao = try! CoreDataDAO(
|
||||
translator,
|
||||
configuration: configuration
|
||||
)
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! dao.erase()
|
||||
dao = nil
|
||||
}
|
||||
|
||||
func testPersistMessages() {
|
||||
let message1 = Message(entityId: "abc", text: "text1")
|
||||
let message2 = Message(entityId: "bcc", text: "text2")
|
||||
let folder = Folder(entityId: "fld", name: "Home", messages: [message1, message2])
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(folder), "Persist folder is failed")
|
||||
XCTAssertEqual(dao.read(folder.entityId)?.messages.count, folder.messages.count)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
//
|
||||
// CoreDataDAOManyDAOTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/22/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
import CoreData
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class CoreDataDAOManyDAOTests: XCTestCase {
|
||||
|
||||
private var messagesDAO: CoreDataDAO<Message, CDMessage>!
|
||||
private var folderDAO: CoreDataDAO<Folder, CDFolder>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
let configuration = CoreDataConfiguration(
|
||||
containerName: "Model",
|
||||
storeType: NSInMemoryStoreType
|
||||
)
|
||||
|
||||
let messageTranslator = CDMessageTranslator()
|
||||
messagesDAO = try! CoreDataDAO(
|
||||
messageTranslator,
|
||||
configuration: configuration
|
||||
)
|
||||
|
||||
let folderTranslator = CDFolderTranslator()
|
||||
folderDAO = try! CoreDataDAO(
|
||||
folderTranslator,
|
||||
configuration: configuration
|
||||
)
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! messagesDAO.erase()
|
||||
try! folderDAO.erase()
|
||||
|
||||
messagesDAO = nil
|
||||
folderDAO = nil
|
||||
}
|
||||
|
||||
func testPersistMessage() {
|
||||
let message = Message(entityId: "abc", text: "text")
|
||||
let folder = Folder(entityId: "fld", name: "folder", messages: [])
|
||||
|
||||
XCTAssertNoThrow(try messagesDAO.persist(message), "Persist message is failed")
|
||||
XCTAssertNoThrow(try folderDAO.persist(folder), "Persist message is failed")
|
||||
XCTAssertEqual(message, messagesDAO.read(message.entityId))
|
||||
XCTAssertEqual(folder, folderDAO.read(folder.entityId))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
//
|
||||
// CoreDataDAOMessagesTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/2/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
import CoreData
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class CoreDataDAOMessagesTests: XCTestCase {
|
||||
|
||||
private var dao: CoreDataDAO<Message, CDMessage>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
let translator = CDMessageTranslator()
|
||||
let configuration = CoreDataConfiguration(
|
||||
containerName: "Model",
|
||||
storeType: NSInMemoryStoreType
|
||||
)
|
||||
|
||||
dao = try! CoreDataDAO(
|
||||
translator,
|
||||
configuration: configuration
|
||||
)
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! dao.erase()
|
||||
dao = nil
|
||||
}
|
||||
|
||||
func testPersistMessage() {
|
||||
let message = Message(entityId: "abc", text: "text")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(message), "Persist message is failed")
|
||||
XCTAssertEqual(message, dao.read(message.entityId))
|
||||
}
|
||||
|
||||
func testReadMessage() {
|
||||
let message = Message(entityId: "def", text: "text 2")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(message), "Read message is failed")
|
||||
XCTAssertEqual(message, dao.read("def"))
|
||||
}
|
||||
|
||||
func testEraseMessage() {
|
||||
let message = Message(entityId: "ghi", text: "text 2")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(message), "Erase message is failed")
|
||||
XCTAssertNoThrow(try dao.erase("ghi"), "Erase message is failed")
|
||||
XCTAssertNil(dao.read("ghi"))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
|
|
@ -1,919 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
02160229232A36ED0036116E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 02160228232A36ED0036116E /* Assets.xcassets */; };
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
|
||||
63EBBC5B24D75059B9ADA532 /* Pods_RealmDAOTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0DCA2A834AEC013372828BE4 /* Pods_RealmDAOTests.framework */; };
|
||||
78A211B7C1B6D6AF282EBB71 /* Pods_DAO_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A944DFD46BDAF9137BA01D6 /* Pods_DAO_Example.framework */; };
|
||||
AA10ECB91EEFE058001228A1 /* RealmDAOBookTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA10ECB51EEFE058001228A1 /* RealmDAOBookTests.swift */; };
|
||||
AA10ECBA1EEFE058001228A1 /* RealmDAOEntityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA10ECB61EEFE058001228A1 /* RealmDAOEntityTests.swift */; };
|
||||
AA10ECBB1EEFE058001228A1 /* RealmDAOFolderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA10ECB71EEFE058001228A1 /* RealmDAOFolderTests.swift */; };
|
||||
AA10ECBC1EEFE058001228A1 /* RealmDAOMessagesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA10ECB81EEFE058001228A1 /* RealmDAOMessagesTests.swift */; };
|
||||
AA35256B1EEFDBE2009C4375 /* CDEntityTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525531EEFDBE2009C4375 /* CDEntityTranslator.swift */; };
|
||||
AA35256C1EEFDBE2009C4375 /* CDFolderTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525541EEFDBE2009C4375 /* CDFolderTranslator.swift */; };
|
||||
AA35256D1EEFDBE2009C4375 /* CDMessageTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525551EEFDBE2009C4375 /* CDMessageTranslator.swift */; };
|
||||
AA35256E1EEFDBE2009C4375 /* RLMBookTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525571EEFDBE2009C4375 /* RLMBookTranslator.swift */; };
|
||||
AA35256F1EEFDBE2009C4375 /* RLMEntityTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525581EEFDBE2009C4375 /* RLMEntityTranslator.swift */; };
|
||||
AA3525701EEFDBE2009C4375 /* RLMFolderTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525591EEFDBE2009C4375 /* RLMFolderTranslator.swift */; };
|
||||
AA3525711EEFDBE2009C4375 /* RLMMessageTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA35255A1EEFDBE2009C4375 /* RLMMessageTranslator.swift */; };
|
||||
AA3525721EEFDBE2009C4375 /* Book.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA35255C1EEFDBE2009C4375 /* Book.swift */; };
|
||||
AA3525731EEFDBE2009C4375 /* CDEntity+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA35255E1EEFDBE2009C4375 /* CDEntity+CoreDataProperties.swift */; };
|
||||
AA3525741EEFDBE2009C4375 /* CDEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA35255F1EEFDBE2009C4375 /* CDEntity.swift */; };
|
||||
AA3525751EEFDBE2009C4375 /* CDFolder+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525601EEFDBE2009C4375 /* CDFolder+CoreDataProperties.swift */; };
|
||||
AA3525761EEFDBE2009C4375 /* CDFolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525611EEFDBE2009C4375 /* CDFolder.swift */; };
|
||||
AA3525771EEFDBE2009C4375 /* CDMessage+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525621EEFDBE2009C4375 /* CDMessage+CoreDataProperties.swift */; };
|
||||
AA3525781EEFDBE2009C4375 /* CDMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525631EEFDBE2009C4375 /* CDMessage.swift */; };
|
||||
AA3525791EEFDBE2009C4375 /* Folder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525641EEFDBE2009C4375 /* Folder.swift */; };
|
||||
AA35257A1EEFDBE2009C4375 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525651EEFDBE2009C4375 /* Message.swift */; };
|
||||
AA35257B1EEFDBE2009C4375 /* DBBook.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525671EEFDBE2009C4375 /* DBBook.swift */; };
|
||||
AA35257C1EEFDBE2009C4375 /* DBEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525681EEFDBE2009C4375 /* DBEntity.swift */; };
|
||||
AA35257D1EEFDBE2009C4375 /* DBFolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525691EEFDBE2009C4375 /* DBFolder.swift */; };
|
||||
AA35257E1EEFDBE2009C4375 /* DBMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA35256A1EEFDBE2009C4375 /* DBMessage.swift */; };
|
||||
AA3525821EEFDC24009C4375 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = AA3525801EEFDC24009C4375 /* Model.xcdatamodeld */; };
|
||||
AA3525961EEFDD13009C4375 /* CoreDataDAOEntityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3525921EEFDD13009C4375 /* CoreDataDAOEntityTests.swift */; };
|
||||
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 */; };
|
||||
E6862F802F1820084726DEB8 /* Pods_CoreDataDAOTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F42144986137E1707B5FAC0 /* Pods_CoreDataDAOTests.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
AA10ECAF1EEFE039001228A1 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
|
||||
remoteInfo = DAO_Example;
|
||||
};
|
||||
AA35258C1EEFDCE6009C4375 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 607FACCF1AFB9204008FA782;
|
||||
remoteInfo = DAO_Example;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
02160228232A36ED0036116E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
048D2FC052C450E7600E2FA9 /* Pods-RealmDAOTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RealmDAOTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RealmDAOTests/Pods-RealmDAOTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
0DCA2A834AEC013372828BE4 /* Pods_RealmDAOTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RealmDAOTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1DD31E834DFA3BE6198A94A4 /* Pods-CoreDataDAOTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDataDAOTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoreDataDAOTests/Pods-CoreDataDAOTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
2A944DFD46BDAF9137BA01D6 /* Pods_DAO_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DAO_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
33B58A69D9690C75477DB06B /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
607FACD01AFB9204008FA782 /* DAO_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DAO_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
6B14B1EA7DC79FC4DC1DE526 /* Pods-DAO_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DAO_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-DAO_Example/Pods-DAO_Example.release.xcconfig"; sourceTree = "<group>"; };
|
||||
6F42144986137E1707B5FAC0 /* Pods_CoreDataDAOTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoreDataDAOTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7AA81098C68FE90BF55455CC /* DAO.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = DAO.podspec; path = ../DAO.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
8FB85F7F7AE5E16EDA09AF5A /* Pods-RealmDAOTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RealmDAOTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RealmDAOTests/Pods-RealmDAOTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9096125064B44D5035341130 /* Pods-DAO_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DAO_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DAO_Example/Pods-DAO_Example.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
A0C0C1D67BC9E557747CBD93 /* Pods-DAO_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DAO_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-DAO_Tests/Pods-DAO_Tests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
AA10ECAA1EEFE039001228A1 /* RealmDAOTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RealmDAOTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
AA10ECAE1EEFE039001228A1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
AA10ECB41EEFE058001228A1 /* RealmDAOTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RealmDAOTests-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
AA10ECB51EEFE058001228A1 /* RealmDAOBookTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDAOBookTests.swift; sourceTree = "<group>"; };
|
||||
AA10ECB61EEFE058001228A1 /* RealmDAOEntityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDAOEntityTests.swift; sourceTree = "<group>"; };
|
||||
AA10ECB71EEFE058001228A1 /* RealmDAOFolderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDAOFolderTests.swift; sourceTree = "<group>"; };
|
||||
AA10ECB81EEFE058001228A1 /* RealmDAOMessagesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDAOMessagesTests.swift; sourceTree = "<group>"; };
|
||||
AA3525531EEFDBE2009C4375 /* CDEntityTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDEntityTranslator.swift; sourceTree = "<group>"; };
|
||||
AA3525541EEFDBE2009C4375 /* CDFolderTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDFolderTranslator.swift; sourceTree = "<group>"; };
|
||||
AA3525551EEFDBE2009C4375 /* CDMessageTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDMessageTranslator.swift; sourceTree = "<group>"; };
|
||||
AA3525571EEFDBE2009C4375 /* RLMBookTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMBookTranslator.swift; sourceTree = "<group>"; };
|
||||
AA3525581EEFDBE2009C4375 /* RLMEntityTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMEntityTranslator.swift; sourceTree = "<group>"; };
|
||||
AA3525591EEFDBE2009C4375 /* RLMFolderTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMFolderTranslator.swift; sourceTree = "<group>"; };
|
||||
AA35255A1EEFDBE2009C4375 /* RLMMessageTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMMessageTranslator.swift; sourceTree = "<group>"; };
|
||||
AA35255C1EEFDBE2009C4375 /* Book.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Book.swift; sourceTree = "<group>"; };
|
||||
AA35255E1EEFDBE2009C4375 /* CDEntity+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CDEntity+CoreDataProperties.swift"; sourceTree = "<group>"; };
|
||||
AA35255F1EEFDBE2009C4375 /* CDEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDEntity.swift; sourceTree = "<group>"; };
|
||||
AA3525601EEFDBE2009C4375 /* CDFolder+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CDFolder+CoreDataProperties.swift"; sourceTree = "<group>"; };
|
||||
AA3525611EEFDBE2009C4375 /* CDFolder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDFolder.swift; sourceTree = "<group>"; };
|
||||
AA3525621EEFDBE2009C4375 /* CDMessage+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CDMessage+CoreDataProperties.swift"; sourceTree = "<group>"; };
|
||||
AA3525631EEFDBE2009C4375 /* CDMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CDMessage.swift; sourceTree = "<group>"; };
|
||||
AA3525641EEFDBE2009C4375 /* Folder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Folder.swift; sourceTree = "<group>"; };
|
||||
AA3525651EEFDBE2009C4375 /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = "<group>"; };
|
||||
AA3525671EEFDBE2009C4375 /* DBBook.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBBook.swift; sourceTree = "<group>"; };
|
||||
AA3525681EEFDBE2009C4375 /* DBEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBEntity.swift; sourceTree = "<group>"; };
|
||||
AA3525691EEFDBE2009C4375 /* DBFolder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBFolder.swift; sourceTree = "<group>"; };
|
||||
AA35256A1EEFDBE2009C4375 /* DBMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBMessage.swift; sourceTree = "<group>"; };
|
||||
AA3525811EEFDC24009C4375 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
|
||||
AA3525871EEFDCE6009C4375 /* CoreDataDAOTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreDataDAOTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
AA35258B1EEFDCE6009C4375 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
AA3525911EEFDD13009C4375 /* CoreDataDAOTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CoreDataDAOTests-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
AA3525921EEFDD13009C4375 /* CoreDataDAOEntityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataDAOEntityTests.swift; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
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; };
|
||||
F8C399142A0F0FA7C064D093 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
607FACCD1AFB9204008FA782 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
78A211B7C1B6D6AF282EBB71 /* Pods_DAO_Example.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AA10ECA71EEFE039001228A1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
63EBBC5B24D75059B9ADA532 /* Pods_RealmDAOTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AA3525841EEFDCE6009C4375 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E6862F802F1820084726DEB8 /* Pods_CoreDataDAOTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
607FACC71AFB9204008FA782 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD21AFB9204008FA782 /* Example for DAO */,
|
||||
AA3525881EEFDCE6009C4375 /* CoreDataDAOTests */,
|
||||
AA10ECAB1EEFE039001228A1 /* RealmDAOTests */,
|
||||
CB0F3F47EAF7977E58A370FB /* Frameworks */,
|
||||
EF4D865297EF284754A73C8C /* Pods */,
|
||||
607FACF51AFB993E008FA782 /* Podspec Metadata */,
|
||||
607FACD11AFB9204008FA782 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD11AFB9204008FA782 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD01AFB9204008FA782 /* DAO_Example.app */,
|
||||
AA3525871EEFDCE6009C4375 /* CoreDataDAOTests.xctest */,
|
||||
AA10ECAA1EEFE039001228A1 /* RealmDAOTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD21AFB9204008FA782 /* Example for DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
|
||||
AA35254E1EEFDBE2009C4375 /* Classes */,
|
||||
AA35257F1EEFDC24009C4375 /* Resources */,
|
||||
607FACD31AFB9204008FA782 /* Supporting Files */,
|
||||
);
|
||||
name = "Example for DAO";
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACD31AFB9204008FA782 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
607FACD41AFB9204008FA782 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
607FACF51AFB993E008FA782 /* Podspec Metadata */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7AA81098C68FE90BF55455CC /* DAO.podspec */,
|
||||
33B58A69D9690C75477DB06B /* README.md */,
|
||||
F8C399142A0F0FA7C064D093 /* LICENSE */,
|
||||
);
|
||||
name = "Podspec Metadata";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA10ECAB1EEFE039001228A1 /* RealmDAOTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA10ECAE1EEFE039001228A1 /* Info.plist */,
|
||||
AA10ECB51EEFE058001228A1 /* RealmDAOBookTests.swift */,
|
||||
AA10ECB61EEFE058001228A1 /* RealmDAOEntityTests.swift */,
|
||||
AA10ECB71EEFE058001228A1 /* RealmDAOFolderTests.swift */,
|
||||
AA10ECB81EEFE058001228A1 /* RealmDAOMessagesTests.swift */,
|
||||
AA10ECB41EEFE058001228A1 /* RealmDAOTests-Bridging-Header.h */,
|
||||
);
|
||||
path = RealmDAOTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA35254E1EEFDBE2009C4375 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA35254F1EEFDBE2009C4375 /* Business Logic */,
|
||||
AA35255B1EEFDBE2009C4375 /* Model */,
|
||||
);
|
||||
path = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA35254F1EEFDBE2009C4375 /* Business Logic */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525501EEFDBE2009C4375 /* Helper */,
|
||||
);
|
||||
path = "Business Logic";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA3525501EEFDBE2009C4375 /* Helper */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525511EEFDBE2009C4375 /* DAO */,
|
||||
);
|
||||
path = Helper;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA3525511EEFDBE2009C4375 /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525521EEFDBE2009C4375 /* CoreDataTranslator */,
|
||||
AA3525561EEFDBE2009C4375 /* RealmTranslator */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA3525521EEFDBE2009C4375 /* CoreDataTranslator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525531EEFDBE2009C4375 /* CDEntityTranslator.swift */,
|
||||
AA3525541EEFDBE2009C4375 /* CDFolderTranslator.swift */,
|
||||
AA3525551EEFDBE2009C4375 /* CDMessageTranslator.swift */,
|
||||
);
|
||||
path = CoreDataTranslator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA3525561EEFDBE2009C4375 /* RealmTranslator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525571EEFDBE2009C4375 /* RLMBookTranslator.swift */,
|
||||
AA3525581EEFDBE2009C4375 /* RLMEntityTranslator.swift */,
|
||||
AA3525591EEFDBE2009C4375 /* RLMFolderTranslator.swift */,
|
||||
AA35255A1EEFDBE2009C4375 /* RLMMessageTranslator.swift */,
|
||||
);
|
||||
path = RealmTranslator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA35255B1EEFDBE2009C4375 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA35255C1EEFDBE2009C4375 /* Book.swift */,
|
||||
AA35255D1EEFDBE2009C4375 /* CoreDataDatabase */,
|
||||
AA3525641EEFDBE2009C4375 /* Folder.swift */,
|
||||
AA3525651EEFDBE2009C4375 /* Message.swift */,
|
||||
AA3525661EEFDBE2009C4375 /* RealmDatabase */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA35255D1EEFDBE2009C4375 /* CoreDataDatabase */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA35255F1EEFDBE2009C4375 /* CDEntity.swift */,
|
||||
AA35255E1EEFDBE2009C4375 /* CDEntity+CoreDataProperties.swift */,
|
||||
AA3525611EEFDBE2009C4375 /* CDFolder.swift */,
|
||||
AA3525601EEFDBE2009C4375 /* CDFolder+CoreDataProperties.swift */,
|
||||
AA3525631EEFDBE2009C4375 /* CDMessage.swift */,
|
||||
AA3525621EEFDBE2009C4375 /* CDMessage+CoreDataProperties.swift */,
|
||||
);
|
||||
path = CoreDataDatabase;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA3525661EEFDBE2009C4375 /* RealmDatabase */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525671EEFDBE2009C4375 /* DBBook.swift */,
|
||||
AA3525681EEFDBE2009C4375 /* DBEntity.swift */,
|
||||
AA3525691EEFDBE2009C4375 /* DBFolder.swift */,
|
||||
AA35256A1EEFDBE2009C4375 /* DBMessage.swift */,
|
||||
);
|
||||
path = RealmDatabase;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA35257F1EEFDC24009C4375 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525801EEFDC24009C4375 /* Model.xcdatamodeld */,
|
||||
02160228232A36ED0036116E /* Assets.xcassets */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AA3525881EEFDCE6009C4375 /* CoreDataDAOTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA3525921EEFDD13009C4375 /* CoreDataDAOEntityTests.swift */,
|
||||
AA3525931EEFDD13009C4375 /* CoreDataDAOFoldersTests.swift */,
|
||||
AA3525941EEFDD13009C4375 /* CoreDataDAOManyDAOTests.swift */,
|
||||
AA3525951EEFDD13009C4375 /* CoreDataDAOMessagesTests.swift */,
|
||||
AA3525911EEFDD13009C4375 /* CoreDataDAOTests-Bridging-Header.h */,
|
||||
AA35258B1EEFDCE6009C4375 /* Info.plist */,
|
||||
);
|
||||
path = CoreDataDAOTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CB0F3F47EAF7977E58A370FB /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2A944DFD46BDAF9137BA01D6 /* Pods_DAO_Example.framework */,
|
||||
BF445E2FB5382CAF4125954E /* Pods_DAO_Tests.framework */,
|
||||
6F42144986137E1707B5FAC0 /* Pods_CoreDataDAOTests.framework */,
|
||||
0DCA2A834AEC013372828BE4 /* Pods_RealmDAOTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EF4D865297EF284754A73C8C /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9096125064B44D5035341130 /* Pods-DAO_Example.debug.xcconfig */,
|
||||
6B14B1EA7DC79FC4DC1DE526 /* Pods-DAO_Example.release.xcconfig */,
|
||||
A0C0C1D67BC9E557747CBD93 /* Pods-DAO_Tests.debug.xcconfig */,
|
||||
B3F6075B730F33239A8C0C16 /* Pods-DAO_Tests.release.xcconfig */,
|
||||
B83929C10B53857ABAEBA293 /* Pods-CoreDataDAOTests.debug.xcconfig */,
|
||||
1DD31E834DFA3BE6198A94A4 /* Pods-CoreDataDAOTests.release.xcconfig */,
|
||||
8FB85F7F7AE5E16EDA09AF5A /* Pods-RealmDAOTests.debug.xcconfig */,
|
||||
048D2FC052C450E7600E2FA9 /* Pods-RealmDAOTests.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
607FACCF1AFB9204008FA782 /* DAO_Example */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "DAO_Example" */;
|
||||
buildPhases = (
|
||||
396DD212B4355BA1D08DC7E7 /* [CP] Check Pods Manifest.lock */,
|
||||
607FACCC1AFB9204008FA782 /* Sources */,
|
||||
607FACCD1AFB9204008FA782 /* Frameworks */,
|
||||
607FACCE1AFB9204008FA782 /* Resources */,
|
||||
A3C342A12354181FB1CDC888 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = DAO_Example;
|
||||
productName = DAO;
|
||||
productReference = 607FACD01AFB9204008FA782 /* DAO_Example.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
AA10ECA91EEFE039001228A1 /* RealmDAOTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = AA10ECB11EEFE039001228A1 /* Build configuration list for PBXNativeTarget "RealmDAOTests" */;
|
||||
buildPhases = (
|
||||
847A3AC11FE1C324C80B4DFC /* [CP] Check Pods Manifest.lock */,
|
||||
AA10ECA61EEFE039001228A1 /* Sources */,
|
||||
AA10ECA71EEFE039001228A1 /* Frameworks */,
|
||||
AA10ECA81EEFE039001228A1 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
AA10ECB01EEFE039001228A1 /* PBXTargetDependency */,
|
||||
);
|
||||
name = RealmDAOTests;
|
||||
productName = RealmDAOTests;
|
||||
productReference = AA10ECAA1EEFE039001228A1 /* RealmDAOTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
AA3525861EEFDCE6009C4375 /* CoreDataDAOTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = AA35258E1EEFDCE6009C4375 /* Build configuration list for PBXNativeTarget "CoreDataDAOTests" */;
|
||||
buildPhases = (
|
||||
EC8476E3A4C369B6B36446A1 /* [CP] Check Pods Manifest.lock */,
|
||||
AA3525831EEFDCE6009C4375 /* Sources */,
|
||||
AA3525841EEFDCE6009C4375 /* Frameworks */,
|
||||
AA3525851EEFDCE6009C4375 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
AA35258D1EEFDCE6009C4375 /* PBXTargetDependency */,
|
||||
);
|
||||
name = CoreDataDAOTests;
|
||||
productName = CoreDataDAOTests;
|
||||
productReference = AA3525871EEFDCE6009C4375 /* CoreDataDAOTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
607FACC81AFB9204008FA782 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0830;
|
||||
LastUpgradeCheck = 1030;
|
||||
ORGANIZATIONNAME = CocoaPods;
|
||||
TargetAttributes = {
|
||||
607FACCF1AFB9204008FA782 = {
|
||||
CreatedOnToolsVersion = 6.3.1;
|
||||
LastSwiftMigration = 1030;
|
||||
};
|
||||
AA10ECA91EEFE039001228A1 = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
DevelopmentTeam = 42LRQS6X44;
|
||||
LastSwiftMigration = 1030;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 607FACCF1AFB9204008FA782;
|
||||
};
|
||||
AA3525861EEFDCE6009C4375 = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
DevelopmentTeam = 42LRQS6X44;
|
||||
LastSwiftMigration = 1030;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 607FACCF1AFB9204008FA782;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "DAO" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 607FACC71AFB9204008FA782;
|
||||
productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
607FACCF1AFB9204008FA782 /* DAO_Example */,
|
||||
AA3525861EEFDCE6009C4375 /* CoreDataDAOTests */,
|
||||
AA10ECA91EEFE039001228A1 /* RealmDAOTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
607FACCE1AFB9204008FA782 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
02160229232A36ED0036116E /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AA10ECA81EEFE039001228A1 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AA3525851EEFDCE6009C4375 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
396DD212B4355BA1D08DC7E7 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-DAO_Example-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
847A3AC11FE1C324C80B4DFC /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RealmDAOTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
A3C342A12354181FB1CDC888 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-DAO_Example/Pods-DAO_Example-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/DAO/DAO.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DAO.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DAO_Example/Pods-DAO_Example-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
EC8476E3A4C369B6B36446A1 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-CoreDataDAOTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
607FACCC1AFB9204008FA782 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AA35256E1EEFDBE2009C4375 /* RLMBookTranslator.swift in Sources */,
|
||||
AA3525731EEFDBE2009C4375 /* CDEntity+CoreDataProperties.swift in Sources */,
|
||||
AA3525771EEFDBE2009C4375 /* CDMessage+CoreDataProperties.swift in Sources */,
|
||||
AA35257D1EEFDBE2009C4375 /* DBFolder.swift in Sources */,
|
||||
AA35257C1EEFDBE2009C4375 /* DBEntity.swift in Sources */,
|
||||
AA35257A1EEFDBE2009C4375 /* Message.swift in Sources */,
|
||||
AA3525791EEFDBE2009C4375 /* Folder.swift in Sources */,
|
||||
AA3525741EEFDBE2009C4375 /* CDEntity.swift in Sources */,
|
||||
AA3525781EEFDBE2009C4375 /* CDMessage.swift in Sources */,
|
||||
AA3525821EEFDC24009C4375 /* Model.xcdatamodeld in Sources */,
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
|
||||
AA35257B1EEFDBE2009C4375 /* DBBook.swift in Sources */,
|
||||
AA3525701EEFDBE2009C4375 /* RLMFolderTranslator.swift in Sources */,
|
||||
AA35257E1EEFDBE2009C4375 /* DBMessage.swift in Sources */,
|
||||
AA35256F1EEFDBE2009C4375 /* RLMEntityTranslator.swift in Sources */,
|
||||
AA3525761EEFDBE2009C4375 /* CDFolder.swift in Sources */,
|
||||
AA35256C1EEFDBE2009C4375 /* CDFolderTranslator.swift in Sources */,
|
||||
AA3525721EEFDBE2009C4375 /* Book.swift in Sources */,
|
||||
AA35256D1EEFDBE2009C4375 /* CDMessageTranslator.swift in Sources */,
|
||||
AA35256B1EEFDBE2009C4375 /* CDEntityTranslator.swift in Sources */,
|
||||
AA3525751EEFDBE2009C4375 /* CDFolder+CoreDataProperties.swift in Sources */,
|
||||
AA3525711EEFDBE2009C4375 /* RLMMessageTranslator.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AA10ECA61EEFE039001228A1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AA10ECB91EEFE058001228A1 /* RealmDAOBookTests.swift in Sources */,
|
||||
AA10ECBA1EEFE058001228A1 /* RealmDAOEntityTests.swift in Sources */,
|
||||
AA10ECBC1EEFE058001228A1 /* RealmDAOMessagesTests.swift in Sources */,
|
||||
AA10ECBB1EEFE058001228A1 /* RealmDAOFolderTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
AA3525831EEFDCE6009C4375 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AA3525961EEFDD13009C4375 /* CoreDataDAOEntityTests.swift in Sources */,
|
||||
AA3525981EEFDD13009C4375 /* CoreDataDAOManyDAOTests.swift in Sources */,
|
||||
AA3525971EEFDD13009C4375 /* CoreDataDAOFoldersTests.swift in Sources */,
|
||||
AA3525991EEFDD13009C4375 /* CoreDataDAOMessagesTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
AA10ECB01EEFE039001228A1 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 607FACCF1AFB9204008FA782 /* DAO_Example */;
|
||||
targetProxy = AA10ECAF1EEFE039001228A1 /* PBXContainerItemProxy */;
|
||||
};
|
||||
AA35258D1EEFDCE6009C4375 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 607FACCF1AFB9204008FA782 /* DAO_Example */;
|
||||
targetProxy = AA35258C1EEFDCE6009C4375 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
607FACED1AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
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;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
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_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
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_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACEE1AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
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;
|
||||
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";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
607FACF01AFB9204008FA782 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9096125064B44D5035341130 /* Pods-DAO_Example.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
INFOPLIST_FILE = DAO/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
607FACF11AFB9204008FA782 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 6B14B1EA7DC79FC4DC1DE526 /* Pods-DAO_Example.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
INFOPLIST_FILE = DAO/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MARKETING_VERSION = 1.5.0;
|
||||
MODULE_NAME = ExampleApp;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
AA10ECB21EEFE039001228A1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8FB85F7F7AE5E16EDA09AF5A /* Pods-RealmDAOTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 42LRQS6X44;
|
||||
INFOPLIST_FILE = RealmDAOTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.RealmDAOTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "RealmDAOTests/RealmDAOTests-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DAO_Example.app/DAO_Example";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AA10ECB31EEFE039001228A1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 048D2FC052C450E7600E2FA9 /* Pods-RealmDAOTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
DEVELOPMENT_TEAM = 42LRQS6X44;
|
||||
INFOPLIST_FILE = RealmDAOTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.RealmDAOTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "RealmDAOTests/RealmDAOTests-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DAO_Example.app/DAO_Example";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
AA35258F1EEFDCE6009C4375 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = B83929C10B53857ABAEBA293 /* Pods-CoreDataDAOTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 42LRQS6X44;
|
||||
INFOPLIST_FILE = CoreDataDAOTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.CoreDataDAOTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "CoreDataDAOTests/CoreDataDAOTests-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DAO_Example.app/DAO_Example";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AA3525901EEFDCE6009C4375 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 1DD31E834DFA3BE6198A94A4 /* Pods-CoreDataDAOTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
DEVELOPMENT_TEAM = 42LRQS6X44;
|
||||
INFOPLIST_FILE = CoreDataDAOTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.CoreDataDAOTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "CoreDataDAOTests/CoreDataDAOTests-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DAO_Example.app/DAO_Example";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "DAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
607FACED1AFB9204008FA782 /* Debug */,
|
||||
607FACEE1AFB9204008FA782 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "DAO_Example" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
607FACF01AFB9204008FA782 /* Debug */,
|
||||
607FACF11AFB9204008FA782 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
AA10ECB11EEFE039001228A1 /* Build configuration list for PBXNativeTarget "RealmDAOTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AA10ECB21EEFE039001228A1 /* Debug */,
|
||||
AA10ECB31EEFE039001228A1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
AA35258E1EEFDCE6009C4375 /* Build configuration list for PBXNativeTarget "CoreDataDAOTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AA35258F1EEFDCE6009C4375 /* Debug */,
|
||||
AA3525901EEFDCE6009C4375 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCVersionGroup section */
|
||||
AA3525801EEFDC24009C4375 /* Model.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
AA3525811EEFDC24009C4375 /* Model.xcdatamodel */,
|
||||
);
|
||||
currentVersion = AA3525811EEFDC24009C4375 /* Model.xcdatamodel */;
|
||||
path = Model.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
/* End XCVersionGroup section */
|
||||
};
|
||||
rootObject = 607FACC81AFB9204008FA782 /* Project object */;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:DAO.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1030"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "DAO_Example.app"
|
||||
BlueprintName = "DAO_Example"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AA3525861EEFDCE6009C4375"
|
||||
BuildableName = "CoreDataDAOTests.xctest"
|
||||
BlueprintName = "CoreDataDAOTests"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "AA10ECA91EEFE039001228A1"
|
||||
BuildableName = "RealmDAOTests.xctest"
|
||||
BlueprintName = "RealmDAOTests"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "DAO_Example.app"
|
||||
BlueprintName = "DAO_Example"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<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">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "DAO_Example.app"
|
||||
BlueprintName = "DAO_Example"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<CommandLineArguments>
|
||||
<CommandLineArgument
|
||||
argument = "-com.apple.CoreData.ConcurrencyDebug 1"
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
|
||||
BuildableName = "DAO_Example.app"
|
||||
BlueprintName = "DAO_Example"
|
||||
ReferencedContainer = "container:DAO.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:DAO.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<?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>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
//
|
||||
// AppDelegate.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 06/13/2017.
|
||||
// Copyright (c) 2017 RedMadRobot. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
//
|
||||
// CDEntityTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 2/9/16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import CoreData
|
||||
|
||||
class CDEntityTranslator: CoreDataTranslator<Entity, CDEntity> {
|
||||
|
||||
override func fill(_ entity: Entity, fromEntry: CDEntity) {
|
||||
entity.entityId = fromEntry.entryId
|
||||
}
|
||||
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
override func fill(
|
||||
_ entry: CDEntity,
|
||||
fromEntity entity: Entity,
|
||||
in context: NSManagedObjectContext) {
|
||||
entry.entryId = entity.entityId
|
||||
}
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
//
|
||||
// CDFolderTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/2/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import CoreData
|
||||
|
||||
|
||||
class CDFolderTranslator: CoreDataTranslator<Folder, CDFolder> {
|
||||
|
||||
required init() {}
|
||||
|
||||
|
||||
override func fill(_ entity: Folder, fromEntry entry: CDFolder) {
|
||||
entity.entityId = entry.entryId
|
||||
entity.name = entry.name
|
||||
|
||||
CDMessageTranslator().fill(&entity.messages, fromEntries: entry.messages as? Set<CDMessage>)
|
||||
}
|
||||
|
||||
|
||||
override func fill(
|
||||
_ entry: CDFolder,
|
||||
fromEntity entity: Folder,
|
||||
in context: NSManagedObjectContext) {
|
||||
entry.entryId = entity.entityId
|
||||
entry.name = entity.name
|
||||
|
||||
var messages = Set<CDMessage>()
|
||||
CDMessageTranslator().fill(&messages, fromEntities: entity.messages, in: context)
|
||||
|
||||
if let m = entry.messages {
|
||||
entry.removeFromMessages(m)
|
||||
}
|
||||
|
||||
entry.addToMessages(messages as NSSet)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
//
|
||||
// CDMessageTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/2/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import CoreData
|
||||
|
||||
|
||||
class CDMessageTranslator: CoreDataTranslator<Message, CDMessage> {
|
||||
|
||||
override func fill(_ entity: Message?, fromEntry entry: CDMessage) {
|
||||
entity?.entityId = entry.entryId
|
||||
entity?.text = entry.text
|
||||
}
|
||||
|
||||
|
||||
required init() {}
|
||||
|
||||
|
||||
override func fill(
|
||||
_ entry: CDMessage,
|
||||
fromEntity entity: Message,
|
||||
in context: NSManagedObjectContext) {
|
||||
entry.entryId = entity.entityId
|
||||
entry.text = entity.text
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
//
|
||||
// RLMBookTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/17/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import DAO
|
||||
|
||||
class RLMBookTranslator: RealmTranslator<Book, DBBook> {
|
||||
|
||||
required init() {}
|
||||
|
||||
|
||||
override func fill(_ entity: Book, fromEntry: DBBook) {
|
||||
entity.entityId = fromEntry.entryId
|
||||
entity.name = fromEntry.name
|
||||
entity.authors = fromEntry.authors.map { $0 }
|
||||
entity.dates = fromEntry.dates.map { $0 }
|
||||
entity.pages = fromEntry.pages.map { $0 }
|
||||
entity.attachments = fromEntry.attachments.map { $0 }
|
||||
}
|
||||
|
||||
|
||||
override func fill(_ entry: DBBook, fromEntity: Book) {
|
||||
if entry.entryId != fromEntity.entityId {
|
||||
entry.entryId = fromEntity.entityId
|
||||
}
|
||||
|
||||
entry.name = fromEntity.name
|
||||
|
||||
entry.authors.removeAll()
|
||||
entry.dates.removeAll()
|
||||
entry.pages.removeAll()
|
||||
entry.attachments.removeAll()
|
||||
|
||||
entry.authors.append(objectsIn: fromEntity.authors)
|
||||
entry.dates.append(objectsIn: fromEntity.dates)
|
||||
entry.pages.append(objectsIn: fromEntity.pages)
|
||||
entry.attachments.append(objectsIn: fromEntity.attachments)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
//
|
||||
// RealmTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 05.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import DAO
|
||||
|
||||
class RLMEntityTranslator: RealmTranslator<Entity, DBEntity> {
|
||||
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
override func fill(_ entity: Entity, fromEntry: DBEntity) {
|
||||
entity.entityId = fromEntry.entryId
|
||||
}
|
||||
|
||||
|
||||
override func fill(_ entry: DBEntity, fromEntity: Entity) {
|
||||
if entry.entryId != fromEntity.entityId {
|
||||
entry.entryId = fromEntity.entityId
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
//
|
||||
// RLMFolderTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import RealmSwift
|
||||
|
||||
class RLMFolderTranslator: RealmTranslator<Folder, DBFolder> {
|
||||
|
||||
required init() {}
|
||||
|
||||
|
||||
override func fill(_ entity: Folder, fromEntry: DBFolder) {
|
||||
entity.entityId = fromEntry.entryId
|
||||
entity.name = fromEntry.name
|
||||
|
||||
RLMMessageTranslator().fill(&entity.messages, fromEntries: fromEntry.messages)
|
||||
}
|
||||
|
||||
|
||||
override func fill(_ entry: DBFolder, fromEntity: Folder) {
|
||||
if entry.entryId != fromEntity.entityId {
|
||||
entry.entryId = fromEntity.entityId
|
||||
}
|
||||
entry.name = fromEntity.name
|
||||
|
||||
RLMMessageTranslator().fill(entry.messages, fromEntities: fromEntity.messages)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
//
|
||||
// RLMMessageTranslator.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
|
||||
class RLMMessageTranslator: RealmTranslator<Message, DBMessage> {
|
||||
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
override func fill(_ entity: Message, fromEntry: DBMessage) {
|
||||
entity.entityId = fromEntry.entryId
|
||||
entity.text = fromEntry.text
|
||||
}
|
||||
|
||||
|
||||
override func fill(_ entry: DBMessage, fromEntity: Message) {
|
||||
if entry.entryId != fromEntity.entityId {
|
||||
entry.entryId = fromEntity.entityId
|
||||
}
|
||||
entry.text = fromEntity.text
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
//
|
||||
// Book.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/17/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import DAO
|
||||
|
||||
|
||||
class Book: Entity {
|
||||
|
||||
var name: String
|
||||
|
||||
var authors: [String]
|
||||
|
||||
var dates: [Date]
|
||||
|
||||
var pages: [Int]
|
||||
|
||||
var attachments: [Data]
|
||||
|
||||
|
||||
init(entityId: String, name: String, authors: [String], dates: [Date], pages: [Int], attachments: [Data]) {
|
||||
self.name = name
|
||||
self.authors = authors
|
||||
self.dates = dates
|
||||
self.pages = pages
|
||||
self.attachments = attachments
|
||||
|
||||
super.init(entityId: entityId)
|
||||
}
|
||||
|
||||
|
||||
required init() {
|
||||
self.name = ""
|
||||
self.authors = []
|
||||
self.dates = []
|
||||
self.pages = []
|
||||
self.attachments = []
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
//
|
||||
// CDEntity+CoreDataProperties.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 09/02/16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu
|
||||
// to delete and recreate this implementation file for your updated model.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
extension CDEntity {
|
||||
|
||||
@NSManaged var entryId: String
|
||||
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
//
|
||||
// CDEntity.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 09/02/16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
@objc(CDEntity)
|
||||
class CDEntity: NSManagedObject {
|
||||
|
||||
// Insert code here to add functionality to your managed object subclass
|
||||
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
//
|
||||
// CDFolder+CoreDataProperties.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/2/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
extension CDFolder {
|
||||
|
||||
@nonobjc
|
||||
class func fetchRequest() -> NSFetchRequest<CDFolder> {
|
||||
return NSFetchRequest<CDFolder>(entityName: "CDFolder")
|
||||
}
|
||||
|
||||
@NSManaged var name: String
|
||||
@NSManaged var messages: NSSet?
|
||||
|
||||
}
|
||||
|
||||
// MARK: Generated accessors for messages
|
||||
extension CDFolder {
|
||||
|
||||
@objc(addMessagesObject:)
|
||||
@NSManaged func addToMessages(_ value: CDMessage)
|
||||
|
||||
@objc(removeMessagesObject:)
|
||||
@NSManaged func removeFromMessages(_ value: CDMessage)
|
||||
|
||||
@objc(addMessages:)
|
||||
@NSManaged func addToMessages(_ values: NSSet)
|
||||
|
||||
@objc(removeMessages:)
|
||||
@NSManaged func removeFromMessages(_ values: NSSet)
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
//
|
||||
// CDFolder.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/2/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
@objc(CDFolder)
|
||||
class CDFolder: CDEntity {
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
//
|
||||
// CDMessage+CoreDataProperties.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/2/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
|
||||
extension CDMessage {
|
||||
|
||||
@nonobjc
|
||||
class func fetchRequest() -> NSFetchRequest<CDMessage> {
|
||||
return NSFetchRequest<CDMessage>(entityName: "CDMessage")
|
||||
}
|
||||
|
||||
@NSManaged var text: String?
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
//
|
||||
// CDMessage.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/2/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import CoreData
|
||||
|
||||
@objc(CDMessage)
|
||||
class CDMessage: CDEntity {
|
||||
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
//
|
||||
// Folder.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import DAO
|
||||
|
||||
|
||||
class Folder: Entity {
|
||||
|
||||
var name: String = ""
|
||||
var messages = [Message]()
|
||||
|
||||
|
||||
init(entityId: String, name: String, messages: [Message]) {
|
||||
self.name = name
|
||||
self.messages = messages
|
||||
|
||||
super.init(entityId: entityId)
|
||||
}
|
||||
|
||||
|
||||
required init() {
|
||||
super.init()
|
||||
}
|
||||
|
||||
override func equals<T>(_ other: T) -> Bool where T : Entity {
|
||||
guard let other = other as? Folder else { return false }
|
||||
return super.equals(other) && name == other.name && messagesArrayEquals(other.messages)
|
||||
}
|
||||
|
||||
fileprivate func messagesArrayEquals(_ otherMessages: [Message]) -> Bool {
|
||||
if messages.count != otherMessages.count { return false }
|
||||
|
||||
for message in otherMessages {
|
||||
if !messages.contains(message) { return false }
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
//
|
||||
// DBBook.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/17/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import RealmSwift
|
||||
|
||||
|
||||
final class DBBook: DBEntity {
|
||||
|
||||
@objc dynamic var name: String = ""
|
||||
|
||||
let authors = List<String>()
|
||||
|
||||
let dates = List<Date>()
|
||||
|
||||
let pages = List<Int>()
|
||||
|
||||
let attachments = List<Data>()
|
||||
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "12.0",
|
||||
"subtype" : "2688h",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "12.0",
|
||||
"subtype" : "1792h",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "11.0",
|
||||
"subtype" : "2436h",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "8.0",
|
||||
"subtype" : "736h",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "8.0",
|
||||
"subtype" : "667h",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="12141" systemVersion="16E195" minimumToolsVersion="Xcode 7.0" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
||||
<entity name="CDEntity" representedClassName="CDEntity" syncable="YES">
|
||||
<attribute name="entryId" attributeType="String" defaultValueString="1" syncable="YES"/>
|
||||
</entity>
|
||||
<entity name="CDFolder" representedClassName="CDFolder" parentEntity="CDEntity" syncable="YES">
|
||||
<attribute name="name" attributeType="String" defaultValueString=" " syncable="YES"/>
|
||||
<relationship name="messages" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="CDMessage" syncable="YES"/>
|
||||
</entity>
|
||||
<entity name="CDMessage" representedClassName="CDMessage" parentEntity="CDEntity" syncable="YES">
|
||||
<attribute name="text" optional="YES" attributeType="String" syncable="YES"/>
|
||||
</entity>
|
||||
<elements>
|
||||
<element name="CDEntity" positionX="-63" positionY="-18" width="128" height="60"/>
|
||||
<element name="CDFolder" positionX="-54" positionY="0" width="128" height="75"/>
|
||||
<element name="CDMessage" positionX="-63" positionY="-9" width="128" height="60"/>
|
||||
</elements>
|
||||
</model>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
use_frameworks!
|
||||
|
||||
target 'DAO_Example' do
|
||||
pod 'DAO', :path => '../'
|
||||
|
||||
target 'CoreDataDAOTests' do
|
||||
inherit! :search_paths
|
||||
end
|
||||
|
||||
target 'RealmDAOTests' do
|
||||
inherit! :search_paths
|
||||
end
|
||||
end
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
PODS:
|
||||
- DAO (1.6.0):
|
||||
- DAO/CoreData (= 1.6.0)
|
||||
- DAO/Realm (= 1.6.0)
|
||||
- DAO/CoreData (1.6.0)
|
||||
- DAO/Realm (1.6.0):
|
||||
- RealmSwift (~> 10.1)
|
||||
- Realm (10.1.4):
|
||||
- Realm/Headers (= 10.1.4)
|
||||
- Realm/Headers (10.1.4)
|
||||
- RealmSwift (10.1.4):
|
||||
- Realm (= 10.1.4)
|
||||
|
||||
DEPENDENCIES:
|
||||
- DAO (from `../`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- Realm
|
||||
- RealmSwift
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
DAO:
|
||||
:path: "../"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
DAO: de381bf3ef4af1592f5e9cbb5e157d3bb02b4e73
|
||||
Realm: 80f4fb2971ccb9adc27a47d0955ae8e533a7030b
|
||||
RealmSwift: 0e566ca714edb377bba8ea0811eafcea0b93734e
|
||||
|
||||
PODFILE CHECKSUM: 304d7b9f54070467c355fe795db431630f017f61
|
||||
|
||||
COCOAPODS: 1.10.0
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?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>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
//
|
||||
// RealmDAOBookTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 5/17/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class RealmDAOBookTests: XCTestCase {
|
||||
|
||||
private var dao: RealmDAO<Book, DBBook>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
dao = RealmDAO(RLMBookTranslator())
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! dao.erase()
|
||||
dao = nil
|
||||
}
|
||||
|
||||
func testPersist() {
|
||||
let book = Book(
|
||||
entityId: "book1",
|
||||
name: "Swift",
|
||||
authors: ["Chris Lattner"],
|
||||
dates: [Date(timeIntervalSince1970: 1000000)],
|
||||
pages: [100, 200],
|
||||
attachments: [Data()]
|
||||
)
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(book), "Persist is failed")
|
||||
XCTAssertEqual(book, dao.read(book.entityId), "Persist is failed")
|
||||
XCTAssertFalse((dao.read(book.entityId)?.authors.isEmpty) == true, "Persist is failed")
|
||||
XCTAssertEqual(dao.read(book.entityId)?.authors.first, "Chris Lattner", "Persist is failed")
|
||||
XCTAssertFalse((dao.read(book.entityId)?.dates.isEmpty) == true, "Persist is failed")
|
||||
XCTAssertFalse((dao.read(book.entityId)?.pages.isEmpty) == true, "Persist is failed")
|
||||
XCTAssertEqual(dao.read(book.entityId)?.pages.count, 2, "Persist is failed")
|
||||
XCTAssertFalse((dao.read(book.entityId)?.attachments.isEmpty) == true, "Persist is failed")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
//
|
||||
// RealmDAOEraseTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 4/27/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class RealmDAOEntityTests: XCTestCase {
|
||||
|
||||
private var dao: RealmDAO<Entity, DBEntity>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
dao = RealmDAO(RLMEntityTranslator())
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! dao.erase()
|
||||
dao = nil
|
||||
}
|
||||
|
||||
|
||||
func testReadById() {
|
||||
let entity = Entity(entityId: "2")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Persist is failed")
|
||||
XCTAssertEqual(entity, dao.read("2"), "Read is failed")
|
||||
}
|
||||
|
||||
|
||||
func testAsyncReadById() {
|
||||
let entity = Entity(entityId: "2_back")
|
||||
let exp = expectation(description: "")
|
||||
|
||||
DispatchQueue.global().async {
|
||||
XCTAssertNotNil(try? self.dao.persist(entity), "Async read by id is failed")
|
||||
|
||||
DispatchQueue.global().async {
|
||||
XCTAssertEqual(self.dao.read("2_back")?.entityId, entity.entityId, "Async read by id is failed")
|
||||
exp.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
func testPersist() {
|
||||
let entity = Entity(entityId: "1")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Saving entity is failed")
|
||||
XCTAssert(true)
|
||||
}
|
||||
|
||||
func testPersistAll() {
|
||||
let firstEntity = Entity(entityId: "2")
|
||||
let secondEntity = Entity(entityId: "3")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist([firstEntity, secondEntity]), "Saving entities is failed")
|
||||
}
|
||||
|
||||
func testAsyncPersist() {
|
||||
let entity = Entity(entityId: "1_back")
|
||||
let exp = expectation(description: "")
|
||||
|
||||
DispatchQueue.global().async {
|
||||
XCTAssertNotNil(try? self.dao.persist(entity), "Saving entity in background is failed")
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
func testEraseById() {
|
||||
let entity = Entity(entityId: "3")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Erase is failed")
|
||||
XCTAssertNoThrow(try dao.erase("3"), "Erase is failed")
|
||||
XCTAssertNil(dao.read("3"))
|
||||
}
|
||||
|
||||
func testAsyncEraseById() {
|
||||
let entity = Entity(entityId: "2_back")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(entity), "Async erase by id is failed")
|
||||
|
||||
let exp = expectation(description: "")
|
||||
|
||||
DispatchQueue.global().async {
|
||||
XCTAssertNotNil(try? self.dao.erase("2_back"), "Async erase by id is failed")
|
||||
exp.fulfill()
|
||||
}
|
||||
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
//
|
||||
// RealmDAOFolderTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 4/28/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class RealmDAOFolderTests: XCTestCase {
|
||||
|
||||
private var messageDAO: RealmDAO<Message, DBMessage>!
|
||||
private var folderDAO: RealmDAO<Folder, DBFolder>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
messageDAO = RealmDAO(RLMMessageTranslator())
|
||||
folderDAO = RealmDAO(RLMFolderTranslator())
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! messageDAO.erase()
|
||||
try! folderDAO.erase()
|
||||
|
||||
messageDAO = nil
|
||||
folderDAO = nil
|
||||
}
|
||||
|
||||
func testCascadeErase() {
|
||||
let message = Message(entityId: "V.message", text: "V.message.text")
|
||||
let folder = Folder(entityId: "V", name: "Delete", messages: [message])
|
||||
|
||||
XCTAssertNoThrow(try folderDAO.persist(folder), "Persist folder is failed")
|
||||
XCTAssertNotNil(messageDAO.read("V.message"))
|
||||
XCTAssertNoThrow(try folderDAO.erase("V"), "Erase folder is failed")
|
||||
XCTAssertNil(messageDAO.read("V.message"))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
//
|
||||
// RealmDAOMessagesTests.swift
|
||||
// DAO
|
||||
//
|
||||
// Created by Ivan Vavilov on 4/28/17.
|
||||
// Copyright © 2017 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import DAO
|
||||
@testable import DAO_Example
|
||||
|
||||
|
||||
final class RealmDAOMessagesTests: XCTestCase {
|
||||
|
||||
private var dao: RealmDAO<Message, DBMessage>!
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
|
||||
dao = RealmDAO(RLMMessageTranslator())
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
super.tearDown()
|
||||
|
||||
try! dao.erase()
|
||||
dao = nil
|
||||
}
|
||||
|
||||
func testPersistMessage() {
|
||||
let message = Message(entityId: "abc", text: "text")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(message), "Persist is failed")
|
||||
XCTAssertEqual(message, dao.read(message.entityId))
|
||||
}
|
||||
|
||||
func testReadMessage() {
|
||||
let message = Message(entityId: "def", text: "text 2")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(message), "Persist is failed")
|
||||
XCTAssertEqual(message, dao.read("def"))
|
||||
}
|
||||
|
||||
func testEraseMessage() {
|
||||
let message = Message(entityId: "ghi", text: "text 2")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist(message), "Persist or erase is failed")
|
||||
XCTAssertNoThrow(try dao.erase("ghi"), "Persist or erase is failed")
|
||||
XCTAssertNil(dao.read("ghi"))
|
||||
}
|
||||
|
||||
func testPersistListOfMessages() {
|
||||
XCTAssertEqual(dao.read().count, 0)
|
||||
|
||||
let message1 = Message(entityId: "1", text: "1")
|
||||
let message2 = Message(entityId: "2", text: "2")
|
||||
let message3 = Message(entityId: "3", text: "3")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist([message1, message2, message3]), "Persist is failed")
|
||||
let threeMessages = dao.read(orderedBy: "entryId", ascending: true)
|
||||
|
||||
XCTAssertEqual(threeMessages.count, 3)
|
||||
XCTAssertEqual(threeMessages[0].entityId, "1")
|
||||
XCTAssertEqual(threeMessages[1].entityId, "2")
|
||||
XCTAssertEqual(threeMessages[2].entityId, "3")
|
||||
|
||||
let message55 = Message(entityId: "55", text: "55")
|
||||
let message66 = Message(entityId: "66", text: "66")
|
||||
|
||||
XCTAssertNoThrow(try dao.persist([message1, message2, message3, message55, message66]), "Persist is failed")
|
||||
|
||||
let fiveMessages = dao.read(orderedBy: "entryId", ascending: true)
|
||||
|
||||
XCTAssertEqual(fiveMessages.count, 5)
|
||||
XCTAssertEqual(fiveMessages[0].entityId, "1")
|
||||
XCTAssertEqual(fiveMessages[1].entityId, "2")
|
||||
XCTAssertEqual(fiveMessages[2].entityId, "3")
|
||||
XCTAssertEqual(fiveMessages[3].entityId, "55")
|
||||
XCTAssertEqual(fiveMessages[4].entityId, "66")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
//
|
||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||
//
|
||||
|
||||
13
LICENSE
13
LICENSE
|
|
@ -1,4 +1,6 @@
|
|||
Copyright (c) 2017 RedMadRobot <iv@redmadrobot.com>
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 RedMadRobot
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
@ -7,13 +9,14 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
|
|
|||
14
Podfile
14
Podfile
|
|
@ -1,14 +0,0 @@
|
|||
source "https://cdn.cocoapods.org/"
|
||||
|
||||
platform :ios, '9.0'
|
||||
inhibit_all_warnings!
|
||||
use_frameworks!
|
||||
|
||||
target 'CoreDataDAO' do
|
||||
# nothing
|
||||
end
|
||||
|
||||
target 'RealmDAO' do
|
||||
pod "Realm"
|
||||
pod "RealmSwift"
|
||||
end
|
||||
23
Podfile.lock
23
Podfile.lock
|
|
@ -1,23 +0,0 @@
|
|||
PODS:
|
||||
- Realm (10.1.4):
|
||||
- Realm/Headers (= 10.1.4)
|
||||
- Realm/Headers (10.1.4)
|
||||
- RealmSwift (10.1.4):
|
||||
- Realm (= 10.1.4)
|
||||
|
||||
DEPENDENCIES:
|
||||
- Realm
|
||||
- RealmSwift
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- Realm
|
||||
- RealmSwift
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Realm: 80f4fb2971ccb9adc27a47d0955ae8e533a7030b
|
||||
RealmSwift: 0e566ca714edb377bba8ea0811eafcea0b93734e
|
||||
|
||||
PODFILE CHECKSUM: e04c82ad38fec22650d3fead6f618fe0e4c5a783
|
||||
|
||||
COCOAPODS: 1.10.0
|
||||
118
README.md
118
README.md
|
|
@ -1,120 +1,12 @@
|
|||
[](https://img.shields.io/github/issues/RedMadRobot/DAO.svg)
|
||||
[](https://img.shields.io/badge/pod-1.6.0-blue.svg)
|
||||
[](https://img.shields.io/badge/swift-5.3-red.svg)
|
||||
[](https://img.shields.io/badge/license-MIT-blue.svg)
|
||||
## Installation
|
||||
|
||||
|
||||
DAO
|
||||
=======
|
||||
|
||||
An implementation of [DAO pattern](http://www.oracle.com/technetwork/java/dataaccessobject-138824.html) for CoreData and Realm.
|
||||
Helps you think less about database in your application.
|
||||
|
||||
## Features
|
||||
|
||||
- Use your persistence layer synchronously for CRUD operations.
|
||||
- Abstraction of database objects (entries) from application objects (entities).
|
||||
- Abstraction from concurrency.
|
||||
|
||||
## Install
|
||||
|
||||
Cocoapods
|
||||
|
||||
For using with CoreData:
|
||||
Для установки добавьте следующую строку в podfile
|
||||
|
||||
```ruby
|
||||
pod 'DAO/CoreData'
|
||||
pod 'CoreDAO', :git => "git@git.redmadrobot.com:foundation-ios/DAO.git"
|
||||
```
|
||||
|
||||
Or with Realm:
|
||||
|
||||
```ruby
|
||||
pod 'DAO/Realm'
|
||||
```
|
||||
|
||||
Carthage
|
||||
|
||||
Make the following entry in your Cartfile:
|
||||
|
||||
```
|
||||
github "RedMadRobot/DAO"
|
||||
```
|
||||
|
||||
Then run `carthage update`.
|
||||
|
||||
At last, you need to set up your Xcode project manually to add the framework:
|
||||
|
||||
1. On “General” settings tab of your target, in the “Linked Frameworks and Libraries” section add each framework you want to use from Carthage/Build folder.
|
||||
|
||||
2. On “Build Phases” settings tab of your target, click the “+” icon and choose “New Run Script Phase”. Create a Run Script with the following content:
|
||||
|
||||
```
|
||||
/usr/local/bin/carthage copy-frameworks
|
||||
```
|
||||
|
||||
3. Add the paths to the frameworks you want to use under “Input Files”:
|
||||
|
||||
3.1. For using with CoreData:
|
||||
|
||||
```
|
||||
$(SRCROOT)/Carthage/Build/iOS/CoreDataDAO.framework
|
||||
```
|
||||
|
||||
3.2. Or with Realm:
|
||||
|
||||
```
|
||||
$(SRCROOT)/Carthage/Build/iOS/RealmDAO.framework
|
||||
```
|
||||
|
||||
4. Add the paths to the copied frameworks to the “Output Files”:
|
||||
|
||||
4.1. For using with CoreData:
|
||||
|
||||
```
|
||||
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/CoreDataDAO.framework
|
||||
```
|
||||
|
||||
4.2. Or with Realm
|
||||
|
||||
```
|
||||
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RealmDAO.framework
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```swift
|
||||
// Create DAO instance
|
||||
let dao = RealmDAO(RLMMessageTranslator())
|
||||
|
||||
//...
|
||||
|
||||
// Create message entity
|
||||
let message = Message(entityId: "abc", text: "text")
|
||||
|
||||
// Save message to database
|
||||
try? dao.persist(message)
|
||||
|
||||
// Read saved message from database
|
||||
let savedMessage = dao.read(message.entityId)
|
||||
|
||||
// Delete message from database
|
||||
try? dao.erase(message.entityId)
|
||||
```
|
||||
|
||||
Please look at the example project for more information.
|
||||
|
||||
## When not recommended to use
|
||||
|
||||
- If you have big and complex database schema. Many entities, many relationships.
|
||||
- If you want to use specific features of database. Realm Mobile Platform, for instance is not compatible with DAO implementation.
|
||||
- If you have thousands of objects (> 10-20K). Performance can be the issue.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Xcode 11
|
||||
- Swift 5
|
||||
- iOS 9
|
||||
|
||||
## Authors
|
||||
|
||||
Ivan Vavilov - iv@redmadrobot.com
|
||||
Ivan Vavilov - vi@redmadrobot.com
|
||||
Igor Bulyga - ib@redmadrobot.com
|
||||
|
|
@ -0,0 +1,759 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0AEA6F77E54A1E391F0B169B /* Pods_CoreDAOExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58801A2D7C2918821D3B9459 /* Pods_CoreDAOExample.framework */; };
|
||||
20AF7D3FBD3CEF57BCD60A71 /* CoreDAO.h in Headers */ = {isa = PBXBuildFile; fileRef = 20AF7EDC125878A2DD601BCD /* CoreDAO.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
444A7B7C1C64F8A0008ADCBC /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 444A7B7B1C64F8A0008ADCBC /* Message.swift */; };
|
||||
44591C0C1D22ED4E00F30F4A /* CascadeDeletionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44591C0B1D22ED4E00F30F4A /* CascadeDeletionProtocol.swift */; };
|
||||
449344BF1C638CF00023E6CE /* RLMEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 449344BE1C638CF00023E6CE /* RLMEntry.swift */; };
|
||||
449344D11C6398E00023E6CE /* RealmTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 449344D01C6398E00023E6CE /* RealmTranslator.swift */; };
|
||||
449344D31C63A1460023E6CE /* DAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 449344D21C63A1460023E6CE /* DAO.swift */; };
|
||||
449344D51C63A2CA0023E6CE /* RealmDAO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 449344D41C63A2CA0023E6CE /* RealmDAO.swift */; };
|
||||
449344E41C64D27A0023E6CE /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 449344E21C64D27A0023E6CE /* Info.plist */; };
|
||||
449344E51C64D27A0023E6CE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 449344E31C64D27A0023E6CE /* LaunchScreen.storyboard */; };
|
||||
449344E71C64D3200023E6CE /* DAOTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 449344E61C64D3200023E6CE /* DAOTest.swift */; };
|
||||
449344E81C64D63B0023E6CE /* CoreDAO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4436A41F1C63806400400CB2 /* CoreDAO.framework */; };
|
||||
449344EA1C64D69D0023E6CE /* CoreDAO.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4436A41F1C63806400400CB2 /* CoreDAO.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
449345111C64E2220023E6CE /* RLMEntityTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4493450F1C64E1FD0023E6CE /* RLMEntityTranslator.swift */; };
|
||||
449345171C64E62C0023E6CE /* DBEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 449345161C64E62C0023E6CE /* DBEntity.swift */; };
|
||||
44A39FAC1C69D7B0009E9326 /* DBMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A39FAB1C69D7B0009E9326 /* DBMessage.swift */; };
|
||||
44A39FAE1C69ECFE009E9326 /* RLMMessageTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A39FAD1C69ECFE009E9326 /* RLMMessageTranslator.swift */; };
|
||||
44A39FB41C6A2E81009E9326 /* Folder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A39FB31C6A2E81009E9326 /* Folder.swift */; };
|
||||
44A39FB61C6A30FA009E9326 /* RLMFolderTranslator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A39FB51C6A30FA009E9326 /* RLMFolderTranslator.swift */; };
|
||||
44A39FB71C6A3478009E9326 /* DBFolder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44A39FB11C6A2C42009E9326 /* DBFolder.swift */; };
|
||||
44D2F9B61C6B8DE000E3FD36 /* Entity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44D2F9B51C6B8DE000E3FD36 /* Entity.swift */; };
|
||||
A845F256D25579D90F525B3C /* Pods_CoreDAO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F0AF86A8BB6465DAEFF9BDE /* Pods_CoreDAO.framework */; };
|
||||
E6AB2FD21C6A5E63008B1B88 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = E6AB2FD01C6A5E63008B1B88 /* Model.xcdatamodeld */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
449344EB1C64D69D0023E6CE /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 4436A4161C63806400400CB2 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 4436A41E1C63806400400CB2;
|
||||
remoteInfo = CoreDAO;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
449344ED1C64D69D0023E6CE /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
449344EA1C64D69D0023E6CE /* CoreDAO.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
20AF78AFD18780ACDC8E4BF1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.info; path = Info.plist; sourceTree = "<group>"; };
|
||||
20AF7EDC125878A2DD601BCD /* CoreDAO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreDAO.h; sourceTree = "<group>"; };
|
||||
4436A41F1C63806400400CB2 /* CoreDAO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreDAO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4436A42E1C63807A00400CB2 /* CoreDAOExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoreDAOExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
444A7B7B1C64F8A0008ADCBC /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = "<group>"; };
|
||||
44591C0B1D22ED4E00F30F4A /* CascadeDeletionProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CascadeDeletionProtocol.swift; sourceTree = "<group>"; };
|
||||
449344BE1C638CF00023E6CE /* RLMEntry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMEntry.swift; sourceTree = "<group>"; };
|
||||
449344D01C6398E00023E6CE /* RealmTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmTranslator.swift; sourceTree = "<group>"; };
|
||||
449344D21C63A1460023E6CE /* DAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DAO.swift; sourceTree = "<group>"; };
|
||||
449344D41C63A2CA0023E6CE /* RealmDAO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RealmDAO.swift; sourceTree = "<group>"; };
|
||||
449344E21C64D27A0023E6CE /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
449344E31C64D27A0023E6CE /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
449344E61C64D3200023E6CE /* DAOTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DAOTest.swift; sourceTree = "<group>"; };
|
||||
4493450F1C64E1FD0023E6CE /* RLMEntityTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMEntityTranslator.swift; sourceTree = "<group>"; };
|
||||
449345161C64E62C0023E6CE /* DBEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBEntity.swift; sourceTree = "<group>"; };
|
||||
44A39FAB1C69D7B0009E9326 /* DBMessage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBMessage.swift; sourceTree = "<group>"; };
|
||||
44A39FAD1C69ECFE009E9326 /* RLMMessageTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMMessageTranslator.swift; sourceTree = "<group>"; };
|
||||
44A39FB11C6A2C42009E9326 /* DBFolder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DBFolder.swift; sourceTree = "<group>"; };
|
||||
44A39FB31C6A2E81009E9326 /* Folder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Folder.swift; sourceTree = "<group>"; };
|
||||
44A39FB51C6A30FA009E9326 /* RLMFolderTranslator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RLMFolderTranslator.swift; sourceTree = "<group>"; };
|
||||
44D2F9B51C6B8DE000E3FD36 /* Entity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Entity.swift; sourceTree = "<group>"; };
|
||||
58801A2D7C2918821D3B9459 /* Pods_CoreDAOExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoreDAOExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6B8D12604E918085BEFF73DC /* Pods-CoreDAOExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDAOExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoreDAOExample/Pods-CoreDAOExample.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
6F0AF86A8BB6465DAEFF9BDE /* Pods_CoreDAO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoreDAO.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7F6BB6E6E8BED92008788E1B /* Pods-CoreDAO.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDAO.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoreDAO/Pods-CoreDAO.release.xcconfig"; sourceTree = "<group>"; };
|
||||
A82819FAF5C6867C97AC6646 /* Pods-CoreDAO.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDAO.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoreDAO/Pods-CoreDAO.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
E6AB2FD11C6A5E63008B1B88 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = "<group>"; };
|
||||
FC41C61A9F3A80C6A75DECFD /* Pods-CoreDAOExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreDAOExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoreDAOExample/Pods-CoreDAOExample.release.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
4436A41B1C63806400400CB2 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
A845F256D25579D90F525B3C /* Pods_CoreDAO.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4436A42B1C63807A00400CB2 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
449344E81C64D63B0023E6CE /* CoreDAO.framework in Frameworks */,
|
||||
0AEA6F77E54A1E391F0B169B /* Pods_CoreDAOExample.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
20AF7030FE037D530A695A19 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
20AF78AFD18780ACDC8E4BF1 /* Info.plist */,
|
||||
);
|
||||
path = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
20AF7CCB5762609F48A53639 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344B61C6389730023E6CE /* DAO */,
|
||||
449344B81C6389730023E6CE /* Model */,
|
||||
449344B91C6389730023E6CE /* Translator */,
|
||||
20AF7EDC125878A2DD601BCD /* CoreDAO.h */,
|
||||
449344D21C63A1460023E6CE /* DAO.swift */,
|
||||
);
|
||||
path = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4436A4151C63806400400CB2 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4436A4211C63806400400CB2 /* CoreDAO */,
|
||||
449344D61C64D27A0023E6CE /* CoreDAOExample */,
|
||||
4436A4201C63806400400CB2 /* Products */,
|
||||
EC48D098C696BB747BFA47E9 /* Pods */,
|
||||
46B25083E1F329A20411E71E /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4436A4201C63806400400CB2 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4436A41F1C63806400400CB2 /* CoreDAO.framework */,
|
||||
4436A42E1C63807A00400CB2 /* CoreDAOExample.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4436A4211C63806400400CB2 /* CoreDAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
20AF7CCB5762609F48A53639 /* Classes */,
|
||||
20AF7030FE037D530A695A19 /* Supporting Files */,
|
||||
);
|
||||
path = CoreDAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344B61C6389730023E6CE /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344D41C63A2CA0023E6CE /* RealmDAO.swift */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344B81C6389730023E6CE /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
44591C0B1D22ED4E00F30F4A /* CascadeDeletionProtocol.swift */,
|
||||
44D2F9B51C6B8DE000E3FD36 /* Entity.swift */,
|
||||
449344BE1C638CF00023E6CE /* RLMEntry.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344B91C6389730023E6CE /* Translator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344D01C6398E00023E6CE /* RealmTranslator.swift */,
|
||||
);
|
||||
path = Translator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344D61C64D27A0023E6CE /* CoreDAOExample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344D71C64D27A0023E6CE /* Classes */,
|
||||
449344E01C64D27A0023E6CE /* Resources */,
|
||||
449344E11C64D27A0023E6CE /* Supporting Files */,
|
||||
);
|
||||
path = CoreDAOExample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344D71C64D27A0023E6CE /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344D81C64D27A0023E6CE /* Business Logic */,
|
||||
449344DD1C64D27A0023E6CE /* Model */,
|
||||
449344E61C64D3200023E6CE /* DAOTest.swift */,
|
||||
);
|
||||
path = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344D81C64D27A0023E6CE /* Business Logic */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344D91C64D27A0023E6CE /* Helper */,
|
||||
);
|
||||
path = "Business Logic";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344D91C64D27A0023E6CE /* Helper */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344DA1C64D27A0023E6CE /* DAO */,
|
||||
);
|
||||
path = Helper;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344DA1C64D27A0023E6CE /* DAO */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344DC1C64D27A0023E6CE /* RealmTranslator */,
|
||||
);
|
||||
path = DAO;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344DC1C64D27A0023E6CE /* RealmTranslator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4493450F1C64E1FD0023E6CE /* RLMEntityTranslator.swift */,
|
||||
44A39FAD1C69ECFE009E9326 /* RLMMessageTranslator.swift */,
|
||||
44A39FB51C6A30FA009E9326 /* RLMFolderTranslator.swift */,
|
||||
);
|
||||
path = RealmTranslator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344DD1C64D27A0023E6CE /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344DF1C64D27A0023E6CE /* RealmDatabase */,
|
||||
444A7B7B1C64F8A0008ADCBC /* Message.swift */,
|
||||
44A39FB31C6A2E81009E9326 /* Folder.swift */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344DF1C64D27A0023E6CE /* RealmDatabase */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449345161C64E62C0023E6CE /* DBEntity.swift */,
|
||||
44A39FAB1C69D7B0009E9326 /* DBMessage.swift */,
|
||||
44A39FB11C6A2C42009E9326 /* DBFolder.swift */,
|
||||
);
|
||||
path = RealmDatabase;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344E01C64D27A0023E6CE /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E6AB2FD01C6A5E63008B1B88 /* Model.xcdatamodeld */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
449344E11C64D27A0023E6CE /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
449344E21C64D27A0023E6CE /* Info.plist */,
|
||||
449344E31C64D27A0023E6CE /* LaunchScreen.storyboard */,
|
||||
);
|
||||
path = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
46B25083E1F329A20411E71E /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6F0AF86A8BB6465DAEFF9BDE /* Pods_CoreDAO.framework */,
|
||||
58801A2D7C2918821D3B9459 /* Pods_CoreDAOExample.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EC48D098C696BB747BFA47E9 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A82819FAF5C6867C97AC6646 /* Pods-CoreDAO.debug.xcconfig */,
|
||||
7F6BB6E6E8BED92008788E1B /* Pods-CoreDAO.release.xcconfig */,
|
||||
6B8D12604E918085BEFF73DC /* Pods-CoreDAOExample.debug.xcconfig */,
|
||||
FC41C61A9F3A80C6A75DECFD /* Pods-CoreDAOExample.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
4436A41C1C63806400400CB2 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
20AF7D3FBD3CEF57BCD60A71 /* CoreDAO.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
4436A41E1C63806400400CB2 /* CoreDAO */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 4436A4271C63806400400CB2 /* Build configuration list for PBXNativeTarget "CoreDAO" */;
|
||||
buildPhases = (
|
||||
A09F4AC4DE8EC62D3D715C34 /* [CP] Check Pods Manifest.lock */,
|
||||
4436A41A1C63806400400CB2 /* Sources */,
|
||||
4436A41B1C63806400400CB2 /* Frameworks */,
|
||||
4436A41C1C63806400400CB2 /* Headers */,
|
||||
4436A41D1C63806400400CB2 /* Resources */,
|
||||
03E60C4C796FBC6181922378 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = CoreDAO;
|
||||
productName = CoreDAO;
|
||||
productReference = 4436A41F1C63806400400CB2 /* CoreDAO.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
4436A42D1C63807A00400CB2 /* CoreDAOExample */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 4436A43D1C63807A00400CB2 /* Build configuration list for PBXNativeTarget "CoreDAOExample" */;
|
||||
buildPhases = (
|
||||
0BC86AF5E9F3B1E6ABD313B8 /* [CP] Check Pods Manifest.lock */,
|
||||
4436A42A1C63807A00400CB2 /* Sources */,
|
||||
4436A42B1C63807A00400CB2 /* Frameworks */,
|
||||
4436A42C1C63807A00400CB2 /* Resources */,
|
||||
449344ED1C64D69D0023E6CE /* Embed Frameworks */,
|
||||
2D225BF6189008B631419D26 /* [CP] Embed Pods Frameworks */,
|
||||
1B98E2F83A37DCB618498CF5 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
449344EC1C64D69D0023E6CE /* PBXTargetDependency */,
|
||||
);
|
||||
name = CoreDAOExample;
|
||||
productName = CoreDAOExample;
|
||||
productReference = 4436A42E1C63807A00400CB2 /* CoreDAOExample.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
4436A4161C63806400400CB2 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0720;
|
||||
LastUpgradeCheck = 0730;
|
||||
ORGANIZATIONNAME = "RedMadRobot LLC.";
|
||||
TargetAttributes = {
|
||||
4436A41E1C63806400400CB2 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0910;
|
||||
};
|
||||
4436A42D1C63807A00400CB2 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0910;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 4436A4191C63806400400CB2 /* Build configuration list for PBXProject "CoreDAO" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 4436A4151C63806400400CB2;
|
||||
productRefGroup = 4436A4201C63806400400CB2 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
4436A41E1C63806400400CB2 /* CoreDAO */,
|
||||
4436A42D1C63807A00400CB2 /* CoreDAOExample */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
4436A41D1C63806400400CB2 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
449344E41C64D27A0023E6CE /* Info.plist in Resources */,
|
||||
449344E51C64D27A0023E6CE /* LaunchScreen.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4436A42C1C63807A00400CB2 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
03E60C4C796FBC6181922378 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoreDAO/Pods-CoreDAO-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
0BC86AF5E9F3B1E6ABD313B8 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-CoreDAOExample-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
1B98E2F83A37DCB618498CF5 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoreDAOExample/Pods-CoreDAOExample-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
2D225BF6189008B631419D26 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-CoreDAOExample/Pods-CoreDAOExample-frameworks.sh",
|
||||
"${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
|
||||
"${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
|
||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CoreDAOExample/Pods-CoreDAOExample-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
A09F4AC4DE8EC62D3D715C34 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-CoreDAO-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
4436A41A1C63806400400CB2 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
449344BF1C638CF00023E6CE /* RLMEntry.swift in Sources */,
|
||||
449344D11C6398E00023E6CE /* RealmTranslator.swift in Sources */,
|
||||
44591C0C1D22ED4E00F30F4A /* CascadeDeletionProtocol.swift in Sources */,
|
||||
44D2F9B61C6B8DE000E3FD36 /* Entity.swift in Sources */,
|
||||
449344D51C63A2CA0023E6CE /* RealmDAO.swift in Sources */,
|
||||
449344D31C63A1460023E6CE /* DAO.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
4436A42A1C63807A00400CB2 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
449345171C64E62C0023E6CE /* DBEntity.swift in Sources */,
|
||||
449345111C64E2220023E6CE /* RLMEntityTranslator.swift in Sources */,
|
||||
449344E71C64D3200023E6CE /* DAOTest.swift in Sources */,
|
||||
44A39FB71C6A3478009E9326 /* DBFolder.swift in Sources */,
|
||||
44A39FAE1C69ECFE009E9326 /* RLMMessageTranslator.swift in Sources */,
|
||||
44A39FB61C6A30FA009E9326 /* RLMFolderTranslator.swift in Sources */,
|
||||
44A39FAC1C69D7B0009E9326 /* DBMessage.swift in Sources */,
|
||||
E6AB2FD21C6A5E63008B1B88 /* Model.xcdatamodeld in Sources */,
|
||||
444A7B7C1C64F8A0008ADCBC /* Message.swift in Sources */,
|
||||
44A39FB41C6A2E81009E9326 /* Folder.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
449344EC1C64D69D0023E6CE /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 4436A41E1C63806400400CB2 /* CoreDAO */;
|
||||
targetProxy = 449344EB1C64D69D0023E6CE /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
4436A4251C63806400400CB2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
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_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
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.2;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
4436A4261C63806400400CB2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
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_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
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.2;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
4436A4281C63806400400CB2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = A82819FAF5C6867C97AC6646 /* Pods-CoreDAO.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "CoreDAO/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.CoreDAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
SYMROOT = build;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
4436A4291C63806400400CB2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7F6BB6E6E8BED92008788E1B /* Pods-CoreDAO.release.xcconfig */;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "CoreDAO/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.CoreDAO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 4.0;
|
||||
SYMROOT = build;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
4436A43E1C63807A00400CB2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 6B8D12604E918085BEFF73DC /* Pods-CoreDAOExample.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "CoreDAOExample/Supporting Files/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.CoreDAOExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
4436A43F1C63807A00400CB2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = FC41C61A9F3A80C6A75DECFD /* Pods-CoreDAOExample.release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "CoreDAOExample/Supporting Files/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.redmadrobot.CoreDAOExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
4436A4191C63806400400CB2 /* Build configuration list for PBXProject "CoreDAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
4436A4251C63806400400CB2 /* Debug */,
|
||||
4436A4261C63806400400CB2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
4436A4271C63806400400CB2 /* Build configuration list for PBXNativeTarget "CoreDAO" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
4436A4281C63806400400CB2 /* Debug */,
|
||||
4436A4291C63806400400CB2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
4436A43D1C63807A00400CB2 /* Build configuration list for PBXNativeTarget "CoreDAOExample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
4436A43E1C63807A00400CB2 /* Debug */,
|
||||
4436A43F1C63807A00400CB2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
|
||||
/* Begin XCVersionGroup section */
|
||||
E6AB2FD01C6A5E63008B1B88 /* Model.xcdatamodeld */ = {
|
||||
isa = XCVersionGroup;
|
||||
children = (
|
||||
E6AB2FD11C6A5E63008B1B88 /* Model.xcdatamodel */,
|
||||
);
|
||||
currentVersion = E6AB2FD11C6A5E63008B1B88 /* Model.xcdatamodel */;
|
||||
path = Model.xcdatamodeld;
|
||||
sourceTree = "<group>";
|
||||
versionGroupType = wrapper.xcdatamodel;
|
||||
};
|
||||
/* End XCVersionGroup section */
|
||||
};
|
||||
rootObject = 4436A4161C63806400400CB2 /* Project object */;
|
||||
}
|
||||
|
|
@ -2,6 +2,6 @@
|
|||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:DAO.xcodeproj">
|
||||
location = "self:CoreDAO.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// CoreDAO.h
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for CoreDAO.
|
||||
FOUNDATION_EXPORT double CoreDAOVersionNumber;
|
||||
|
||||
//! Project version string for CoreDAO.
|
||||
FOUNDATION_EXPORT const unsigned char CoreDAOVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <CoreDAO/PublicHeader.h>
|
||||
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
//
|
||||
// DAO.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
open class DAO<Model: Entity> {
|
||||
|
||||
// MARK: Вставка / Обновление
|
||||
open func persist(_ entity: Model) throws
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
open func persistAll(_ entities: [Model]) throws
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
// MARK: Чтение
|
||||
|
||||
open func read(_ entityId: String) -> Model?
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
open func readAll() -> [Model]
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
open func readAll(predicate: NSPredicate?) -> [Model]
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
open func readAll(orderBy field: String?, ascending: Bool) -> [Model]
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
open func readAll(predicate: NSPredicate?, orderBy field: String?, ascending: Bool) -> [Model]
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
// MARK: Удаление
|
||||
|
||||
open func erase() throws
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
open func erase(_ entityId: String) throws
|
||||
{
|
||||
preconditionFailure()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
//
|
||||
// RealmDAO.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RealmSwift
|
||||
|
||||
private struct RealmConstant {
|
||||
fileprivate static var databasePath = ""
|
||||
fileprivate static var databaseFileName = "Database.realm"
|
||||
fileprivate static var databaseVersion: UInt64 = 1
|
||||
}
|
||||
|
||||
|
||||
open class RealmDAO<Model: Entity, RealmModel: RLMEntry>: DAO<Model> {
|
||||
|
||||
fileprivate let translator: RealmTranslator<Model, RealmModel>
|
||||
|
||||
// MARK: Public
|
||||
// MARK: DAO
|
||||
|
||||
override open func persist(_ entity: Model) throws
|
||||
{
|
||||
let entry: RealmModel = self.translator.toEntry(entity)
|
||||
return try self.writeTransaction(entry)
|
||||
}
|
||||
|
||||
override open func persistAll(_ entities: [Model]) throws
|
||||
{
|
||||
let entries: List<RealmModel> = self.translator.toEntries(entities)
|
||||
return try self.writeEntriesTransaction(entries)
|
||||
}
|
||||
|
||||
override open func read(_ entityId: String) -> Model?
|
||||
{
|
||||
guard let entry = self.readEntryWithId(entityId) else { return nil }
|
||||
return self.translator.toEntity(entry)
|
||||
}
|
||||
|
||||
override open func readAll() -> [Model]
|
||||
{
|
||||
var entites: [Model] = []
|
||||
let result = self.readAllEntriesPredicated(nil)
|
||||
result.forEach { (entry) -> () in
|
||||
entites.append(self.translator.toEntity(entry))
|
||||
}
|
||||
return entites
|
||||
}
|
||||
|
||||
override open func readAll(predicate: NSPredicate?) -> [Model] {
|
||||
return self.readAll(predicate: predicate, orderBy: nil)
|
||||
}
|
||||
|
||||
override open func readAll(orderBy field: String?, ascending: Bool) -> [Model]
|
||||
{
|
||||
return self.readAll(predicate: nil, orderBy: field, ascending: ascending)
|
||||
}
|
||||
|
||||
override open func readAll(predicate: NSPredicate?,
|
||||
orderBy field: String?,
|
||||
ascending: Bool = true) -> [Model]
|
||||
{
|
||||
var entities: [Model]! = []
|
||||
var results: Results<RealmModel> = self.readAllEntriesPredicated(predicate)
|
||||
|
||||
if let field = field {
|
||||
results = results.sorted(byKeyPath: field, ascending: ascending)
|
||||
}
|
||||
|
||||
entities.append(contentsOf: results.map { entry in self.translator.toEntity(entry) } )
|
||||
return entities
|
||||
}
|
||||
|
||||
open func count(predicate: NSPredicate? = nil) -> Int
|
||||
{
|
||||
return self.readAllEntriesPredicated(predicate).count
|
||||
}
|
||||
|
||||
override open func erase() throws
|
||||
{
|
||||
let results = self.readAllEntriesPredicated(nil)
|
||||
let entries: List<RealmModel> = List<RealmModel>()
|
||||
|
||||
entries.append(objectsIn: results.map { $0 as RealmModel })
|
||||
|
||||
try self.deleteEntriesTransaction(entries)
|
||||
}
|
||||
|
||||
override open func erase(_ entityId: String) throws
|
||||
{
|
||||
guard let entry = self.readEntryWithId(entityId) else { return }
|
||||
try self.deleteEntryTransaction(entry)
|
||||
}
|
||||
|
||||
|
||||
// MARK: RealmDAO
|
||||
// MARK: Публичные методы
|
||||
|
||||
public init(translator: RealmTranslator<Model, RealmModel>,
|
||||
databaseFileName: String,
|
||||
databaseVersion: UInt64)
|
||||
{
|
||||
self.translator = translator
|
||||
super.init()
|
||||
self.loadDefaultRealmFromFileName(databaseFileName, migrateToSchemaVersion: databaseVersion)
|
||||
}
|
||||
|
||||
public convenience init(translator: RealmTranslator<Model, RealmModel>)
|
||||
{
|
||||
self.init(translator: translator,
|
||||
databaseFileName: RealmConstant.databaseFileName,
|
||||
databaseVersion: RealmConstant.databaseVersion)
|
||||
}
|
||||
|
||||
open class func assignDatabaseFilename(_ fileName: String)
|
||||
{
|
||||
RealmConstant.databaseFileName = fileName
|
||||
}
|
||||
|
||||
open class func databaseFileName() -> String
|
||||
{
|
||||
return RealmConstant.databaseFileName
|
||||
}
|
||||
|
||||
open class func assignDatabaseVersion(_ version: UInt64)
|
||||
{
|
||||
RealmConstant.databaseVersion = version
|
||||
}
|
||||
|
||||
open class func databaseVersion() -> UInt64
|
||||
{
|
||||
return RealmConstant.databaseVersion
|
||||
}
|
||||
|
||||
open class func assignDatabasePath(_ databasePath: String)
|
||||
{
|
||||
RealmConstant.databasePath = databasePath
|
||||
}
|
||||
|
||||
open class func databasePath() -> String {
|
||||
if !RealmConstant.databasePath.isEmpty {
|
||||
return RealmConstant.databasePath
|
||||
|
||||
} else {
|
||||
let documentDirectory = NSSearchPathForDirectoriesInDomains(
|
||||
.documentDirectory, .userDomainMask, true).first
|
||||
return documentDirectory ?? ""
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Приватные методы
|
||||
|
||||
fileprivate func writeTransaction(_ entry: RealmModel) throws
|
||||
{
|
||||
try self.realm().write {
|
||||
self.realm().create(self.translator.entryClassName, value: entry, update: true)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func writeEntriesTransaction(_ entries: List<RealmModel>) throws
|
||||
{
|
||||
try self.realm().write {
|
||||
entries.forEach { (e: RealmModel) -> () in
|
||||
self.realm().create(self.translator.entryClassName, value: e, update: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func readEntryWithId(_ entryId: String) -> RealmModel?
|
||||
{
|
||||
return self.realm().object(ofType: self.translator.entryClassName, forPrimaryKey: entryId)
|
||||
}
|
||||
|
||||
fileprivate func readAllEntriesPredicated(_ predicate: NSPredicate?) -> Results<RealmModel>
|
||||
{
|
||||
let results: Results<RealmModel> = self.realm().objects(self.translator.entryClassName)
|
||||
guard let predicate = predicate else { return results }
|
||||
return results.filter(predicate)
|
||||
}
|
||||
|
||||
fileprivate func deleteEntryTransaction(_ entry: RealmModel) throws
|
||||
{
|
||||
try self.realm().write {
|
||||
self.cascadeDelete(entry)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func deleteEntriesTransaction(_ entries:List<RealmModel>) throws
|
||||
{
|
||||
try self.realm().write {
|
||||
self.cascadeDelete(entries)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func cascadeDelete(_ object: AnyObject?)
|
||||
{
|
||||
if let deletable = object as? CascadeDeletionProtocol {
|
||||
deletable.objectsToDelete().forEach { child in
|
||||
self.cascadeDelete(child)
|
||||
}
|
||||
}
|
||||
|
||||
if let realmArray = object as? ListBase {
|
||||
for i in 0..<realmArray.count {
|
||||
let object = realmArray._rlmArray[UInt(i)]
|
||||
self.cascadeDelete(object)
|
||||
}
|
||||
}
|
||||
|
||||
if let realmObject = object as? Object {
|
||||
self.realm().delete(realmObject)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Private
|
||||
|
||||
fileprivate func realm() -> Realm
|
||||
{
|
||||
return try! Realm()
|
||||
}
|
||||
|
||||
fileprivate func defaultRealmPathIsEqualToPath(_ path: URL?) -> Bool
|
||||
{
|
||||
guard let path = path else { return false }
|
||||
return Realm.Configuration.defaultConfiguration.fileURL == path
|
||||
}
|
||||
|
||||
fileprivate func loadDefaultRealmFromFileName(_ fileName: String, migrateToSchemaVersion: UInt64)
|
||||
{
|
||||
guard let path = self.pathForFileName(fileName) else { fatalError("Cant find path for DB with filename: \(fileName) v.\(migrateToSchemaVersion)") }
|
||||
if (self.defaultRealmPathIsEqualToPath(path)) { return }
|
||||
|
||||
self.assignDefaultRealmPath(path)
|
||||
self.migrateDefaultRealmToSchemaVersion(migrateToSchemaVersion)
|
||||
}
|
||||
|
||||
fileprivate func pathForFileName(_ fileName: String) -> URL?
|
||||
{
|
||||
let path = URL(fileURLWithPath: RealmDAO.databasePath())
|
||||
let realmPath = path.appendingPathComponent(fileName)
|
||||
return realmPath
|
||||
}
|
||||
|
||||
fileprivate func assignDefaultRealmPath(_ path: URL)
|
||||
{
|
||||
var configuration: Realm.Configuration = Realm.Configuration.defaultConfiguration
|
||||
configuration.fileURL = path
|
||||
Realm.Configuration.defaultConfiguration = configuration
|
||||
}
|
||||
|
||||
fileprivate func migrateDefaultRealmToSchemaVersion(_ version: UInt64)
|
||||
{
|
||||
var configuration: Realm.Configuration = Realm.Configuration.defaultConfiguration
|
||||
configuration.schemaVersion = version
|
||||
Realm.Configuration.defaultConfiguration = configuration
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +1,13 @@
|
|||
//
|
||||
// CascadeDeletionProtocol.swift
|
||||
// DAO
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 24.06.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
import RealmSwift
|
||||
|
||||
|
||||
/// Protocol to implement cascade deletion of related entities
|
||||
public protocol CascadeDeletionProtocol {
|
||||
|
||||
var objectsToDelete: [Object] { get }
|
||||
|
||||
func objectsToDelete() -> [AnyObject?]
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// Entity.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 05.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import Foundation
|
||||
|
||||
open class Entity: Hashable {
|
||||
|
||||
open var hashValue: Int {
|
||||
get {
|
||||
return self.entityId.hashValue
|
||||
}
|
||||
}
|
||||
|
||||
open var entityId: String!
|
||||
|
||||
required public init() {
|
||||
}
|
||||
|
||||
open class func entityWithId(_ entityId: String) -> Entity {
|
||||
return Entity(entityId: entityId)
|
||||
}
|
||||
|
||||
public init(entityId: String) {
|
||||
self.entityId = entityId
|
||||
}
|
||||
|
||||
open func equals<T>(_ other: T) -> Bool where T: Entity {
|
||||
return self.entityId == other.entityId
|
||||
}
|
||||
}
|
||||
|
||||
public func ==<T>(lhs: T, rhs: T) -> Bool where T: Entity {
|
||||
return lhs.equals(rhs)
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
//
|
||||
// RLMEntry.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Realm
|
||||
import RealmSwift
|
||||
|
||||
open class RLMEntry: Object {
|
||||
|
||||
@objc dynamic open var entryId: String
|
||||
|
||||
public init(entryId: String)
|
||||
{
|
||||
self.entryId = entryId
|
||||
super.init()
|
||||
}
|
||||
|
||||
public required init()
|
||||
{
|
||||
self.entryId = ""
|
||||
super.init()
|
||||
}
|
||||
|
||||
required public init(realm: RLMRealm, schema: RLMObjectSchema)
|
||||
{
|
||||
self.entryId = ""
|
||||
super.init(realm: realm, schema: schema)
|
||||
}
|
||||
|
||||
required public init(value: Any, schema: RLMSchema) {
|
||||
fatalError("init(value:schema:) has not been implemented")
|
||||
}
|
||||
|
||||
open class func nullEntry() -> RLMEntry
|
||||
{
|
||||
let entry = RLMEntry()
|
||||
entry.entryId = "0"
|
||||
return entry
|
||||
}
|
||||
|
||||
override open class func primaryKey() -> String?
|
||||
{
|
||||
return "entryId"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// RealmTranslator.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 04.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RealmSwift
|
||||
|
||||
open class RealmTranslator<Model: Entity, RealmModel: Object> {
|
||||
|
||||
public required init()
|
||||
{
|
||||
// MARK: ничего не делать
|
||||
}
|
||||
|
||||
open var entryClassName: RealmModel.Type
|
||||
{
|
||||
get {
|
||||
return RealmModel.self
|
||||
}
|
||||
}
|
||||
|
||||
open func toEntry(_ entity: Model) -> RealmModel
|
||||
{
|
||||
fatalError("Abstract method")
|
||||
}
|
||||
|
||||
open func toEntity(_ entry: RealmModel) -> Model
|
||||
{
|
||||
fatalError("Abstract method")
|
||||
}
|
||||
|
||||
open func toEntries(_ entities: [Model]?) -> List<RealmModel>
|
||||
{
|
||||
let list = List<RealmModel>()
|
||||
guard let entities = entities else { return list }
|
||||
list.append(objectsIn: entities.map { entity in self.toEntry(entity) })
|
||||
return list
|
||||
}
|
||||
|
||||
open func toEntities(_ entries: List<RealmModel>) -> [Model]
|
||||
{
|
||||
let entities: [Model] = entries.map { entry in self.toEntity(entry) }
|
||||
return entities
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,10 +13,14 @@
|
|||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>0.0.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// RealmTranslator.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 05.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import CoreDAO
|
||||
|
||||
class RLMEntityTranslator: RealmTranslator<Entity, DBEntity> {
|
||||
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
override func toEntity(_ entry: DBEntity) -> Entity {
|
||||
return Entity.entityWithId(entry.entryId)
|
||||
}
|
||||
|
||||
override func toEntry(_ entity: Entity) -> DBEntity {
|
||||
return DBEntity.entityWithId(entity.entityId)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// RLMFolderTranslator.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import CoreDAO
|
||||
import RealmSwift
|
||||
|
||||
class RLMFolderTranslator: RealmTranslator<Folder, DBFolder> {
|
||||
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
override func toEntry(_ entity: Folder) -> DBFolder {
|
||||
let folder = entity
|
||||
let messageTranslator = RLMMessageTranslator()
|
||||
let messages = messageTranslator.toEntries(folder.messages)
|
||||
|
||||
return DBFolder.folderWithId(folder.entityId, name: folder.name ?? "", messages: messages )
|
||||
}
|
||||
|
||||
override func toEntity(_ entry: DBFolder) -> Folder {
|
||||
let messageTranslator = RLMMessageTranslator()
|
||||
let messages = messageTranslator.toEntities(entry.messages)
|
||||
|
||||
return Folder.folderWithId(entry.entryId, name: entry.name, messages: messages)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// RLMMessageTranslator.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import CoreDAO
|
||||
|
||||
class RLMMessageTranslator: RealmTranslator<Message, DBMessage> {
|
||||
|
||||
required init() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
override func toEntity(_ entry: DBMessage) -> Message {
|
||||
return Message(entityId:entry.entryId, text: entry.text)
|
||||
}
|
||||
|
||||
override func toEntry(_ entity: Message) -> DBMessage {
|
||||
return DBMessage.messageWithId(entity.entityId, text: entity.text)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,345 @@
|
|||
//
|
||||
// DAOTest.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 05.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import CoreDAO
|
||||
|
||||
|
||||
|
||||
@UIApplicationMain
|
||||
class DAOTest: UIResponder, UIApplicationDelegate {
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
print("\(NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first ?? "")")
|
||||
self.setupRealmdataBase()
|
||||
|
||||
self.testRealmEntitiesDAO()
|
||||
self.testRealmMessageDAO()
|
||||
self.testRealmFoldersDAO()
|
||||
|
||||
// testCoreDataEntitiesDAO()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func setupRealmdataBase() {
|
||||
RealmDAO.assignDatabaseVersion(1)
|
||||
RealmDAO.assignDatabaseFilename("DAOTest.realm")
|
||||
}
|
||||
|
||||
func testRealmEntitiesDAO() {
|
||||
self.testRealmEntity_Hashable_Protocol()
|
||||
self.testRealmPersist_EntityWithId_returnYES()
|
||||
self.testRealmReadById_entityExist_returnExactlyEntity()
|
||||
self.testRealmEraseById_entityExists_entityErased()
|
||||
}
|
||||
|
||||
func testRealmMessageDAO() {
|
||||
self.testRealmPersist_messageWithAllFields_returnsYES()
|
||||
self.testRealmReadById_messageExists_returnsExactMessage()
|
||||
self.testRealmEraseById_messageExists_messageErased()
|
||||
}
|
||||
|
||||
func testRealmFoldersDAO() {
|
||||
self.testRealmPersist_folderWithAllFields_returnsYES()
|
||||
self.testRealmReadById_folderExists_returnsExactFolder()
|
||||
self.testRealmReadById_folderWithMessages_returnsExactFolder()
|
||||
self.testRealmEraseById_folderExists_folderErased()
|
||||
self.testRealmEraseByIdCascade_folderExists_folderErasedWithMessages()
|
||||
}
|
||||
|
||||
/*func testCoreDataEntitiesDAO() {
|
||||
testCoreDataPersist_entityWithId_returnsYES()
|
||||
testCoreDataPersistAll_entityWithId_returnsYES()
|
||||
testCoreDataPersistInBackground_entityWithId_returnsYES()
|
||||
testCoreDataReadById_entityExists_returnsExactEntity()
|
||||
testCoreDataReadById_entitySavedInBackground_returnsExactEntity()
|
||||
testCoreDataEraseById_entityExists_entityErased()
|
||||
}*/
|
||||
|
||||
|
||||
func testRealmEntity_Hashable_Protocol()
|
||||
{
|
||||
let entityA = Entity(entityId: "1")
|
||||
let entityB = Entity(entityId: "1")
|
||||
let entityC = Entity(entityId: "2")
|
||||
|
||||
print("\(#function) equals result: \(entityA != entityC && entityB != entityC && entityA == entityB)")
|
||||
|
||||
let entitySet: Set = [entityA, entityB, entityC]
|
||||
print("\(#function) hashable result: \(entitySet.count == 2)")
|
||||
}
|
||||
|
||||
func testRealmPersist_EntityWithId_returnYES() {
|
||||
let dao = self.entityRealmDAO()
|
||||
let entity: Entity = Entity(entityId: "1")
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
print("\(#function) result:\(entity == dao.read(entity.entityId))")
|
||||
}
|
||||
|
||||
func testRealmReadById_entityExist_returnExactlyEntity() {
|
||||
let dao = self.entityRealmDAO()
|
||||
let entity = Entity(entityId: "2")
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
let savedEntity: Entity? = dao.read("2")
|
||||
print("\(#function) result:\(entity == savedEntity)")
|
||||
}
|
||||
|
||||
func testRealmEraseById_entityExists_entityErased() {
|
||||
let dao = self.entityRealmDAO()
|
||||
let entity = Entity(entityId: "3")
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
try dao.erase("3")
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
|
||||
let erasedEntity: Entity? = dao.read("3")
|
||||
print("\(#function) result:\(erasedEntity == nil)")
|
||||
}
|
||||
|
||||
func testRealmPersist_messageWithAllFields_returnsYES() {
|
||||
let dao = self.messageDAO()
|
||||
let message = Message(entityId: "abc", text: "text")
|
||||
do {
|
||||
try dao.persist(message)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
print("\(#function) result:\(message == dao.read(message.entityId))")
|
||||
}
|
||||
|
||||
func testRealmReadById_messageExists_returnsExactMessage() {
|
||||
let dao = self.messageDAO()
|
||||
let message = Message(entityId: "def", text: "text 2")
|
||||
do {
|
||||
try dao.persist(message)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
let savedMessage = dao.read("def")
|
||||
print("\(#function) result:\(message == savedMessage)")
|
||||
}
|
||||
|
||||
func testRealmEraseById_messageExists_messageErased() {
|
||||
let dao = self.entityRealmDAO()
|
||||
let message = Entity(entityId: "ghi")
|
||||
do {
|
||||
try dao.persist(message)
|
||||
try dao.erase("ghi")
|
||||
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
let erasedMessage = dao.read("ghi")
|
||||
print("\(#function) result:\(erasedMessage == nil)")
|
||||
}
|
||||
|
||||
fileprivate func testRealmPersist_folderWithAllFields_returnsYES() {
|
||||
let dao = self.folderDAO()
|
||||
let folder = Folder.folderWithId("I", name: "INBOX", messages: [])
|
||||
do {
|
||||
try dao.persist(folder)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
print("\(#function) result: \(dao.read(folder.entityId) == folder)")
|
||||
}
|
||||
|
||||
fileprivate func testRealmReadById_folderExists_returnsExactFolder() {
|
||||
let dao = self.folderDAO()
|
||||
let folderID = "II"
|
||||
let folder = Folder.folderWithId(folderID, name: "OUTBOX", messages: [])
|
||||
do {
|
||||
try dao.persist(folder)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
let savedFolder = dao.read(folderID)
|
||||
print("\(#function) result:\(folder == savedFolder)")
|
||||
}
|
||||
|
||||
fileprivate func testRealmReadById_folderWithMessages_returnsExactFolder() {
|
||||
let dao = self.folderDAO()
|
||||
let folderID = "IV"
|
||||
let message1 = Message(entityId: "IV.1", text: "text IV.1")
|
||||
let message2 = Message(entityId: "IV.2", text: "text IV.2")
|
||||
|
||||
let folder = Folder.folderWithId(folderID, name: "SPAM", messages: [message1, message2])
|
||||
do {
|
||||
try dao.persist(folder)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
let savedFolder = dao.read(folderID)
|
||||
|
||||
print("\(#function) result:\(folder == savedFolder)")
|
||||
}
|
||||
|
||||
fileprivate func testRealmEraseById_folderExists_folderErased() {
|
||||
let dao = self.folderDAO()
|
||||
let folderID = "III"
|
||||
|
||||
let folder = Folder.folderWithId(folderID, name: "SENT", messages: [])
|
||||
do {
|
||||
try dao.persist(folder)
|
||||
try dao.erase(folderID)
|
||||
print("\(#function) result:\(dao.read(folderID) == nil)")
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate func testRealmEraseByIdCascade_folderExists_folderErasedWithMessages() {
|
||||
let dao = self.folderDAO()
|
||||
|
||||
let messageID = "V.message"
|
||||
let message = Message.init(entityId: messageID, text: "V.message.text")
|
||||
|
||||
let folderID = "V"
|
||||
let folder = Folder.folderWithId(folderID, name: "Delete", messages: [message])
|
||||
do {
|
||||
try dao.persist(folder)
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
|
||||
let messageDAO = self.messageDAO()
|
||||
let savedMessage = messageDAO.read(messageID)
|
||||
if (savedMessage == nil) { fatalError() }
|
||||
|
||||
do {
|
||||
try dao.erase(folderID)
|
||||
print("\(#function) result:\(messageDAO.read(messageID) == nil)")
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: CoreData
|
||||
|
||||
/*func testCoreDataPersist_entityWithId_returnsYES() {
|
||||
let dao = entityCoreDataDAO()
|
||||
let entity = Entity(entityId: "1")
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
print("\(#function): true")
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
}
|
||||
}
|
||||
|
||||
func testCoreDataPersistAll_entityWithId_returnsYES() {
|
||||
let dao = entityCoreDataDAO()
|
||||
let firstEntity = Entity(entityId: "1")
|
||||
let secondEntity = Entity(entityId: "2")
|
||||
do {
|
||||
try dao.persistAll([firstEntity, secondEntity])
|
||||
print("\(#function): true")
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func testCoreDataPersistInBackground_entityWithId_returnsYES() {
|
||||
DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async { () -> Void in
|
||||
let dao = self.entityCoreDataDAO()
|
||||
let entity = Entity(entityId: "1_back")
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
print("\(#function): true")
|
||||
} catch {
|
||||
print("[ERROR] in \(#function)")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testCoreDataReadById_entityExists_returnsExactEntity() {
|
||||
let dao = entityCoreDataDAO()
|
||||
let entityId = "2"
|
||||
let entity = Entity(entityId: entityId)
|
||||
|
||||
var result = false
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
if let savedEntity = dao.read(entityId) {
|
||||
result = savedEntity.entityId == entity.entityId
|
||||
}
|
||||
print("\(#function): \(result)")
|
||||
} catch {
|
||||
print("[ERROR] whe persis in \(#function)")
|
||||
}
|
||||
}
|
||||
|
||||
func testCoreDataReadById_entitySavedInBackground_returnsExactEntity() {
|
||||
let dao = entityCoreDataDAO()
|
||||
let entityId = "2_back"
|
||||
let entity = Entity(entityId: entityId)
|
||||
|
||||
DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.default).async { () -> Void in
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
} catch {
|
||||
print("[ERROR] When Persis entity in \(#function)")
|
||||
}
|
||||
|
||||
DispatchQueue.main.async(execute: { () -> Void in
|
||||
var result = false
|
||||
if let savedEntity = dao.read(entityId) {
|
||||
result = savedEntity.entityId == entity.entityId
|
||||
}
|
||||
print("\(#function): \(result)")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func testCoreDataEraseById_entityExists_entityErased() {
|
||||
let dao = entityCoreDataDAO()
|
||||
let entityId = "3"
|
||||
let entity = Entity(entityId: entityId)
|
||||
do {
|
||||
try dao.persist(entity)
|
||||
try dao.erase(entityId)
|
||||
} catch {
|
||||
print("[ERROR] Error whe try in \(#function)")
|
||||
}
|
||||
|
||||
print("\(#function): \(dao.read(entityId) == nil)")
|
||||
}
|
||||
*/
|
||||
// MARK: Инициализация DAO объектов
|
||||
|
||||
fileprivate func entityRealmDAO() -> RealmDAO<Entity, DBEntity> {
|
||||
return RealmDAO(translator: RLMEntityTranslator())
|
||||
}
|
||||
|
||||
fileprivate func messageDAO() -> RealmDAO<Message, DBMessage> {
|
||||
let a = RealmDAO(translator: RLMMessageTranslator())
|
||||
return a
|
||||
}
|
||||
|
||||
fileprivate func folderDAO() -> RealmDAO<Folder, DBFolder> {
|
||||
return RealmDAO(translator: RLMFolderTranslator())
|
||||
}
|
||||
/*
|
||||
fileprivate func entityCoreDataDAO() -> CoreDataDAO<CDEntity, Entity> {
|
||||
return CoreDataDAO(translator: CDEntityTranslator.translator())
|
||||
}*/
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// Folder.swift
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
import CoreDAO
|
||||
|
||||
|
||||
class Folder: Entity {
|
||||
|
||||
var name: String?
|
||||
var messages: [Message]?
|
||||
|
||||
class func folderWithId(_ entityId: String, name: String, messages: [Message]?) -> Folder {
|
||||
let folder = Folder(entityId: entityId)
|
||||
folder.name = name
|
||||
folder.messages = messages
|
||||
return folder
|
||||
}
|
||||
|
||||
override func equals<T>(_ other: T) -> Bool where T : Folder {
|
||||
return (super.equals(other)) && self.name == other.name && self.messagesArrayEquals(other.messages)
|
||||
}
|
||||
|
||||
fileprivate func messagesArrayEquals(_ otherMessages: [Message]?) -> Bool {
|
||||
if (self.messages?.count != otherMessages?.count) { return false }
|
||||
guard let messages = self.messages,
|
||||
let otherMessages = otherMessages else { return false }
|
||||
|
||||
for message in otherMessages {
|
||||
if (!messages.contains(message)) { return false }
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +1,31 @@
|
|||
//
|
||||
// Message.swift
|
||||
// DAO
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 05.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import CoreDAO
|
||||
|
||||
|
||||
class Message: Entity {
|
||||
|
||||
var text: String?
|
||||
|
||||
init(entityId: String, text: String?) {
|
||||
init(entityId: String, text: String?)
|
||||
{
|
||||
self.text = text
|
||||
super.init(entityId: entityId)
|
||||
}
|
||||
|
||||
required init() {
|
||||
required init()
|
||||
{
|
||||
super.init()
|
||||
}
|
||||
|
||||
override func equals<T>(_ other: T) -> Bool where T: Entity {
|
||||
guard let other = other as? Message else { return false }
|
||||
override func equals<T>(_ other: T) -> Bool where T: Message
|
||||
{
|
||||
return super.equals(other) && self.text == other.text
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
//
|
||||
// DBEntity.swift
|
||||
// DAO
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 05.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import CoreDAO
|
||||
|
||||
|
||||
class DBEntity: RLMEntry {
|
||||
|
|
@ -17,6 +17,4 @@ class DBEntity: RLMEntry {
|
|||
entity.entryId = entityId
|
||||
return entity
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
//
|
||||
// DBFolder.swift
|
||||
// DAO
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import CoreDAO
|
||||
import RealmSwift
|
||||
|
||||
class DBFolder: DBEntity, CascadeDeletionProtocol {
|
||||
|
||||
@objc dynamic var name: String = ""
|
||||
var messages = List<DBMessage>()
|
||||
let messages = List<DBMessage>()
|
||||
|
||||
|
||||
class func folderWithId(_ entryId: String, name: String, messages: List<DBMessage>) -> DBFolder {
|
||||
|
|
@ -23,7 +23,8 @@ class DBFolder: DBEntity, CascadeDeletionProtocol {
|
|||
return folder
|
||||
}
|
||||
|
||||
var objectsToDelete: [Object] {
|
||||
return Array(messages)
|
||||
func objectsToDelete() -> [AnyObject?]
|
||||
{
|
||||
return [messages]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
//
|
||||
// DBMessage.swift
|
||||
// DAO
|
||||
// CoreDAO
|
||||
//
|
||||
// Created by Igor Bulyga on 09.02.16.
|
||||
// Copyright © 2016 RedMadRobot LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import DAO
|
||||
import CoreDAO
|
||||
|
||||
class DBMessage: DBEntity {
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="9525" systemVersion="15D21" minimumToolsVersion="Xcode 7.0">
|
||||
<entity name="CDEntity" representedClassName="CDEntity" syncable="YES">
|
||||
<attribute name="entryId" attributeType="String" defaultValueString="1" syncable="YES"/>
|
||||
</entity>
|
||||
<elements>
|
||||
<element name="CDEntity" positionX="-63" positionY="-18" width="128" height="60"/>
|
||||
</elements>
|
||||
</model>
|
||||
|
|
@ -6,10 +6,6 @@
|
|||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict/>
|
||||
<key>CFBundleIcons~ipad</key>
|
||||
<dict/>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
|
|
@ -19,13 +15,15 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
|
|
@ -34,6 +32,7 @@
|
|||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
|
||||
platform :ios, '8.0'
|
||||
inhibit_all_warnings!
|
||||
use_frameworks!
|
||||
|
||||
project 'CoreDAO.xcodeproj'
|
||||
workspace 'Workspace.xcworkspace'
|
||||
|
||||
realmVersion = '~> 3.0'
|
||||
|
||||
target :CoreDAOExample do
|
||||
pod 'RealmSwift', realmVersion
|
||||
end
|
||||
|
||||
target :CoreDAO do
|
||||
pod 'RealmSwift', realmVersion
|
||||
end
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
PODS:
|
||||
- Realm (3.0.1):
|
||||
- Realm/Headers (= 3.0.1)
|
||||
- Realm/Headers (3.0.1)
|
||||
- RealmSwift (3.0.1):
|
||||
- Realm (= 3.0.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- RealmSwift (~> 3.0)
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Realm: ba6144c74f835f7497791f6599d63a7755377b83
|
||||
RealmSwift: 7d13b1ac4b6022a13f841e3143e7789c9e40ad0d
|
||||
|
||||
PODFILE CHECKSUM: 434d7592ecda84e066645efd48898ced54689766
|
||||
|
||||
COCOAPODS: 1.3.1
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:DAO.xcodeproj">
|
||||
location = "group:CoreDAO.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# найдем директорию, в которой лежит файл исполняемого срипта
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# перейдем в нее
|
||||
cd "$DIR"
|
||||
|
||||
# подгрузим поды
|
||||
pod install
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# найдем директорию, в которой лежит файл исполняемого срипта
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# перейдем в нее
|
||||
cd "$DIR"
|
||||
|
||||
# обновим поды
|
||||
pod update
|
||||
|
||||
Loading…
Reference in New Issue