Skip to content

Commit acd8937

Browse files
committed
Cleanup
1 parent 1a67b96 commit acd8937

File tree

4 files changed

+22
-23
lines changed

4 files changed

+22
-23
lines changed

FFCoreData/FFCoreData Tests/FFCoreDataTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
//
2020

2121
import XCTest
22+
import CoreData
2223
import FFCoreData
2324

2425
class FFCoreDataTests: XCTestCase {

FFCoreData/FFCoreData.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 48;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -25,7 +25,7 @@
2525
071408771E8001C1004318C9 /* FFCoreData.h in Headers */ = {isa = PBXBuildFile; fileRef = 07876A1B19D41E7000F21E7D /* FFCoreData.h */; settings = {ATTRIBUTES = (Public, ); }; };
2626
073F000C1F99F45700E2708A /* CoreDataDecodable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 073F000B1F99F45700E2708A /* CoreDataDecodable.swift */; };
2727
0788305D1E824C2A00A0F103 /* NSManagedObject+FindAndOrCreate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07A64BF21B2C53480008EFF2 /* NSManagedObject+FindAndOrCreate.swift */; };
28-
07F2F4651FB03E5C0064559C /* FFFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07F2F4661FB03E5C0064559C /* FFFoundation.framework */; };
28+
07F2F4981FB049700064559C /* FFFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07F2F4991FB049700064559C /* FFFoundation.framework */; };
2929
/* End PBXBuildFile section */
3030

3131
/* Begin PBXContainerItemProxy section */
@@ -55,7 +55,7 @@
5555
07A64BF21B2C53480008EFF2 /* NSManagedObject+FindAndOrCreate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+FindAndOrCreate.swift"; sourceTree = "<group>"; };
5656
07AA24371B28037E00FA689B /* CoreDataManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataManager.swift; sourceTree = "<group>"; };
5757
07AA24391B2A0F0900FA689B /* FetchedResulsControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchedResulsControllerDelegate.swift; sourceTree = "<group>"; };
58-
07F2F4661FB03E5C0064559C /* FFFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FFFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
58+
07F2F4991FB049700064559C /* FFFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FFFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5959
07F82FDC1DAA7ADA00DBCBAA /* FFCoreDataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FFCoreDataTests.swift; sourceTree = "<group>"; };
6060
07F82FDD1DAA7ADA00DBCBAA /* TestEntity+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TestEntity+CoreDataProperties.swift"; sourceTree = "<group>"; };
6161
07F82FDE1DAA7ADA00DBCBAA /* TestEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestEntity.swift; sourceTree = "<group>"; };
@@ -67,7 +67,7 @@
6767
isa = PBXFrameworksBuildPhase;
6868
buildActionMask = 2147483647;
6969
files = (
70-
07F2F4651FB03E5C0064559C /* FFFoundation.framework in Frameworks */,
70+
07F2F4981FB049700064559C /* FFFoundation.framework in Frameworks */,
7171
);
7272
runOnlyForDeploymentPostprocessing = 0;
7373
};
@@ -181,7 +181,7 @@
181181
07F2F4641FB03E5C0064559C /* Frameworks */ = {
182182
isa = PBXGroup;
183183
children = (
184-
07F2F4661FB03E5C0064559C /* FFFoundation.framework */,
184+
07F2F4991FB049700064559C /* FFFoundation.framework */,
185185
);
186186
name = Frameworks;
187187
sourceTree = "<group>";
@@ -269,7 +269,7 @@
269269
};
270270
};
271271
buildConfigurationList = 07876A1019D41E7000F21E7D /* Build configuration list for PBXProject "FFCoreData" */;
272-
compatibilityVersion = "Xcode 3.2";
272+
compatibilityVersion = "Xcode 8.0";
273273
developmentRegion = English;
274274
hasScannedForEncodings = 0;
275275
knownRegions = (

FFCoreData/FFCoreData/CoreDataManager.swift

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,28 +139,26 @@ public struct CoreDataStack {
139139
}
140140
private static let manager = CoreDataManager(configuration: configuration)
141141

142-
public static let mainContext = CoreDataStack.manager.managedObjectContext
142+
public static let mainContext = manager.managedObjectContext
143143

144-
public static func save(context: NSManagedObjectContext, rollback: Bool = true, completion: @escaping (Bool) -> Void = {_ in}) {
145-
context.performAndWait {
146-
CoreDataStack.manager.save(context: context, rollback: rollback, completion: completion)
147-
}
144+
public static func save(context: NSManagedObjectContext, rollback: Bool = true, completion: @escaping (Bool) -> () = { _ in }) {
145+
context.sync { manager.save(context: context, rollback: rollback, completion: completion) }
148146
}
149147

150-
public static func saveMainContext(rollback: Bool = true, completion: @escaping (Bool) -> Void = {_ in}) {
151-
CoreDataStack.save(context: CoreDataStack.mainContext, rollback: rollback, completion: completion)
148+
public static func saveMainContext(rollback: Bool = true, completion: @escaping (Bool) -> () = { _ in }) {
149+
save(context: mainContext, rollback: rollback, completion: completion)
152150
}
153151

154152
public static func createTemporaryMainContext() -> NSManagedObjectContext {
155-
return CoreDataStack.manager.createTemporaryMainContext()
153+
return manager.createTemporaryMainContext()
156154
}
157155

158156
public static func createTemporaryBackgroundContext() -> NSManagedObjectContext {
159-
return CoreDataStack.manager.createTemporaryBackgroundContext()
157+
return manager.createTemporaryBackgroundContext()
160158
}
161159

162160
public static func clearDataStore() throws {
163-
try CoreDataStack.manager.clearDataStore()
161+
try manager.clearDataStore()
164162
}
165163
}
166164

@@ -215,15 +213,15 @@ extension CoreDataStack {
215213
}
216214
#endif
217215

218-
private static let InfoDictionaryTargetDisplayNameKey = "CFBundleDisplayName"
219-
private static let InfoDictionaryTargetNameKey = String(kCFBundleNameKey)
220-
private static let DefaultTargetName = "UNKNOWN_TARGET_NAME"
216+
private static let infoDictionaryTargetDisplayNameKey = "CFBundleDisplayName"
217+
private static let infoDictionaryTargetNameKey = String(kCFBundleNameKey)
218+
private static let defaultTargetName = "UNKNOWN_TARGET_NAME"
221219

222220
private init(bundle: Bundle, modelName: String?, sqliteName: String?, storePath: URL?, appSupportFolderName: String?, removeNamespaces: Bool) {
223221
func targetName(from bundle: Bundle) -> String {
224-
guard let infoDict = bundle.infoDictionary else { return Configuration.DefaultTargetName }
225-
let name = infoDict[Configuration.InfoDictionaryTargetDisplayNameKey] ?? infoDict[Configuration.InfoDictionaryTargetNameKey]
226-
return (name as? String) ?? Configuration.DefaultTargetName
222+
guard let infoDict = bundle.infoDictionary else { return Configuration.defaultTargetName }
223+
let name = infoDict[Configuration.infoDictionaryTargetDisplayNameKey] ?? infoDict[Configuration.infoDictionaryTargetNameKey]
224+
return (name as? String) ?? Configuration.defaultTargetName
227225
}
228226

229227
self.bundle = bundle

FFCoreData/FFCoreData/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.0.0</string>
18+
<string>3.1.3</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)