From 18ee8c2c950c969ce1069f1adc7260adc66bc59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Nu=C3=B1ez?= Date: Wed, 29 Jun 2016 16:19:49 +0200 Subject: [PATCH] Migrate to Swift 3 --- Demo.xcodeproj/project.pbxproj | 79 ++++++++++++++++++---------------- DemoSwift/ViewController.swift | 8 ++-- Podfile | 2 +- Podfile.lock | 18 ++++++-- Source/DATAStack.swift | 10 ++--- Tests/Tests.swift | 2 +- 6 files changed, 66 insertions(+), 53 deletions(-) diff --git a/Demo.xcodeproj/project.pbxproj b/Demo.xcodeproj/project.pbxproj index 8bf76d0..a2af85f 100644 --- a/Demo.xcodeproj/project.pbxproj +++ b/Demo.xcodeproj/project.pbxproj @@ -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 */ @@ -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 = ""; }; - 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 = ""; }; + 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 = ""; }; 146E61931C89903200BDAC73 /* DataModelTest.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = DataModelTest.xcdatamodel; sourceTree = ""; }; @@ -95,13 +95,13 @@ 14C0AF821BD6D4230009ECBE /* CONTRIBUTING.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; }; 14C0AF831BD6D4230009ECBE /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 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 = ""; }; - 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 = ""; }; - 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 = ""; }; - 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; FBB587921D76B8A7F65DC957 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -110,7 +110,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3676EDCDB6E9D1F217E407F5 /* Pods_Tests.framework in Frameworks */, + 30D902FF9C2414F9CC849727 /* Pods_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -132,7 +132,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DFED6C60B0F6959CB9404D01 /* Pods_CocoaPods_DemoObjectiveC.framework in Frameworks */, + BCF18697AEFA9C7887233C30 /* Pods_CocoaPods_DemoObjectiveC.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -140,7 +140,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9D8B2A9BEA8134EADD5A035E /* Pods_CocoaPods_DemoSwift.framework in Frameworks */, + 16B99B166ABA138D30657D31 /* Pods_CocoaPods_DemoSwift.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -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 = ""; - }; 146D728A1AB782920058798C = { isa = PBXGroup; children = ( @@ -184,7 +171,7 @@ 148C33661BD7CB74009701BF /* DemoSwift */, 146D72941AB782920058798C /* Products */, 77DF77972F8FD3F72BF7C81E /* Frameworks */, - 07398136D365984BB641140C /* Pods */, + B9870FAE40CEB1EEEE977EF8 /* Pods */, ); indentWidth = 4; sourceTree = ""; @@ -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 = ""; }; + 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 = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -498,6 +498,7 @@ CreatedOnToolsVersion = 7.0.1; DevelopmentTeam = C6K65RDJHL; DevelopmentTeamName = "Elvis Nunez (Personal Team)"; + LastSwiftMigration = 0800; }; 148C33641BD7CB74009701BF = { CreatedOnToolsVersion = 7.0.1; @@ -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 = ""; @@ -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 = ""; @@ -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; @@ -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; @@ -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; @@ -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; diff --git a/DemoSwift/ViewController.swift b/DemoSwift/ViewController.swift index d01c410..b4e0c56 100644 --- a/DemoSwift/ViewController.swift +++ b/DemoSwift/ViewController.swift @@ -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(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 } }) @@ -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() diff --git a/Podfile b/Podfile index 893af6e..e381352 100644 --- a/Podfile +++ b/Podfile @@ -1,7 +1,7 @@ use_frameworks! abstract_target 'CocoaPods' do - pod 'DATASource' + pod 'DATASource', git: 'git@github.com:3lvis/DATASource.git', branch: 'feature/swift-3' target 'DemoObjectiveC' do end diff --git a/Podfile.lock b/Podfile.lock index fc6c679..d64a29a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,12 +1,22 @@ PODS: - - DATASource (5.8.0) + - DATASource (6.0.0-beta1) DEPENDENCIES: - - DATASource + - DATASource (from `git@github.com:3lvis/DATASource.git`, branch `feature/swift-3`) + +EXTERNAL SOURCES: + DATASource: + :branch: feature/swift-3 + :git: git@github.com:3lvis/DATASource.git + +CHECKOUT OPTIONS: + DATASource: + :commit: 7328e3442795793ca15529532d3a065d2c3a7b68 + :git: git@github.com:3lvis/DATASource.git SPEC CHECKSUMS: - DATASource: d5ecdfa4be7d73d41f58746d3346e5238766c86d + DATASource: 49dd4063eeb81657572362eea7e3aa9b3d921c68 -PODFILE CHECKSUM: eec3b04d52e4f938bd867ed08059dfd5dfca6fbf +PODFILE CHECKSUM: 7d2705294ed1eeb9f4aa86e74dd3aa885ccc81c3 COCOAPODS: 1.0.1 diff --git a/Source/DATAStack.swift b/Source/DATAStack.swift index f237a0b..9c90128 100644 --- a/Source/DATAStack.swift +++ b/Source/DATAStack.swift @@ -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? @@ -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) } @@ -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) @@ -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 diff --git a/Tests/Tests.swift b/Tests/Tests.swift index 8860a2f..a6ccdcd 100755 --- a/Tests/Tests.swift +++ b/Tests/Tests.swift @@ -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)