Skip to content

Commit 8108121

Browse files
committed
Updated for Xcode 10 with Swift 4.2.
1 parent e96108d commit 8108121

File tree

8 files changed

+39
-26
lines changed

8 files changed

+39
-26
lines changed

AnimatedCollectionViewLayout.xcodeproj/project.pbxproj

+21-14
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,17 @@
192192
isa = PBXProject;
193193
attributes = {
194194
LastSwiftUpdateCheck = 0810;
195-
LastUpgradeCheck = 0820;
195+
LastUpgradeCheck = 1000;
196196
ORGANIZATIONNAME = Uthoft;
197197
TargetAttributes = {
198198
D9899DC91DF4A091008766B5 = {
199199
CreatedOnToolsVersion = 8.1;
200-
DevelopmentTeam = MG8YZ6JLG6;
201-
LastSwiftMigration = 0810;
200+
LastSwiftMigration = 1000;
202201
ProvisioningStyle = Automatic;
203202
};
204203
D9899DD21DF4A092008766B5 = {
205204
CreatedOnToolsVersion = 8.1;
206-
DevelopmentTeam = MG8YZ6JLG6;
205+
LastSwiftMigration = 1000;
207206
ProvisioningStyle = Automatic;
208207
};
209208
};
@@ -290,15 +289,23 @@
290289
CLANG_CXX_LIBRARY = "libc++";
291290
CLANG_ENABLE_MODULES = YES;
292291
CLANG_ENABLE_OBJC_ARC = YES;
292+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
293293
CLANG_WARN_BOOL_CONVERSION = YES;
294+
CLANG_WARN_COMMA = YES;
294295
CLANG_WARN_CONSTANT_CONVERSION = YES;
296+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
295297
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
296298
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
297299
CLANG_WARN_EMPTY_BODY = YES;
298300
CLANG_WARN_ENUM_CONVERSION = YES;
299301
CLANG_WARN_INFINITE_RECURSION = YES;
300302
CLANG_WARN_INT_CONVERSION = YES;
303+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
304+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
305+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
301306
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
307+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
308+
CLANG_WARN_STRICT_PROTOTYPES = YES;
302309
CLANG_WARN_SUSPICIOUS_MOVE = YES;
303310
CLANG_WARN_SUSPICIOUS_MOVES = YES;
304311
CLANG_WARN_UNREACHABLE_CODE = YES;
@@ -329,6 +336,7 @@
329336
SDKROOT = iphoneos;
330337
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
331338
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
339+
SWIFT_VERSION = 4.2;
332340
TARGETED_DEVICE_FAMILY = "1,2";
333341
VERSIONING_SYSTEM = "apple-generic";
334342
VERSION_INFO_PREFIX = "";
@@ -344,15 +352,23 @@
344352
CLANG_CXX_LIBRARY = "libc++";
345353
CLANG_ENABLE_MODULES = YES;
346354
CLANG_ENABLE_OBJC_ARC = YES;
355+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
347356
CLANG_WARN_BOOL_CONVERSION = YES;
357+
CLANG_WARN_COMMA = YES;
348358
CLANG_WARN_CONSTANT_CONVERSION = YES;
359+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
349360
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
350361
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
351362
CLANG_WARN_EMPTY_BODY = YES;
352363
CLANG_WARN_ENUM_CONVERSION = YES;
353364
CLANG_WARN_INFINITE_RECURSION = YES;
354365
CLANG_WARN_INT_CONVERSION = YES;
366+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
367+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
368+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
355369
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
370+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
371+
CLANG_WARN_STRICT_PROTOTYPES = YES;
356372
CLANG_WARN_SUSPICIOUS_MOVE = YES;
357373
CLANG_WARN_SUSPICIOUS_MOVES = YES;
358374
CLANG_WARN_UNREACHABLE_CODE = YES;
@@ -375,6 +391,7 @@
375391
MTL_ENABLE_DEBUG_INFO = NO;
376392
SDKROOT = iphoneos;
377393
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
394+
SWIFT_VERSION = 4.2;
378395
TARGETED_DEVICE_FAMILY = "1,2";
379396
VALIDATE_PRODUCT = YES;
380397
VERSIONING_SYSTEM = "apple-generic";
@@ -386,9 +403,7 @@
386403
isa = XCBuildConfiguration;
387404
buildSettings = {
388405
CLANG_ENABLE_MODULES = YES;
389-
CODE_SIGN_IDENTITY = "";
390406
DEFINES_MODULE = YES;
391-
DEVELOPMENT_TEAM = MG8YZ6JLG6;
392407
DYLIB_COMPATIBILITY_VERSION = 1;
393408
DYLIB_CURRENT_VERSION = 1;
394409
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -400,17 +415,14 @@
400415
PRODUCT_NAME = "$(TARGET_NAME)";
401416
SKIP_INSTALL = YES;
402417
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
403-
SWIFT_VERSION = 3.0;
404418
};
405419
name = Debug;
406420
};
407421
D9899DE01DF4A093008766B5 /* Release */ = {
408422
isa = XCBuildConfiguration;
409423
buildSettings = {
410424
CLANG_ENABLE_MODULES = YES;
411-
CODE_SIGN_IDENTITY = "";
412425
DEFINES_MODULE = YES;
413-
DEVELOPMENT_TEAM = MG8YZ6JLG6;
414426
DYLIB_COMPATIBILITY_VERSION = 1;
415427
DYLIB_CURRENT_VERSION = 1;
416428
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -421,33 +433,28 @@
421433
PRODUCT_BUNDLE_IDENTIFIER = com.uthoft.AnimatedCollectionViewLayout;
422434
PRODUCT_NAME = "$(TARGET_NAME)";
423435
SKIP_INSTALL = YES;
424-
SWIFT_VERSION = 3.0;
425436
};
426437
name = Release;
427438
};
428439
D9899DE21DF4A093008766B5 /* Debug */ = {
429440
isa = XCBuildConfiguration;
430441
buildSettings = {
431442
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
432-
DEVELOPMENT_TEAM = MG8YZ6JLG6;
433443
INFOPLIST_FILE = Tests/Info.plist;
434444
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
435445
PRODUCT_BUNDLE_IDENTIFIER = com.uthoft.AnimatedCollectionViewLayoutTests;
436446
PRODUCT_NAME = "$(TARGET_NAME)";
437-
SWIFT_VERSION = 3.0;
438447
};
439448
name = Debug;
440449
};
441450
D9899DE31DF4A093008766B5 /* Release */ = {
442451
isa = XCBuildConfiguration;
443452
buildSettings = {
444453
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
445-
DEVELOPMENT_TEAM = MG8YZ6JLG6;
446454
INFOPLIST_FILE = Tests/Info.plist;
447455
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
448456
PRODUCT_BUNDLE_IDENTIFIER = com.uthoft.AnimatedCollectionViewLayoutTests;
449457
PRODUCT_NAME = "$(TARGET_NAME)";
450-
SWIFT_VERSION = 3.0;
451458
};
452459
name = Release;
453460
};

AnimatedCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/AnimatedCollectionViewLayout.xcscheme

+1-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 = "0830"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Source/AnimatedCollectionViewLayout.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class AnimatedCollectionViewLayout: UICollectionViewFlowLayout {
2020

2121
public override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
2222
guard let attributes = super.layoutAttributesForElements(in: rect) else { return nil }
23-
return attributes.flatMap { $0.copy() as? AnimatedCollectionViewLayoutAttributes }.map { self.transformLayoutAttributes($0) }
23+
return attributes.compactMap { $0.copy() as? AnimatedCollectionViewLayoutAttributes }.map { self.transformLayoutAttributes($0) }
2424
}
2525

2626
public override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
@@ -75,7 +75,7 @@ public class AnimatedCollectionViewLayout: UICollectionViewFlowLayout {
7575
/// A custom layout attributes that contains extra information.
7676
public class AnimatedCollectionViewLayoutAttributes: UICollectionViewLayoutAttributes {
7777
public var contentView: UIView?
78-
public var scrollDirection: UICollectionViewScrollDirection = .vertical
78+
public var scrollDirection: UICollectionView.ScrollDirection = .vertical
7979

8080
/// The ratio of the distance between the start of the cell and the start of the collectionView and the height/width of the cell depending on the scrollDirection. It's 0 when the start of the cell aligns the start of the collectionView. It gets positive when the cell moves towards the scrolling direction (right/down) while getting negative when moves opposite.
8181
public var startOffset: CGFloat = 0

iOS Example/Source/AppDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}

iOS Example/Source/ImageCollectionViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extension String {
3030
var int = UInt32()
3131
Scanner(string: hex).scanHexInt32(&int)
3232
let a, r, g, b: UInt32
33-
switch hex.characters.count {
33+
switch hex.count {
3434
case 3: // RGB (12-bit)
3535
(a, r, g, b) = (255, (int >> 8) * 17, (int >> 4 & 0xF) * 17, (int & 0xF) * 17)
3636
case 6: // RGB (24-bit)
@@ -49,7 +49,7 @@ class ImageCollectionViewController: UICollectionViewController {
4949
@IBOutlet var dismissGesture: UISwipeGestureRecognizer!
5050

5151
var animator: (LayoutAttributesAnimator, Bool, Int, Int)?
52-
var direction: UICollectionViewScrollDirection = .horizontal
52+
var direction: UICollectionView.ScrollDirection = .horizontal
5353

5454
let cellIdentifier = "SimpleCollectionViewCell"
5555
let vcs = [("f44336", "nature1"),

iOS Example/iOS Example.xcodeproj/project.pbxproj

+3-5
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
TargetAttributes = {
164164
D9899DF11DF4A53C008766B5 = {
165165
CreatedOnToolsVersion = 8.1;
166-
DevelopmentTeam = MG8YZ6JLG6;
166+
LastSwiftMigration = 1000;
167167
ProvisioningStyle = Automatic;
168168
};
169169
};
@@ -294,6 +294,7 @@
294294
SDKROOT = iphoneos;
295295
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
296296
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
297+
SWIFT_VERSION = 4.2;
297298
TARGETED_DEVICE_FAMILY = "1,2";
298299
};
299300
name = Debug;
@@ -337,6 +338,7 @@
337338
MTL_ENABLE_DEBUG_INFO = NO;
338339
SDKROOT = iphoneos;
339340
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
341+
SWIFT_VERSION = 4.2;
340342
TARGETED_DEVICE_FAMILY = "1,2";
341343
VALIDATE_PRODUCT = YES;
342344
};
@@ -346,27 +348,23 @@
346348
isa = XCBuildConfiguration;
347349
buildSettings = {
348350
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
349-
DEVELOPMENT_TEAM = MG8YZ6JLG6;
350351
INFOPLIST_FILE = Source/Info.plist;
351352
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
352353
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
353354
PRODUCT_BUNDLE_IDENTIFIER = "com.uthoft.iOS-Example";
354355
PRODUCT_NAME = "$(TARGET_NAME)";
355-
SWIFT_VERSION = 3.0;
356356
};
357357
name = Debug;
358358
};
359359
D9899E061DF4A53C008766B5 /* Release */ = {
360360
isa = XCBuildConfiguration;
361361
buildSettings = {
362362
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
363-
DEVELOPMENT_TEAM = MG8YZ6JLG6;
364363
INFOPLIST_FILE = Source/Info.plist;
365364
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
366365
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
367366
PRODUCT_BUNDLE_IDENTIFIER = "com.uthoft.iOS-Example";
368367
PRODUCT_NAME = "$(TARGET_NAME)";
369-
SWIFT_VERSION = 3.0;
370368
};
371369
name = Release;
372370
};

iOS Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme

+1-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 = "0830"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)