Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit f0a090d

Browse files
authored
Merge pull request #35 from sjoerdvisscher/master
Swift 4 migration
2 parents 6b33ba5 + 6add2db commit f0a090d

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

CoreDataKit.xcodeproj/project.pbxproj

+23-7
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,17 @@
300300
attributes = {
301301
LastSwiftMigration = 0700;
302302
LastSwiftUpdateCheck = 0700;
303-
LastUpgradeCheck = 0800;
303+
LastUpgradeCheck = 0910;
304304
ORGANIZATIONNAME = "Mathijs Kadijk";
305305
TargetAttributes = {
306306
D5D7C6BB1958B8CF0048B576 = {
307307
CreatedOnToolsVersion = 6.0;
308-
LastSwiftMigration = 0800;
308+
LastSwiftMigration = 0910;
309309
};
310310
D5D7C6C61958B8CF0048B576 = {
311311
CreatedOnToolsVersion = 6.0;
312312
DevelopmentTeam = LC3Y92HQQ3;
313-
LastSwiftMigration = 0800;
313+
LastSwiftMigration = 0910;
314314
ProvisioningStyle = Automatic;
315315
TestTargetID = D5D7C6BB1958B8CF0048B576;
316316
};
@@ -426,14 +426,20 @@
426426
CLANG_CXX_LIBRARY = "libc++";
427427
CLANG_ENABLE_MODULES = YES;
428428
CLANG_ENABLE_OBJC_ARC = YES;
429+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
429430
CLANG_WARN_BOOL_CONVERSION = YES;
431+
CLANG_WARN_COMMA = YES;
430432
CLANG_WARN_CONSTANT_CONVERSION = YES;
431433
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
432434
CLANG_WARN_EMPTY_BODY = YES;
433435
CLANG_WARN_ENUM_CONVERSION = YES;
434436
CLANG_WARN_INFINITE_RECURSION = YES;
435437
CLANG_WARN_INT_CONVERSION = YES;
438+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
439+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
436440
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
441+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
442+
CLANG_WARN_STRICT_PROTOTYPES = YES;
437443
CLANG_WARN_SUSPICIOUS_MOVE = YES;
438444
CLANG_WARN_UNREACHABLE_CODE = YES;
439445
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -476,14 +482,20 @@
476482
CLANG_CXX_LIBRARY = "libc++";
477483
CLANG_ENABLE_MODULES = YES;
478484
CLANG_ENABLE_OBJC_ARC = YES;
485+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
479486
CLANG_WARN_BOOL_CONVERSION = YES;
487+
CLANG_WARN_COMMA = YES;
480488
CLANG_WARN_CONSTANT_CONVERSION = YES;
481489
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
482490
CLANG_WARN_EMPTY_BODY = YES;
483491
CLANG_WARN_ENUM_CONVERSION = YES;
484492
CLANG_WARN_INFINITE_RECURSION = YES;
485493
CLANG_WARN_INT_CONVERSION = YES;
494+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
495+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
486496
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
497+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
498+
CLANG_WARN_STRICT_PROTOTYPES = YES;
487499
CLANG_WARN_SUSPICIOUS_MOVE = YES;
488500
CLANG_WARN_UNREACHABLE_CODE = YES;
489501
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -528,7 +540,8 @@
528540
PRODUCT_NAME = "$(TARGET_NAME)";
529541
SKIP_INSTALL = YES;
530542
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
531-
SWIFT_VERSION = 3.0;
543+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
544+
SWIFT_VERSION = 4.0;
532545
};
533546
name = Debug;
534547
};
@@ -548,7 +561,8 @@
548561
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.${PRODUCT_NAME:rfc1034identifier}";
549562
PRODUCT_NAME = "$(TARGET_NAME)";
550563
SKIP_INSTALL = YES;
551-
SWIFT_VERSION = 3.0;
564+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
565+
SWIFT_VERSION = 4.0;
552566
};
553567
name = Release;
554568
};
@@ -570,7 +584,8 @@
570584
METAL_ENABLE_DEBUG_INFO = YES;
571585
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.${PRODUCT_NAME:rfc1034identifier}";
572586
PRODUCT_NAME = "$(TARGET_NAME)";
573-
SWIFT_VERSION = 3.0;
587+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
588+
SWIFT_VERSION = 4.0;
574589
};
575590
name = Debug;
576591
};
@@ -588,7 +603,8 @@
588603
METAL_ENABLE_DEBUG_INFO = NO;
589604
PRODUCT_BUNDLE_IDENTIFIER = "nl.mathijskadijk.${PRODUCT_NAME:rfc1034identifier}";
590605
PRODUCT_NAME = "$(TARGET_NAME)";
591-
SWIFT_VERSION = 3.0;
606+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
607+
SWIFT_VERSION = 4.0;
592608
};
593609
name = Release;
594610
};

CoreDataKit.xcodeproj/xcshareddata/xcschemes/CoreDataKit.xcscheme

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0910"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,6 +40,7 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
language = ""
4344
shouldUseLaunchSchemeArgsEnv = "YES">
4445
<Testables>
4546
<TestableReference
@@ -69,6 +70,7 @@
6970
buildConfiguration = "Debug"
7071
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7172
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73+
language = ""
7274
launchStyle = "0"
7375
useCustomWorkingDirectory = "NO"
7476
ignoresPersistentStateOnLaunch = "NO"

CoreDataKit/Importing/NSAttributeDescription+Importing.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ extension NSAttributeDescription
5454
fallthrough
5555
case .transformableAttributeType:
5656
fallthrough
57+
case .UUIDAttributeType:
58+
fallthrough
59+
case .URIAttributeType:
60+
fallthrough
5761
case .objectIDAttributeType:
5862
return nil
59-
}
63+
}
6064
}
6165

6266
@available(*, unavailable, renamed: "transform(value:)")

CoreDataKit/NSManagedObjectContext.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ extension NSManagedObjectContext
147147
NotificationCenter.default.addObserver(self, selector: #selector(NSManagedObjectContext.obtainPermanentIDsForInsertedObjectsOnContextWillSave(_:)), name: NSNotification.Name.NSManagedObjectContextWillSave, object: self)
148148
}
149149

150-
func obtainPermanentIDsForInsertedObjectsOnContextWillSave(_ notification: Notification)
150+
@objc func obtainPermanentIDsForInsertedObjectsOnContextWillSave(_ notification: Notification)
151151
{
152152
do {
153153
try obtainPermanentIDsForInsertedObjects()

0 commit comments

Comments
 (0)