From 8b288e81073ecf9f2493572007c148ce8d3b1783 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 16 Feb 2022 23:18:58 -0800 Subject: [PATCH] Update deploy target to iOS 14.0 and other recommended project settings --- .../project.pbxproj | 42 ++++++++++++++++--- .../xcschemes/Earthquakes.xcscheme | 10 ++--- Earthquakes/Earthquakes.entitlements | 2 + Earthquakes/Info.plist | 24 +++++------ Earthquakes/MoreInformationOperation.swift | 4 +- 5 files changed, 57 insertions(+), 25 deletions(-) diff --git a/Advanced NSOperations.xcodeproj/project.pbxproj b/Advanced NSOperations.xcodeproj/project.pbxproj index b4d904f..4ff1888 100644 --- a/Advanced NSOperations.xcodeproj/project.pbxproj +++ b/Advanced NSOperations.xcodeproj/project.pbxproj @@ -56,6 +56,7 @@ 55E702681AFE61700032742F /* Earthquake.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55E702671AFE61700032742F /* Earthquake.swift */; }; 55E7026B1AFE63E70032742F /* DownloadEarthquakesOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55E7026A1AFE63E70032742F /* DownloadEarthquakesOperation.swift */; }; 55E7026D1AFE64D40032742F /* ParseEarthquakesOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55E7026C1AFE64D40032742F /* ParseEarthquakesOperation.swift */; }; + 7B3DD1C727BE2E12005D3B00 /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 551344B91B016CAF004A1569 /* CloudKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -132,6 +133,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 7B3DD1C727BE2E12005D3B00 /* CloudKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -337,11 +339,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 1320; ORGANIZATIONNAME = "Apple, Inc."; TargetAttributes = { 551B9BDC1AEB1C9700302388 = { CreatedOnToolsVersion = 6.3; + DevelopmentTeam = X45WPY5JFZ; SystemCapabilities = { com.apple.iCloud = { enabled = 1; @@ -462,18 +465,31 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 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_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -494,7 +510,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -506,18 +522,31 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 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_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -531,9 +560,10 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; VALIDATE_PRODUCT = YES; }; name = Release; @@ -545,9 +575,10 @@ CODE_SIGN_ENTITLEMENTS = Earthquakes/Earthquakes.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = X45WPY5JFZ; INFOPLIST_FILE = Earthquakes/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "net.samhuri.apple-samplecode.Earthquakes"; PRODUCT_NAME = Earthquakes; PROVISIONING_PROFILE = ""; SWIFT_VERSION = 4.0; @@ -562,9 +593,10 @@ CODE_SIGN_ENTITLEMENTS = Earthquakes/Earthquakes.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = X45WPY5JFZ; INFOPLIST_FILE = Earthquakes/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "net.samhuri.apple-samplecode.Earthquakes"; PRODUCT_NAME = Earthquakes; PROVISIONING_PROFILE = ""; SWIFT_VERSION = 4.0; diff --git a/Advanced NSOperations.xcodeproj/xcshareddata/xcschemes/Earthquakes.xcscheme b/Advanced NSOperations.xcodeproj/xcshareddata/xcschemes/Earthquakes.xcscheme index 99bfee7..b28d33e 100644 --- a/Advanced NSOperations.xcodeproj/xcshareddata/xcschemes/Earthquakes.xcscheme +++ b/Advanced NSOperations.xcodeproj/xcshareddata/xcschemes/Earthquakes.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - + aps-environment + development com.apple.developer.icloud-container-identifiers iCloud.$(CFBundleIdentifier) diff --git a/Earthquakes/Info.plist b/Earthquakes/Info.plist index feb50e9..5b1f2d5 100644 --- a/Earthquakes/Info.plist +++ b/Earthquakes/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -22,6 +22,17 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSExceptionDomains + + earthquake.usgs.gov + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + NSLocationAlwaysUsageDescription Earthquakes uses your location to show how close you are to the epicenter of an earthquake. NSLocationWhenInUseUsageDescription @@ -40,16 +51,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSExceptionDomains - - earthquake.usgs.gov - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - diff --git a/Earthquakes/MoreInformationOperation.swift b/Earthquakes/MoreInformationOperation.swift index 3bf97e0..0723ae9 100644 --- a/Earthquakes/MoreInformationOperation.swift +++ b/Earthquakes/MoreInformationOperation.swift @@ -35,7 +35,9 @@ class MoreInformationOperation: EarthquakeOperation { private func showSafariViewController() { if let context = UIApplication.shared.keyWindow?.rootViewController { - let safari = SFSafariViewController(url: URL, entersReaderIfAvailable: false) + let configuration = SFSafariViewController.Configuration() + configuration.entersReaderIfAvailable = false + let safari = SFSafariViewController(url: URL, configuration: configuration) safari.delegate = self context.present(safari, animated: true, completion: nil) }