From b4f79956ceec77a06a5bc0a184085a3746b07155 Mon Sep 17 00:00:00 2001 From: Jon Shier Date: Fri, 20 Mar 2020 10:20:58 -0400 Subject: [PATCH 1/2] Update to Swift 5.1, version to 2.0. --- .ruby-gemset | 1 + .ruby-version | 1 + .swiftlint.yml | 78 ++++++++++++++--- .travis.yml | 5 +- Example/Example.xcodeproj/project.pbxproj | 14 +-- .../xcshareddata/xcschemes/Example.xcscheme | 10 +-- Example/Example/Info.plist | 2 +- Gemfile | 3 + Gemfile.lock | 85 +++++++++++++------ LICENSE | 0 LaunchGate.podspec | 6 +- LaunchGate.xcodeproj/project.pbxproj | 33 ++++--- .../xcschemes/LaunchGate.xcscheme | 28 +++--- Podfile | 17 ++-- Podfile.lock | 18 ++-- Source/AlertConfiguration.swift | 4 +- Source/DialogManager.swift | 20 ++--- Source/Info.plist | 2 +- Source/LaunchGate.swift | 6 +- Source/Memory.swift | 4 +- Source/Rememberable.swift | 2 +- Source/UpdateConfiguration.swift | 4 +- 22 files changed, 214 insertions(+), 129 deletions(-) create mode 100644 .ruby-gemset create mode 100644 .ruby-version mode change 100755 => 100644 Gemfile mode change 100755 => 100644 Gemfile.lock mode change 100755 => 100644 LICENSE mode change 100755 => 100644 LaunchGate.xcodeproj/project.pbxproj mode change 100755 => 100644 Podfile diff --git a/.ruby-gemset b/.ruby-gemset new file mode 100644 index 0000000..bff8e24 --- /dev/null +++ b/.ruby-gemset @@ -0,0 +1 @@ +launchgate diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..24ba9a3 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.0 diff --git a/.swiftlint.yml b/.swiftlint.yml index d5dee53..0a9e9c3 100755 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,13 +1,69 @@ -disabled_rules: # rule identifiers to exclude from running - - valid_docs - # Find all the available rules by running: - # swiftlint rules -included: # paths to include during linting. `--path` is ignored if present. +enabled_rules: + - anyobject_protocol + - array_init + - contains_over_filter_count + - contains_over_filter_is_empty + - contains_over_first_not_nil + - contains_over_range_nil_comparison + - convenience_type + - discouraged_object_literal + - discouraged_optional_boolean + - empty_collection_literal + - empty_count + - empty_string + - empty_xctest_method + - enum_case_associated_values_count + - explicit_init + - fallthrough + - fatal_error_message + - file_name_no_space + - first_where + - flatmap_over_map_reduce + - function_default_parameter_at_end + - identical_operands + - implicit_return + - joined_default_parameter + - last_where + - legacy_multiple + - legacy_random + - let_var_whitespace + - literal_expression_end_indentation + - lower_acl_than_parent + - multiline_parameters + - nslocalizedstring_key + - number_separator + - operator_usage_whitespace + - optional_enum_case_matching + - overridden_super_call + - override_in_extension + - pattern_matching_keywords + - prefer_self_type_over_type_of_self + - private_action + - prohibited_super_call + - reduce_into + - redundant_nil_coalescing + - redundant_type_annotation + - sorted_first_last + - strong_iboutlet + - toggle_bool + - trailing_closure + - unavailable_function + - unused_declaration + - unused_import + - xct_specific_matcher + +included: - Source -# parameterized rules can be customized from this configuration file -line_length: 120 -# parameterized rules are first parameterized as a warning level, then error level. +excluded: + - Pods + type_body_length: - - 300 # warning - - 400 # error -# reporter: "csv" # reporter type (xcode, json, csv, checkstyle) + warning: 300 # warning + error: 400 # error +line_length: + warning: 120 + error: 500 +number_separator: + minimum_length: 5 + +reporter: "xcode" diff --git a/.travis.yml b/.travis.yml index ddb2b06..0102848 100755 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ branches: - develop - master language: swift -osx_image: xcode9.4 +osx_image: xcode11.3 notifications: slack: rooms: @@ -20,12 +20,11 @@ before_install: - bundle update - brew update - brew install swiftlint || true - - pod repo update - pod install after_success: - slather - bash <(curl -s https://codecov.io/bash) -f cobertura.xml script: - set -o pipefail - - xcodebuild clean test -workspace LaunchGate.xcworkspace -scheme LaunchGate -destination 'platform=iOS Simulator,name=iPhone 6s' ONLY_ACTIVE_ARCH=YES | xcpretty + - xcodebuild clean test -workspace LaunchGate.xcworkspace -scheme LaunchGate -destination 'platform=iOS Simulator,name=iPhone 11 Pro' ONLY_ACTIVE_ARCH=YES | xcpretty - swiftlint diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index f01ae38..ce08540 100755 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -134,7 +134,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1130; ORGANIZATIONNAME = "Dan Trenz"; TargetAttributes = { C5A878881C6A7A95004599C2 = { @@ -145,7 +145,7 @@ }; buildConfigurationList = C5A878841C6A7A95004599C2 /* Build configuration list for PBXProject "Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -233,6 +233,7 @@ 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; @@ -275,7 +276,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -287,6 +288,7 @@ 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; @@ -323,7 +325,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -336,8 +338,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.dtrenz.Example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.0; @@ -349,8 +351,8 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.dtrenz.Example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.0; diff --git a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index 5ee307a..eae8267 100755 --- a/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +++ b/Example/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -1,6 +1,6 @@ - - - - + + - - CFBundlePackageType APPL CFBundleShortVersionString - 0.1 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion diff --git a/Gemfile b/Gemfile old mode 100755 new mode 100644 index 59f3a1a..0575391 --- a/Gemfile +++ b/Gemfile @@ -1,2 +1,5 @@ source 'https://rubygems.org' + gem "cocoapods" +gem "slather" +gem "xcpretty" diff --git a/Gemfile.lock b/Gemfile.lock old mode 100755 new mode 100644 index 6deb312..2017c2b --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,76 +1,105 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.0) - activesupport (4.2.10) + CFPropertyList (3.0.2) + activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - atomos (0.1.2) - claide (1.0.2) - cocoapods (1.5.3) + algoliasearch (1.27.1) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + claide (1.0.3) + clamp (1.3.1) + cocoapods (1.9.1) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.5.3) - cocoapods-deintegrate (>= 1.0.2, < 2.0) - cocoapods-downloader (>= 1.2.0, < 2.0) + cocoapods-core (= 1.9.1) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.3.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) - fourflusher (~> 2.0.1) + fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) - molinillo (~> 0.6.5) + molinillo (~> 0.6.6) nap (~> 1.0) - ruby-macho (~> 1.1) - xcodeproj (>= 1.5.7, < 2.0) - cocoapods-core (1.5.3) + ruby-macho (~> 1.4) + xcodeproj (>= 1.14.0, < 2.0) + cocoapods-core (1.9.1) activesupport (>= 4.0.2, < 6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.2) - cocoapods-downloader (1.2.1) + netrc (~> 0.11) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.4) + cocoapods-downloader (1.3.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) - cocoapods-stats (1.0.0) - cocoapods-trunk (1.3.0) + cocoapods-stats (1.1.0) + cocoapods-trunk (1.4.1) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.1.0) colored2 (3.1.2) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.6) escape (0.0.4) - fourflusher (2.0.1) + ethon (0.12.0) + ffi (>= 1.3.0) + ffi (1.12.2) + fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) + httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - minitest (5.11.3) - molinillo (0.6.5) + json (2.3.0) + mini_portile2 (2.4.0) + minitest (5.14.0) + molinillo (0.6.6) nanaimo (0.2.6) nap (1.1.0) netrc (0.11.0) - ruby-macho (1.2.0) + nokogiri (1.10.9) + mini_portile2 (~> 2.4.0) + rouge (2.0.7) + ruby-macho (1.4.0) + slather (2.4.7) + CFPropertyList (>= 2.2, < 4) + activesupport (>= 4.0.2, < 5) + clamp (~> 1.3) + nokogiri (~> 1.8) + xcodeproj (~> 1.7) thread_safe (0.3.6) - tzinfo (1.2.5) + typhoeus (1.3.1) + ethon (>= 0.9.0) + tzinfo (1.2.6) thread_safe (~> 0.1) - xcodeproj (1.5.9) + xcodeproj (1.15.0) CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.2) + atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.5) + nanaimo (~> 0.2.6) + xcpretty (0.3.0) + rouge (~> 2.0.7) PLATFORMS ruby DEPENDENCIES cocoapods + slather + xcpretty BUNDLED WITH - 1.16.1 + 2.1.2 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/LaunchGate.podspec b/LaunchGate.podspec index 657ddfd..640710c 100755 --- a/LaunchGate.podspec +++ b/LaunchGate.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LaunchGate" - s.version = "1.1.1" + s.version = "2.0.0" s.summary = <<-SUMMARY LaunchGate makes it easy to let users know when an update to your app is available. SUMMARY @@ -23,9 +23,9 @@ Pod::Spec.new do |s| s.author = { "Dan Trenz" => "dtrenz@gmail.com" } s.source = { :git => "https://github.com/dtrenz/LaunchGate.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/dtrenz' - s.platform = :ios, '8.3' + s.platform = :ios, '10.0' s.requires_arc = true s.source_files = 'Source/**/*.swift' s.frameworks = 'UIKit' - s.swift_version = '4.1' + s.swift_version = '5.1' end diff --git a/LaunchGate.xcodeproj/project.pbxproj b/LaunchGate.xcodeproj/project.pbxproj old mode 100755 new mode 100644 index cb94d3e..b4212a4 --- a/LaunchGate.xcodeproj/project.pbxproj +++ b/LaunchGate.xcodeproj/project.pbxproj @@ -173,7 +173,9 @@ 39450C4F88D2BC32572653A7 /* Pods */, 6AFB87098F7DCE3A54F40A49 /* Frameworks */, ); + indentWidth = 2; sourceTree = ""; + tabWidth = 2; }; C5C04BC71C696767007397D0 /* Products */ = { isa = PBXGroup; @@ -279,25 +281,26 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1130; ORGANIZATIONNAME = "Dan Trenz"; TargetAttributes = { C5C04BC51C696767007397D0 = { CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0940; + LastSwiftMigration = 1130; }; C5C04BCF1C696767007397D0 = { CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0940; + LastSwiftMigration = 1130; }; }; }; buildConfigurationList = C5C04BC01C696767007397D0 /* Build configuration list for PBXProject "LaunchGate" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = C5C04BBC1C696767007397D0; productRefGroup = C5C04BC71C696767007397D0 /* Products */; @@ -361,7 +364,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-LaunchGateTests/Pods-LaunchGateTests-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-LaunchGateTests/Pods-LaunchGateTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", ); @@ -372,7 +375,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LaunchGateTests/Pods-LaunchGateTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LaunchGateTests/Pods-LaunchGateTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; C5B85B4E1C6A862E00B007CD /* Swiftlint */ = { @@ -387,7 +390,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\""; + shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n"; }; C76D564ED9E289949248D7A9 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; @@ -456,6 +459,7 @@ 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; @@ -499,7 +503,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -514,6 +518,7 @@ 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; @@ -551,7 +556,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -575,11 +580,12 @@ INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.dtrenz.LaunchGate; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -596,10 +602,11 @@ INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.dtrenz.LaunchGate; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -611,7 +618,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.dtrenz.LaunchGateTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -623,7 +630,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.dtrenz.LaunchGateTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/LaunchGate.xcodeproj/xcshareddata/xcschemes/LaunchGate.xcscheme b/LaunchGate.xcodeproj/xcshareddata/xcschemes/LaunchGate.xcscheme index 8693ead..3228841 100755 --- a/LaunchGate.xcodeproj/xcshareddata/xcschemes/LaunchGate.xcscheme +++ b/LaunchGate.xcodeproj/xcshareddata/xcschemes/LaunchGate.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + @@ -40,17 +49,6 @@ - - - - - - - - String { - return "LAST_ALERT" + "LAST_ALERT" } func rememberString() -> String { - return self.message + self.message } } diff --git a/Source/DialogManager.swift b/Source/DialogManager.swift index ea68953..fcd86f0 100755 --- a/Source/DialogManager.swift +++ b/Source/DialogManager.swift @@ -81,27 +81,27 @@ class DialogManager { } func topViewController() -> UIViewController? { - return UIApplication.shared.keyWindow?.rootViewController + UIApplication.shared.keyWindow?.rootViewController } // MARK: Custom Alert Actions private func dismissActon() -> UIAlertAction { - return UIAlertAction( + UIAlertAction( title: NSLocalizedString("Dismiss", comment: "Button title for dismissing the update AlertView"), style: .default) { _ in } } private func updateAction(_ updateURL: URL) -> UIAlertAction { - return UIAlertAction( - title: NSLocalizedString("Update", comment: "Button title for accepting the update AlertView"), - style: .default) { (_) -> Void in - if UIApplication.shared.canOpenURL(updateURL) { - DispatchQueue.main.async { [] in - UIApplication.shared.openURL(updateURL) - } - } + UIAlertAction( + title: NSLocalizedString("Update", comment: "Button title for accepting the update AlertView"), + style: .default) { _ in + if UIApplication.shared.canOpenURL(updateURL) { + DispatchQueue.main.async { + UIApplication.shared.open(updateURL, options: [:], completionHandler: nil) + } } + } } } diff --git a/Source/Info.plist b/Source/Info.plist index 9645e5d..ca23c84 100755 --- a/Source/Info.plist +++ b/Source/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.2 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion diff --git a/Source/LaunchGate.swift b/Source/LaunchGate.swift index e2337a6..365f4ef 100755 --- a/Source/LaunchGate.swift +++ b/Source/LaunchGate.swift @@ -100,7 +100,7 @@ public class LaunchGate { - Returns: `true`, if an alert dialog should be displayed; `false`, if not. */ func shouldShowAlertDialog(_ alertConfig: AlertConfiguration) -> Bool { - return alertConfig.blocking || alertConfig.isNotRemembered() + alertConfig.blocking || alertConfig.isNotRemembered() } /** @@ -124,11 +124,11 @@ public class LaunchGate { - Returns: `true`, if a required update dialog should be displayed; `false`, if not. */ func shouldShowRequiredUpdateDialog(_ updateConfig: UpdateConfiguration, appVersion: String) -> Bool { - return appVersion < updateConfig.version + appVersion < updateConfig.version } func currentAppVersion() -> String? { - return Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String + Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String } } diff --git a/Source/Memory.swift b/Source/Memory.swift index dfd0779..2bb7865 100755 --- a/Source/Memory.swift +++ b/Source/Memory.swift @@ -8,7 +8,7 @@ import Foundation -struct Memory { +enum Memory { static let userPrefs = UserDefaults.standard @@ -21,7 +21,7 @@ struct Memory { } static func contains(_ item: Rememberable) -> Bool { - return userPrefs.object(forKey: item.rememberKey()) as? String == item.rememberString() + userPrefs.object(forKey: item.rememberKey()) as? String == item.rememberString() } } diff --git a/Source/Rememberable.swift b/Source/Rememberable.swift index 7fc20ba..7c6e2e5 100755 --- a/Source/Rememberable.swift +++ b/Source/Rememberable.swift @@ -16,7 +16,7 @@ protocol Rememberable { extension Rememberable { func isNotRemembered() -> Bool { - return !Memory.contains(self) + !Memory.contains(self) } } diff --git a/Source/UpdateConfiguration.swift b/Source/UpdateConfiguration.swift index de4088a..5f360c4 100755 --- a/Source/UpdateConfiguration.swift +++ b/Source/UpdateConfiguration.swift @@ -24,11 +24,11 @@ public struct UpdateConfiguration: Dialogable, Rememberable { // MARK: Rememberable Protocol Methods func rememberKey() -> String { - return "OPTIONAL_UPDATE" + "OPTIONAL_UPDATE" } func rememberString() -> String { - return self.version + self.version } } From 64053642cee19aa69cc925239417a16579e424f5 Mon Sep 17 00:00:00 2001 From: Jon Shier Date: Fri, 20 Mar 2020 10:32:06 -0400 Subject: [PATCH 2/2] Update Travis config to not install gems manually. --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0102848..d0c1e21 100755 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,6 @@ notifications: before_install: - rvm use $RVM_RUBY_VERSION - bundle install - - gem install xcpretty -N - - gem install slather - - bundle update - brew update - brew install swiftlint || true - pod install