From 773102be3cc49e4ed3f62136e0006d9bedd21788 Mon Sep 17 00:00:00 2001 From: Dustin Lange <> Date: Sun, 26 May 2019 20:45:23 -0400 Subject: [PATCH] Upgraded project to support Swift 5 --- Example/ViewController.swift | 3 +++ ImageViewer/AnimatableImageView.swift | 2 ++ SimpleImageViewer.xcodeproj/project.pbxproj | 24 +++++++++++-------- .../xcschemes/SimpleImageViewer.xcscheme | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Example/ViewController.swift b/Example/ViewController.swift index ccdc911..54b66be 100644 --- a/Example/ViewController.swift +++ b/Example/ViewController.swift @@ -89,6 +89,9 @@ private extension UIView.ContentMode { return "bottomLeft" case .bottomRight: return "bottomRight" + @unknown default: + assertionFailure("Unsupported UIView.ContentMode value!") + return "" } } } diff --git a/ImageViewer/AnimatableImageView.swift b/ImageViewer/AnimatableImageView.swift index 26901ca..7d7ef52 100644 --- a/ImageViewer/AnimatableImageView.swift +++ b/ImageViewer/AnimatableImageView.swift @@ -74,6 +74,8 @@ private extension AnimatableImageView { case .bottomRight: imageView.bounds = Utilities.rect(forSize: image.size) imageView.center = Utilities.bottomRight(forSize: image.size, insideSize: bounds.size) + @unknown default: + assertionFailure("Unsupported UIView.ContentMode value!") } } } diff --git a/SimpleImageViewer.xcodeproj/project.pbxproj b/SimpleImageViewer.xcodeproj/project.pbxproj index a918b3c..6e5014c 100644 --- a/SimpleImageViewer.xcodeproj/project.pbxproj +++ b/SimpleImageViewer.xcodeproj/project.pbxproj @@ -281,7 +281,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = aFrogleap; TargetAttributes = { A02EE5D31EF1897D000EAB41 = { @@ -292,19 +292,19 @@ A07E76D21ECC94A400B77D46 = { CreatedOnToolsVersion = 8.3.2; DevelopmentTeam = 44MAY72KU6; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; A0BF70A61EDC5B1400109F6E = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; }; }; buildConfigurationList = A07E76CE1ECC94A400B77D46 /* Build configuration list for PBXProject "SimpleImageViewer" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -437,6 +437,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -447,6 +448,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -454,6 +456,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -494,6 +497,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -504,6 +508,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -511,6 +516,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -554,8 +560,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = "d5b8f7cb-0120-427a-9ff1-14d28ee0046f"; PROVISIONING_PROFILE_SPECIFIER = "aFrogleap Wildcard Development"; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -571,8 +576,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.afrogleapbv.inhouse.swift.imageviewer; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -594,7 +598,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -618,7 +622,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; diff --git a/SimpleImageViewer.xcodeproj/xcshareddata/xcschemes/SimpleImageViewer.xcscheme b/SimpleImageViewer.xcodeproj/xcshareddata/xcschemes/SimpleImageViewer.xcscheme index bf75f27..b92f041 100644 --- a/SimpleImageViewer.xcodeproj/xcshareddata/xcschemes/SimpleImageViewer.xcscheme +++ b/SimpleImageViewer.xcodeproj/xcshareddata/xcschemes/SimpleImageViewer.xcscheme @@ -1,6 +1,6 @@