Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Migrate to Swift 3
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis committed Jun 29, 2016
1 parent 103e251 commit 18ee8c2
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 53 deletions.
79 changes: 41 additions & 38 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
14EEAC3B1CBFADA1002E495A /* DATAStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14BC05381CBEF21C006278EA /* DATAStack.swift */; };
14EEAC3C1CBFADA1002E495A /* TestCheck.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14BC05391CBEF21C006278EA /* TestCheck.swift */; };
14EEAC3D1CBFADD6002E495A /* DATAStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14B3898D1CBF8166001123DC /* DATAStack.h */; settings = {ATTRIBUTES = (Public, ); }; };
3676EDCDB6E9D1F217E407F5 /* Pods_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 361F47EB6A4E097F4F9ECCD0 /* Pods_Tests.framework */; };
9D8B2A9BEA8134EADD5A035E /* Pods_CocoaPods_DemoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 456313516DE511EF34E737F8 /* Pods_CocoaPods_DemoSwift.framework */; };
DFED6C60B0F6959CB9404D01 /* Pods_CocoaPods_DemoObjectiveC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66CD307C7D7A36353574E32B /* Pods_CocoaPods_DemoObjectiveC.framework */; };
16B99B166ABA138D30657D31 /* Pods_CocoaPods_DemoSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ED5F0E7769789BCE9615558 /* Pods_CocoaPods_DemoSwift.framework */; };
30D902FF9C2414F9CC849727 /* Pods_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 100C0C4A9581C85EE5EC0393 /* Pods_Tests.framework */; };
BCF18697AEFA9C7887233C30 /* Pods_CocoaPods_DemoObjectiveC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95CA305AD16508574EF2A03A /* Pods_CocoaPods_DemoObjectiveC.framework */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -58,8 +58,8 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0DAFB8FD2E6FCA36B8474FBB /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = "<group>"; };
10AE9E5719263C3A2EE994B0 /* Pods-CocoaPods-DemoObjectiveC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoObjectiveC.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoObjectiveC/Pods-CocoaPods-DemoObjectiveC.release.xcconfig"; sourceTree = "<group>"; };
0ED5F0E7769789BCE9615558 /* Pods_CocoaPods_DemoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaPods_DemoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
100C0C4A9581C85EE5EC0393 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
146D72AC1AB782920058798C /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
146D72B11AB782920058798C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
146E61931C89903200BDAC73 /* DataModelTest.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = DataModelTest.xcdatamodel; sourceTree = "<group>"; };
Expand Down Expand Up @@ -95,13 +95,13 @@
14C0AF821BD6D4230009ECBE /* CONTRIBUTING.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = "<group>"; };
14C0AF831BD6D4230009ECBE /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
14EEAC2F1CBFAD61002E495A /* DATAStack.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DATAStack.framework; sourceTree = BUILT_PRODUCTS_DIR; };
20DD5E1AE45BCC1BDAE3933E /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = "<group>"; };
361F47EB6A4E097F4F9ECCD0 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
42A10FAA0E3352B6E59441ED /* Pods-CocoaPods-DemoObjectiveC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoObjectiveC.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoObjectiveC/Pods-CocoaPods-DemoObjectiveC.debug.xcconfig"; sourceTree = "<group>"; };
456313516DE511EF34E737F8 /* Pods_CocoaPods_DemoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaPods_DemoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
66CD307C7D7A36353574E32B /* Pods_CocoaPods_DemoObjectiveC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaPods_DemoObjectiveC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
85C65A448020280552213235 /* Pods-CocoaPods-DemoSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoSwift/Pods-CocoaPods-DemoSwift.debug.xcconfig"; sourceTree = "<group>"; };
C3BE2489CB0219F8DDD4FFD8 /* Pods-CocoaPods-DemoSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoSwift.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoSwift/Pods-CocoaPods-DemoSwift.release.xcconfig"; sourceTree = "<group>"; };
22016BA17E23BE50C0C0E378 /* Pods-CocoaPods-DemoSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoSwift.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoSwift/Pods-CocoaPods-DemoSwift.release.xcconfig"; sourceTree = "<group>"; };
8EB9899F7E720EA81EB5F9D0 /* Pods-CocoaPods-DemoSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoSwift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoSwift/Pods-CocoaPods-DemoSwift.debug.xcconfig"; sourceTree = "<group>"; };
9546DED0369BF9180B905940 /* Pods-CocoaPods-DemoObjectiveC.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoObjectiveC.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoObjectiveC/Pods-CocoaPods-DemoObjectiveC.debug.xcconfig"; sourceTree = "<group>"; };
9568DDCDF2BE1B768485CFB8 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = "<group>"; };
95CA305AD16508574EF2A03A /* Pods_CocoaPods_DemoObjectiveC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CocoaPods_DemoObjectiveC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9F3A07EA7B121A4203AACE2D /* Pods-CocoaPods-DemoObjectiveC.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CocoaPods-DemoObjectiveC.release.xcconfig"; path = "Pods/Target Support Files/Pods-CocoaPods-DemoObjectiveC/Pods-CocoaPods-DemoObjectiveC.release.xcconfig"; sourceTree = "<group>"; };
A7FCDC924B9987692B09F3B7 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = "<group>"; };
FBB587921D76B8A7F65DC957 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand All @@ -110,7 +110,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3676EDCDB6E9D1F217E407F5 /* Pods_Tests.framework in Frameworks */,
30D902FF9C2414F9CC849727 /* Pods_Tests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -132,15 +132,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
DFED6C60B0F6959CB9404D01 /* Pods_CocoaPods_DemoObjectiveC.framework in Frameworks */,
BCF18697AEFA9C7887233C30 /* Pods_CocoaPods_DemoObjectiveC.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
148C33621BD7CB74009701BF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9D8B2A9BEA8134EADD5A035E /* Pods_CocoaPods_DemoSwift.framework in Frameworks */,
16B99B166ABA138D30657D31 /* Pods_CocoaPods_DemoSwift.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -161,19 +161,6 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
07398136D365984BB641140C /* Pods */ = {
isa = PBXGroup;
children = (
42A10FAA0E3352B6E59441ED /* Pods-CocoaPods-DemoObjectiveC.debug.xcconfig */,
10AE9E5719263C3A2EE994B0 /* Pods-CocoaPods-DemoObjectiveC.release.xcconfig */,
85C65A448020280552213235 /* Pods-CocoaPods-DemoSwift.debug.xcconfig */,
C3BE2489CB0219F8DDD4FFD8 /* Pods-CocoaPods-DemoSwift.release.xcconfig */,
20DD5E1AE45BCC1BDAE3933E /* Pods-Tests.debug.xcconfig */,
0DAFB8FD2E6FCA36B8474FBB /* Pods-Tests.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
146D728A1AB782920058798C = {
isa = PBXGroup;
children = (
Expand All @@ -184,7 +171,7 @@
148C33661BD7CB74009701BF /* DemoSwift */,
146D72941AB782920058798C /* Products */,
77DF77972F8FD3F72BF7C81E /* Frameworks */,
07398136D365984BB641140C /* Pods */,
B9870FAE40CEB1EEEE977EF8 /* Pods */,
);
indentWidth = 4;
sourceTree = "<group>";
Expand Down Expand Up @@ -287,13 +274,26 @@
isa = PBXGroup;
children = (
FBB587921D76B8A7F65DC957 /* Pods.framework */,
66CD307C7D7A36353574E32B /* Pods_CocoaPods_DemoObjectiveC.framework */,
456313516DE511EF34E737F8 /* Pods_CocoaPods_DemoSwift.framework */,
361F47EB6A4E097F4F9ECCD0 /* Pods_Tests.framework */,
95CA305AD16508574EF2A03A /* Pods_CocoaPods_DemoObjectiveC.framework */,
0ED5F0E7769789BCE9615558 /* Pods_CocoaPods_DemoSwift.framework */,
100C0C4A9581C85EE5EC0393 /* Pods_Tests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
B9870FAE40CEB1EEEE977EF8 /* Pods */ = {
isa = PBXGroup;
children = (
9546DED0369BF9180B905940 /* Pods-CocoaPods-DemoObjectiveC.debug.xcconfig */,
9F3A07EA7B121A4203AACE2D /* Pods-CocoaPods-DemoObjectiveC.release.xcconfig */,
8EB9899F7E720EA81EB5F9D0 /* Pods-CocoaPods-DemoSwift.debug.xcconfig */,
22016BA17E23BE50C0C0E378 /* Pods-CocoaPods-DemoSwift.release.xcconfig */,
A7FCDC924B9987692B09F3B7 /* Pods-Tests.debug.xcconfig */,
9568DDCDF2BE1B768485CFB8 /* Pods-Tests.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -498,6 +498,7 @@
CreatedOnToolsVersion = 7.0.1;
DevelopmentTeam = C6K65RDJHL;
DevelopmentTeamName = "Elvis Nunez (Personal Team)";
LastSwiftMigration = 0800;
};
148C33641BD7CB74009701BF = {
CreatedOnToolsVersion = 7.0.1;
Expand Down Expand Up @@ -913,7 +914,7 @@
};
146D72BA1AB782920058798C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 20DD5E1AE45BCC1BDAE3933E /* Pods-Tests.debug.xcconfig */;
baseConfigurationReference = A7FCDC924B9987692B09F3B7 /* Pods-Tests.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand All @@ -932,7 +933,7 @@
};
146D72BB1AB782920058798C /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 0DAFB8FD2E6FCA36B8474FBB /* Pods-Tests.release.xcconfig */;
baseConfigurationReference = 9568DDCDF2BE1B768485CFB8 /* Pods-Tests.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = "";
Expand Down Expand Up @@ -1057,7 +1058,7 @@
};
148C335F1BD7CB67009701BF /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 42A10FAA0E3352B6E59441ED /* Pods-CocoaPods-DemoObjectiveC.debug.xcconfig */;
baseConfigurationReference = 9546DED0369BF9180B905940 /* Pods-CocoaPods-DemoObjectiveC.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand All @@ -1068,12 +1069,13 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = x.DemoObjectiveC;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
148C33601BD7CB67009701BF /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 10AE9E5719263C3A2EE994B0 /* Pods-CocoaPods-DemoObjectiveC.release.xcconfig */;
baseConfigurationReference = 9F3A07EA7B121A4203AACE2D /* Pods-CocoaPods-DemoObjectiveC.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand All @@ -1085,12 +1087,13 @@
PRODUCT_BUNDLE_IDENTIFIER = x.DemoObjectiveC;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
};
name = Release;
};
148C33731BD7CB74009701BF /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 85C65A448020280552213235 /* Pods-CocoaPods-DemoSwift.debug.xcconfig */;
baseConfigurationReference = 8EB9899F7E720EA81EB5F9D0 /* Pods-CocoaPods-DemoSwift.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand All @@ -1108,7 +1111,7 @@
};
148C33741BD7CB74009701BF /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C3BE2489CB0219F8DDD4FFD8 /* Pods-CocoaPods-DemoSwift.release.xcconfig */;
baseConfigurationReference = 22016BA17E23BE50C0C0E378 /* Pods-CocoaPods-DemoSwift.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down
8 changes: 4 additions & 4 deletions DemoSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class ViewController: UITableViewController {
var dataStack: DATAStack

lazy var dataSource: DATASource = {
let request: NSFetchRequest = NSFetchRequest(entityName: "User")
request.sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)]
let request: NSFetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: "User")
request.sortDescriptors = [SortDescriptor(key: "name", ascending: true)]

let dataSource = DATASource(tableView: self.tableView, cellIdentifier: "Cell", fetchRequest: request, mainContext: self.dataStack.mainContext, configuration: { cell, item, indexPath in
if let name = item.valueForKey("name") as? String, createdDate = item.valueForKey("createdDate") as? NSDate {
if let name = item.value(forKey: "name") as? String, createdDate = item.value(forKey: "createdDate") as? NSDate {
cell.textLabel?.text = name + " - " + createdDate.description
}
})
Expand Down Expand Up @@ -45,7 +45,7 @@ class ViewController: UITableViewController {
func createBackground() {
self.dataStack.performInNewBackgroundContext { backgroundContext in
let entity = NSEntityDescription.entity(forEntityName: "User", in: backgroundContext)!
let object = NSManagedObject(entity: entity, insertIntoManagedObjectContext: backgroundContext)
let object = NSManagedObject(entity: entity, insertInto: backgroundContext)
object.setValue("Background", forKey: "name")
object.setValue(NSDate(), forKey: "createdDate")
try! backgroundContext.save()
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use_frameworks!

abstract_target 'CocoaPods' do
pod 'DATASource'
pod 'DATASource', git: '[email protected]:3lvis/DATASource.git', branch: 'feature/swift-3'

target 'DemoObjectiveC' do
end
Expand Down
18 changes: 14 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
PODS:
- DATASource (5.8.0)
- DATASource (6.0.0-beta1)

DEPENDENCIES:
- DATASource
- DATASource (from `[email protected]:3lvis/DATASource.git`, branch `feature/swift-3`)

EXTERNAL SOURCES:
DATASource:
:branch: feature/swift-3
:git: [email protected]:3lvis/DATASource.git

CHECKOUT OPTIONS:
DATASource:
:commit: 7328e3442795793ca15529532d3a065d2c3a7b68
:git: [email protected]:3lvis/DATASource.git

SPEC CHECKSUMS:
DATASource: d5ecdfa4be7d73d41f58746d3346e5238766c86d
DATASource: 49dd4063eeb81657572362eea7e3aa9b3d921c68

PODFILE CHECKSUM: eec3b04d52e4f938bd867ed08059dfd5dfca6fbf
PODFILE CHECKSUM: 7d2705294ed1eeb9f4aa86e74dd3aa885ccc81c3

COCOAPODS: 1.0.1
10 changes: 5 additions & 5 deletions Source/DATAStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import Foundation
import CoreData

@objc public enum DATAStackStoreType: Int {
case inMemory, SQLite
case inMemory, sqLite
}

@objc public class DATAStack: NSObject {
private var storeType: DATAStackStoreType = .SQLite
private var storeType: DATAStackStoreType = .sqLite

private var storeName: String?

Expand Down Expand Up @@ -308,7 +308,7 @@ extension NSPersistentStoreCoordinator {
}

break
case .SQLite:
case .sqLite:
let storeURL = try! URL.directoryURL().appendingPathComponent(filePath)
guard let storePath = storeURL.path else { throw NSError(info: "Store path not found: \(storeURL)", previousError: nil) }

Expand Down Expand Up @@ -340,7 +340,7 @@ extension NSPersistentStoreCoordinator {
}
}

let shouldExcludeSQLiteFromBackup = storeType == .SQLite && TestCheck.isTesting == false
let shouldExcludeSQLiteFromBackup = storeType == .sqLite && TestCheck.isTesting == false
if shouldExcludeSQLiteFromBackup {
do {
try (storeURL as NSURL).setResourceValue(true, forKey: URLResourceKey.isExcludedFromBackupKey)
Expand Down Expand Up @@ -388,7 +388,7 @@ extension NSError {
extension URL {
private static func directoryURL() -> URL {
#if os(tvOS)
return NSFileManager.defaultManager().URLsForDirectory(.CachesDirectory, inDomains: .UserDomainMask).last!
return FileManager.default().urlsForDirectory(.cachesDirectory, inDomains: .userDomainMask).last!
#else
return FileManager.default().urlsForDirectory(.documentDirectory, inDomains: .userDomainMask).last!
#endif
Expand Down
2 changes: 1 addition & 1 deletion Tests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Tests: XCTestCase {
}

func testDrop() {
let dataStack = self.createDataStack(.SQLite)
let dataStack = self.createDataStack(.sqLite)

dataStack.performInNewBackgroundContext { backgroundContext in
self.insertUserInContext(backgroundContext)
Expand Down

0 comments on commit 18ee8c2

Please sign in to comment.