From ee437536ddb5a051e776179f82a345c4734dc499 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:01:19 +0100 Subject: [PATCH 01/10] Add missing Changelog entry for previously merged PR --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c16a66..33f77cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### Fix +- Fix safe area when setting the child VCs directly + ## [1.0.4] ### Fix From 0bacf627d1af1b56e517ec682ff6b913a2cadea2 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:06:58 +0100 Subject: [PATCH 02/10] Use ruby 3.1.2 and update gems --- .ruby-version | 1 + Gemfile | 4 +- Gemfile.lock | 321 ++++++++++++++++++++++++++++++-------------------- Podfile.lock | 2 +- 4 files changed, 200 insertions(+), 128 deletions(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..ef538c2 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.1.2 diff --git a/Gemfile b/Gemfile index 90e27c6..d842a62 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' -ruby '2.6.5' +ruby '3.1.2' -gem 'cocoapods', '1.8.3' +gem 'cocoapods', '1.15.2' gem 'fastlane', '<3.0' plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') diff --git a/Gemfile.lock b/Gemfile.lock index ea5394c..6007aa9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,224 +1,295 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.0) - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.1) + CFPropertyList (3.0.7) + base64 + nkf + rexml + activesupport (7.1.3.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) + artifactory (3.0.15) atomos (0.1.3) - babosa (1.0.3) - claide (1.0.3) - cocoapods (1.8.3) - activesupport (>= 4.0.2, < 5) + aws-eventstream (1.3.0) + aws-partitions (1.895.0) + aws-sdk-core (3.191.3) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.8) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.77.0) + aws-sdk-core (~> 3, >= 3.191.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.143.0) + aws-sdk-core (~> 3, >= 3.191.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + base64 (0.2.0) + bigdecimal (3.1.6) + claide (1.1.0) + cocoapods (1.15.2) + addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.8.3) + cocoapods-core (= 1.15.2) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-downloader (>= 2.1, < 3.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.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) - molinillo (~> 0.6.6) + molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (~> 1.4) - xcodeproj (>= 1.11.1, < 2.0) - cocoapods-core (1.8.3) - activesupport (>= 4.0.2, < 6) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.15.2) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.3.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) cocoapods-plugins (1.0.0) nap - cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.1) + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) - cocoapods-try (1.1.0) + cocoapods-try (1.2.0) colored (1.2) colored2 (3.1.2) - commander-fastlane (4.4.6) - highline (~> 1.7.2) - concurrent-ruby (1.1.5) - declarative (0.0.10) - declarative-option (0.1.0) - digest-crc (0.4.1) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.5) - emoji_regex (1.0.1) + commander (4.6.0) + highline (~> 2.0.0) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + declarative (0.0.20) + digest-crc (0.6.5) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20240107) + dotenv (2.8.1) + drb (2.2.1) + emoji_regex (3.2.3) escape (0.0.4) - excon (0.72.0) - faraday (0.17.3) - multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) + ethon (0.16.0) + ffi (>= 1.15.0) + excon (0.109.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) http-cookie (~> 1.0.0) - faraday_middleware (0.13.1) - faraday (>= 0.7.4, < 1.0) - fastimage (2.1.7) - fastlane (2.140.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.3.0) + fastlane (2.219.0) CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.3, < 3.0.0) - babosa (>= 1.0.2, < 2.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored - commander-fastlane (>= 4.4.6, < 5.0.0) + commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 2.0) + emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) - faraday (~> 0.17) + faraday (~> 1.0) faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 0.13.1) + faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.29.2, < 0.37.0) - google-cloud-storage (>= 1.15.0, < 2.0.0) - highline (>= 1.7.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) json (< 3.0.0) - jwt (~> 2.1.0) + jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multi_xml (~> 0.5) - multipart-post (~> 2.0.0) + multipart-post (>= 2.0.0, < 3.0.0) + naturally (~> 2.2) + optparse (>= 0.1.1) plist (>= 3.1.0, < 4.0.0) - public_suffix (~> 2.0.0) - rubyzip (>= 1.3.0, < 2.0.0) + rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) - slack-notifier (>= 2.0.0, < 3.0.0) terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) + terminal-table (~> 3) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-changelog (0.15.0) + fastlane-plugin-changelog (0.16.0) + ffi (1.16.3) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - google-api-client (0.36.4) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.3) addressable (~> 2.5, >= 2.5.1) - googleauth (~> 0.9) - httpclient (>= 2.8.1, < 3.0) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) mini_mime (~> 1.0) representable (~> 3.0) - retriable (>= 2.0, < 4.0) - signet (~> 0.12) - google-cloud-core (1.5.0) - google-cloud-env (~> 1.0) + retriable (>= 2.0, < 4.a) + rexml + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.31.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.6.1) + google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (1.3.0) - faraday (~> 0.11) - google-cloud-errors (1.0.0) - google-cloud-storage (1.25.1) - addressable (~> 2.5) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.1) + google-cloud-storage (1.47.0) + addressable (~> 2.8) digest-crc (~> 0.4) - google-api-client (~> 0.33) - google-cloud-core (~> 1.2) - googleauth (~> 0.9) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.31.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (0.10.0) - faraday (~> 0.12) + googleauth (1.8.1) + faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) - signet (~> 0.12) - highline (1.7.10) - http-cookie (1.0.3) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (0.9.5) + i18n (1.14.1) concurrent-ruby (~> 1.0) - json (2.3.0) - jwt (2.1.0) - memoist (0.16.2) - mini_magick (4.10.1) - mini_mime (1.0.2) - minitest (5.14.0) - molinillo (0.6.6) - multi_json (1.14.1) - multi_xml (0.6.0) - multipart-post (2.0.0) - nanaimo (0.2.6) + jmespath (1.6.2) + json (2.7.1) + jwt (2.8.1) + base64 + mini_magick (4.12.0) + mini_mime (1.1.5) + minitest (5.22.2) + molinillo (0.8.0) + multi_json (1.15.0) + multipart-post (2.4.0) + mutex_m (0.2.0) + nanaimo (0.3.0) nap (1.1.0) - naturally (2.2.0) + naturally (2.2.1) netrc (0.11.0) - os (1.0.1) - plist (3.5.0) - public_suffix (2.0.5) - representable (3.0.4) + nkf (0.2.0) + optparse (0.4.0) + os (1.1.4) + plist (3.7.1) + public_suffix (4.0.7) + rake (13.1.0) + representable (3.2.0) declarative (< 0.1.0) - declarative-option (< 0.2.0) + trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) + rexml (3.2.6) rouge (2.0.7) - ruby-macho (1.4.0) - rubyzip (1.3.0) + ruby-macho (2.5.1) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) security (0.1.3) - signet (0.12.0) - addressable (~> 2.3) - faraday (~> 0.9) + signet (0.19.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - simctl (1.6.7) + simctl (1.6.10) CFPropertyList naturally - slack-notifier (2.3.2) terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.7.0) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) - tzinfo (1.2.6) - thread_safe (~> 0.1) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.6) - unicode-display_width (1.6.1) + unicode-display_width (2.5.0) word_wrap (1.0.0) - xcodeproj (1.14.0) + xcodeproj (1.24.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) xcpretty (0.3.0) rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.0) + xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.8.3) + cocoapods (= 1.15.2) fastlane (< 3.0) fastlane-plugin-changelog RUBY VERSION - ruby 2.6.5p114 + ruby 3.1.2p20 BUNDLED WITH 2.1.4 diff --git a/Podfile.lock b/Podfile.lock index 963332b..ebcb307 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -29,4 +29,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 680a1e183edb00544c8954221900e5976c9977fe -COCOAPODS: 1.8.3 +COCOAPODS: 1.15.2 From 1b92b2675fc722a3a14967b03152a7a1742c8b20 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:08:43 +0100 Subject: [PATCH 03/10] Drop Support of iOS 11, 12 and 13 --- ADNavigationBarExtension.podspec | 2 +- CHANGELOG.md | 3 +++ NavigationBarExtension.xcodeproj/project.pbxproj | 8 ++------ Podfile | 2 +- Podfile.lock | 4 ++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ADNavigationBarExtension.podspec b/ADNavigationBarExtension.podspec index 3769a1f..dc0b78d 100644 --- a/ADNavigationBarExtension.podspec +++ b/ADNavigationBarExtension.podspec @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.license = { :type => 'MIT', :text => 'Created and licensed by Fabernovel Technologies. Copyright 2014-2018 Fabernovel Technologies. All rights reserved.' } s.source = { :git => 'https://github.com/faberNovel/ADNavigationBarExtension.git', :tag => "v#{s.version}" } - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '14.0' s.swift_versions = ['5.0', '5.1'] s.source_files = 'NavigationBarExtension/Classes/**/*' diff --git a/CHANGELOG.md b/CHANGELOG.md index 33f77cf..17c0d87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ### Fix - Fix safe area when setting the child VCs directly +### Removes +- Drop support of iOS 11, 12 and 13 + ## [1.0.4] ### Fix diff --git a/NavigationBarExtension.xcodeproj/project.pbxproj b/NavigationBarExtension.xcodeproj/project.pbxproj index 192c7d2..0c9ce1c 100644 --- a/NavigationBarExtension.xcodeproj/project.pbxproj +++ b/NavigationBarExtension.xcodeproj/project.pbxproj @@ -453,7 +453,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -499,7 +499,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -515,7 +515,6 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = U5M7X5V6ZG; INFOPLIST_FILE = "$(SRCROOT)/Example/NavigationBarExtension/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 0.1.0; MODULE_NAME = ExampleApp; @@ -535,7 +534,6 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = U5M7X5V6ZG; INFOPLIST_FILE = "$(SRCROOT)/Example/NavigationBarExtension/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 0.1.0; MODULE_NAME = ExampleApp; @@ -560,7 +558,6 @@ "$(inherited)", ); INFOPLIST_FILE = Example/Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -579,7 +576,6 @@ "$(inherited)", ); INFOPLIST_FILE = Example/Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Podfile b/Podfile index 800aec9..1f666e0 100644 --- a/Podfile +++ b/Podfile @@ -1,6 +1,6 @@ use_frameworks! -platform :ios, '11.0' +platform :ios, '14.0' target 'NavigationBarExtension_Example' do pod 'ADNavigationBarExtension', :path => './' diff --git a/Podfile.lock b/Podfile.lock index ebcb307..879eaa6 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -23,10 +23,10 @@ EXTERNAL SOURCES: :path: "./" SPEC CHECKSUMS: - ADNavigationBarExtension: 1a9817d4d1f62af51aaa1b27676f1c8dd5e93d7b + ADNavigationBarExtension: eefbd2ca9443d675af6fc8c768d60f8a6aa12297 ADUtils: 5f5f1ad7a097dcf7104f9c160bc23a30d7943eb8 SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447 -PODFILE CHECKSUM: 680a1e183edb00544c8954221900e5976c9977fe +PODFILE CHECKSUM: 9821677b68ce32317ccfca61c21d82b852e1f7c2 COCOAPODS: 1.15.2 From 91ba8576256973ecd43dcda72bb3b4fe4dd12b47 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:14:19 +0100 Subject: [PATCH 04/10] Update ADUtils to 12+ --- ADNavigationBarExtension.podspec | 2 +- CHANGELOG.md | 3 +++ Podfile | 2 +- Podfile.lock | 18 +++++++++--------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ADNavigationBarExtension.podspec b/ADNavigationBarExtension.podspec index dc0b78d..1ba4718 100644 --- a/ADNavigationBarExtension.podspec +++ b/ADNavigationBarExtension.podspec @@ -21,5 +21,5 @@ Pod::Spec.new do |s| s.source_files = 'NavigationBarExtension/Classes/**/*' s.frameworks = 'UIKit' - s.dependency 'ADUtils', '~> 11.0' + s.dependency 'ADUtils', '~> 12.0' end diff --git a/CHANGELOG.md b/CHANGELOG.md index 17c0d87..27c9441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### Changed +- Bump ADUtils requirements to 12+ + ### Fix - Fix safe area when setting the child VCs directly diff --git a/Podfile b/Podfile index 1f666e0..f7903cf 100644 --- a/Podfile +++ b/Podfile @@ -4,7 +4,7 @@ platform :ios, '14.0' target 'NavigationBarExtension_Example' do pod 'ADNavigationBarExtension', :path => './' - pod 'ADUtils', '~> 11.0' + pod 'ADUtils', '~> 12.0' pod 'SwiftLint', '~> 0.39.1' target 'NavigationBarExtension_Tests' do diff --git a/Podfile.lock b/Podfile.lock index 879eaa6..4a23a0a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,16 +1,16 @@ PODS: - ADNavigationBarExtension (1.0.4): - - ADUtils (~> 11.0) - - ADUtils (11.0.0): - - ADUtils/objc (= 11.0.0) - - ADUtils/objc (11.0.0): + - ADUtils (~> 12.0) + - ADUtils (12.1.1): + - ADUtils/objc (= 12.1.1) + - ADUtils/objc (12.1.1): - ADUtils/Swift - - ADUtils/Swift (11.0.0) + - ADUtils/Swift (12.1.1) - SwiftLint (0.39.2) DEPENDENCIES: - ADNavigationBarExtension (from `./`) - - ADUtils (~> 11.0) + - ADUtils (~> 12.0) - SwiftLint (~> 0.39.1) SPEC REPOS: @@ -23,10 +23,10 @@ EXTERNAL SOURCES: :path: "./" SPEC CHECKSUMS: - ADNavigationBarExtension: eefbd2ca9443d675af6fc8c768d60f8a6aa12297 - ADUtils: 5f5f1ad7a097dcf7104f9c160bc23a30d7943eb8 + ADNavigationBarExtension: 7bb3042ea4375225682979774a787ec760a6e22f + ADUtils: a3e9fdcfe76222dd3abfa4659ad1e8249ed16c95 SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447 -PODFILE CHECKSUM: 9821677b68ce32317ccfca61c21d82b852e1f7c2 +PODFILE CHECKSUM: 98af81ac5f9ec5394a2fd22a954ce79eb216abee COCOAPODS: 1.15.2 From 9077272569014edc3cb6d2a46908945ef3676fe2 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:19:03 +0100 Subject: [PATCH 05/10] Update CI/CD scripts --- .github/workflows/cd.yml | 10 +++++----- .github/workflows/ci.yml | 21 ++++++--------------- fastlane/Fastfile | 2 +- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8046952..abe7cd2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -11,13 +11,13 @@ jobs: runs-on: macOS-latest steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v3 + - name: Bundle install + uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.5 + bundler: "Gemfile.lock" + bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Bundle install - run: bundle install - name: Publish release env: GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cfe3a9..d685579 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,24 +11,15 @@ jobs: runs-on: macOS-latest steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@v3 + - name: Bundle install + uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.5 + bundler: "Gemfile.lock" + bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Ruby cache - uses: actions/cache@v1 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - name: Bundle install - run: | - bundle config path vendor/bundle - bundle check || bundle install - name: Pods cache - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: Pods key: ${{ runner.os }}-cocoapods-${{ hashFiles('**/Podfile.lock') }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 6e4d641..d2b7478 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -5,7 +5,7 @@ lane :tests do configuration: "Debug", scheme: "NavigationBarExtension-Example", clean: true, - devices: ["iPhone 8"] + devices: ["iPhone SE (3rd generation)"] ) end From a488c72f3a00ebf569524b4f4dfed68aec3499f5 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:34:21 +0100 Subject: [PATCH 06/10] Update SwiftLint --- .swiftlint.yml | 122 ++++++++++++++++++++++++++++++++++++++----------- Podfile | 2 +- Podfile.lock | 8 ++-- 3 files changed, 101 insertions(+), 31 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index aed3ed7..ff979c6 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,21 +1,27 @@ disabled_rules: # rule identifiers to exclude from running + # - blanket_disable_command # - block_based_kvo # - class_delegate_protocol # - closing_brace # - closure_parameter_position # - colon # - comma + # - comment_spacing # - compiler_protocol_init + # - computed_accessors_order # - control_statement + # - custom_rules # - cyclomatic_complexity - # - discarded_notification_center_observer + # - deployment_target # - discouraged_direct_init + # - duplicate_conditions + # - duplicate_enum_cases # - duplicate_imports + # - duplicated_key_in_dictionary_literal # - dynamic_inline # - empty_enum_arguments # - empty_parameters # - empty_parentheses_with_trailing_closure - # - fallthrough # - file_length # - for_where # - force_cast @@ -25,31 +31,41 @@ disabled_rules: # rule identifiers to exclude from running # - generic_type_name # - identifier_name # - implicit_getter - # - inert_defer + # - inclusive_language + # - invalid_swiftlint_command # - is_disjoint # - large_tuple # - leading_whitespace # - legacy_cggeometry_functions # - legacy_constant # - legacy_constructor - # - legacy_nsgeometry_functions # - legacy_hashing + # - legacy_nsgeometry_functions + # - legacy_random # - line_length # - mark # - multiple_closures_with_trailing_closure # - nesting - no_fallthrough_only + # - no_space_in_method_call # - notification_center_detachment + # - ns_number_init_as_function_reference + # - nsobject_prefer_isequal # - opening_brace # - operator_whitespace + # - orphaned_doc_comment # - private_over_fileprivate # - private_unit_test # - protocol_property_accessors_order + # - reduce_boolean # - redundant_discardable_let + # - redundant_objc_attribute # - redundant_optional_initialization + # - redundant_set_access_control # - redundant_string_enum_value # - redundant_void_return # - return_arrow_whitespace + # - self_in_property_initialization # - shorthand_operator # - statement_position # - superfluous_disable_command @@ -62,7 +78,10 @@ disabled_rules: # rule identifiers to exclude from running # - trailing_whitespace # - type_body_length # - type_name + # - unavailable_condition # - unneeded_break_in_switch + # - unneeded_override + # - unneeded_synthesized_initializer # - unused_closure_parameter # - unused_control_flow_label # - unused_enumerated @@ -71,47 +90,69 @@ disabled_rules: # rule identifiers to exclude from running # - valid_ibinspectable # - vertical_parameter_alignment # - vertical_whitespace + # - void_function_in_ternary # - void_return - # - weak_delegate # - xctfail_message opt_in_rules: - - anyobject_protocol + - accessibility_label_for_image + - accessibility_trait_for_button + # - anonymous_argument_in_multiline_closure + - array_init # - attributes + # - balanced_xctest_lifecycle - closure_body_length - closure_end_indentation - closure_spacing - collection_alignment + - comma_inheritance # - conditional_returns_on_newline + - contains_over_filter_count + - contains_over_filter_is_empty - contains_over_first_not_nil + - contains_over_range_nil_comparison - convenience_type + # - direct_return + - discarded_notification_center_observer + - discouraged_assert + - discouraged_none_name - discouraged_object_literal - discouraged_optional_boolean - discouraged_optional_collection + - empty_collection_literal - empty_count - empty_string - empty_xctest_method + - enum_case_associated_values_count + # - expiring_todo # - explicit_acl # - explicit_enum_raw_value - explicit_init - # - explicit_self # - explicit_top_level_acl # - explicit_type_interface # - extension_access_modifier + - fallthrough - fatal_error_message # - file_header # - file_name + - file_name_no_space + # - file_types_order - first_where + - flatmap_over_map_reduce - force_unwrapping # - function_default_parameter_at_end + - ibinspectable_in_extension - identical_operands # - implicit_return - implicitly_unwrapped_optional + # - indentation_width # - joined_default_parameter - last_where - - legacy_random + - legacy_multiple + - legacy_objc_type # - let_var_whitespace - literal_expression_end_indentation + - local_doc_comment - lower_acl_than_parent # - missing_docs - modifier_order @@ -121,50 +162,81 @@ opt_in_rules: - multiline_literal_brackets - multiline_parameters # - multiline_parameters_brackets + # - nimble_operator # - no_extension_access_modifier # - no_grouping_extension + # - no_magic_numbers + - non_overridable_class_declaration # - nslocalizedstring_key + # - nslocalizedstring_require_bundle # - number_separator # - object_literal - operator_usage_whitespace + - optional_enum_case_matching - overridden_super_call - override_in_extension - pattern_matching_keywords + # - prefer_nimble + - prefer_self_in_static_references + - prefer_self_type_over_type_of_self + - prefer_zero_over_explicit_init # - prefixed_toplevel_constant - private_action - private_outlet + - private_subject + - private_swiftui_state # - prohibited_interface_builder # - prohibited_super_call - quick_discouraged_call - quick_discouraged_focused_test - quick_discouraged_pending_test + # - raw_value_for_camel_cased_codable_enum + - reduce_into - redundant_nil_coalescing - redundant_objc_attribute - - redundant_set_access_control - redundant_type_annotation + # - required_deinit # - required_enum_case + - return_value_from_void_function + - self_binding + - shorthand_optional_binding - single_test_class + # - sorted_enum_cases - sorted_first_last # - sorted_imports - static_operator # - strict_fileprivate - strong_iboutlet + - superfluous_else - switch_case_on_newline + # - test_case_accessibility - toggle_bool # - trailing_closure + # - type_contents_order - unavailable_function + - unhandled_throwing_task # - unneeded_parentheses_in_closure_argument + - unowned_variable_capture - untyped_error_in_catch - - unused_import - - unused_private_declaration - vertical_parameter_alignment_on_call # - vertical_whitespace_between_cases # - vertical_whitespace_closing_braces # Waiting for https://github.com/realm/SwiftLint/issues/2322 # - vertical_whitespace_opening_braces # Waiting for https://github.com/realm/SwiftLint/issues/2322 + - weak_delegate - xct_specific_matcher - yoda_condition +analyzer_rules: + - capture_variable + # - explicit_self + - typesafe_array_init + - unused_declaration + - unused_import + # rule configuration +closure_body_length: + warning: 20 + error: 35 cyclomatic_complexity: warning: 10 error: 20 @@ -173,9 +245,11 @@ force_try: warning function_body_length: warning: 35 error: 50 -closure_body_length: - warning: 20 - error: 35 +deployment_target: + iOS_deployment_target: 15 + # macOS_deployment_target: + # watchOS_deployment_target: + # tvOS_deployment_target: identifier_name: min_length: warning: 0 @@ -183,10 +257,11 @@ identifier_name: max_length: warning: 100 error: 200 - allowed_symbols: '_' + allowed_symbols: "_" line_length: warning: 120 error: 160 + ignores_urls: true type_name: min_length: warning: 0 @@ -194,6 +269,10 @@ type_name: max_length: warning: 100 error: 200 +nesting: + type_level: 2 +multiline_arguments: + only_enforce_after_first_closure_on_first_line: true custom_rules: double_space: @@ -214,18 +293,9 @@ custom_rules: regex: '((assert|precondition)\(false)' message: "Use assertionFailure() or preconditionFailure() instead." severity: warning - comments_space: - name: "Space After Comment" - regex: '(^ *//(?!(MARK|TODO))\w+)' - message: "There should be a space after //" - severity: warning - uppercamelcased_enum: - name: "Enum in UpperCamelCase" - regex: '(?:enum) [a-z0-9]' - message: "Enum names should be in UpperCamelCase" - severity: warning excluded: # paths to ignore during linting. Takes precedence over `included`. - Carthage - Pods - + - vendor + - Packages diff --git a/Podfile b/Podfile index f7903cf..724ad31 100644 --- a/Podfile +++ b/Podfile @@ -5,7 +5,7 @@ platform :ios, '14.0' target 'NavigationBarExtension_Example' do pod 'ADNavigationBarExtension', :path => './' pod 'ADUtils', '~> 12.0' - pod 'SwiftLint', '~> 0.39.1' + pod 'SwiftLint', '~> 0.53.0' target 'NavigationBarExtension_Tests' do inherit! :search_paths diff --git a/Podfile.lock b/Podfile.lock index 4a23a0a..d6c2555 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -6,12 +6,12 @@ PODS: - ADUtils/objc (12.1.1): - ADUtils/Swift - ADUtils/Swift (12.1.1) - - SwiftLint (0.39.2) + - SwiftLint (0.53.0) DEPENDENCIES: - ADNavigationBarExtension (from `./`) - ADUtils (~> 12.0) - - SwiftLint (~> 0.39.1) + - SwiftLint (~> 0.53.0) SPEC REPOS: trunk: @@ -25,8 +25,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: ADNavigationBarExtension: 7bb3042ea4375225682979774a787ec760a6e22f ADUtils: a3e9fdcfe76222dd3abfa4659ad1e8249ed16c95 - SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447 + SwiftLint: 5ce4d6a8ff83f1b5fd5ad5dbf30965d35af65e44 -PODFILE CHECKSUM: 98af81ac5f9ec5394a2fd22a954ce79eb216abee +PODFILE CHECKSUM: d2c620f3dd81343aaa949a2b35abe6e6ba788184 COCOAPODS: 1.15.2 From 82b2b00ee3cd22237851589c06f13104af2c9e5b Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:34:31 +0100 Subject: [PATCH 07/10] Add SwiftLint build phase --- .../project.pbxproj | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/NavigationBarExtension.xcodeproj/project.pbxproj b/NavigationBarExtension.xcodeproj/project.pbxproj index 0c9ce1c..a80c10b 100644 --- a/NavigationBarExtension.xcodeproj/project.pbxproj +++ b/NavigationBarExtension.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -196,6 +196,7 @@ buildPhases = ( 2791622B06362A6507B006C9 /* [CP] Check Pods Manifest.lock */, 607FACCC1AFB9204008FA782 /* Sources */, + AC88E9EC2B9611ED0073F85B /* SwiftLint */, 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, 3DDDF70962B4934782466AD9 /* [CP] Embed Pods Frameworks */, @@ -336,6 +337,26 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NavigationBarExtension_Example/Pods-NavigationBarExtension_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + AC88E9EC2B9611ED0073F85B /* SwiftLint */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = SwiftLint; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n\n"; + showEnvVarsInLog = 0; + }; EB67672EA378BB5EF4ABA0DD /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -502,7 +523,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -515,7 +537,10 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = U5M7X5V6ZG; INFOPLIST_FILE = "$(SRCROOT)/Example/NavigationBarExtension/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MARKETING_VERSION = 0.1.0; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "com.applidium.NavigationBarExtension-Example"; @@ -534,7 +559,10 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = U5M7X5V6ZG; INFOPLIST_FILE = "$(SRCROOT)/Example/NavigationBarExtension/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MARKETING_VERSION = 0.1.0; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "com.applidium.NavigationBarExtension-Example"; @@ -558,7 +586,11 @@ "$(inherited)", ); INFOPLIST_FILE = Example/Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; @@ -576,7 +608,11 @@ "$(inherited)", ); INFOPLIST_FILE = Example/Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; From 61b58bc380d07bf55154168d90b9c4efc8378b59 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:40:26 +0100 Subject: [PATCH 08/10] Fix Swiftlint warnings --- .../NavigationBarExtension/AppDelegate.swift | 27 +++---- .../Step2ViewController.swift | 6 +- .../SwitchExtensionTableViewController.swift | 1 + .../ViewController.swift | 11 --- Example/Tests/Tests.swift | 18 ----- ...bleNavigationBarNavigationController.swift | 74 +++++++++---------- .../Classes/UIToolbar+Appearance.swift | 24 +++--- 7 files changed, 59 insertions(+), 102 deletions(-) diff --git a/Example/NavigationBarExtension/AppDelegate.swift b/Example/NavigationBarExtension/AppDelegate.swift index c890bad..3502a81 100644 --- a/Example/NavigationBarExtension/AppDelegate.swift +++ b/Example/NavigationBarExtension/AppDelegate.swift @@ -17,6 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // swiftlint:disable:previous discouraged_optional_collection setUpAppearance() let window = UIWindow(frame: UIScreen.main.bounds) self.window = window @@ -38,20 +39,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate { UINavigationBar .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) .tintColor = UIColor.purple - if #available(iOS 13, *) { - let appearance = UINavigationBarAppearance() - appearance.configureWithDefaultBackground() - UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .standardAppearance = appearance - UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .compactAppearance = appearance - UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .scrollEdgeAppearance = appearance - } else { - ExtensibleNavigationBarNavigationController.ad_isTranslucent = false - } + let appearance = UINavigationBarAppearance() + appearance.configureWithDefaultBackground() + UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .standardAppearance = appearance + UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .compactAppearance = appearance + UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .scrollEdgeAppearance = appearance } } diff --git a/Example/NavigationBarExtension/Step2ViewController.swift b/Example/NavigationBarExtension/Step2ViewController.swift index f23ab35..5ac3b7e 100644 --- a/Example/NavigationBarExtension/Step2ViewController.swift +++ b/Example/NavigationBarExtension/Step2ViewController.swift @@ -44,11 +44,7 @@ class Step2ViewController: UIViewController, UITableViewDataSource, UITableViewD } func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - if section.isMultiple(of: 2) { - return "Country" - } else { - return "Region" - } + return section.isMultiple(of: 2) ? "Country" : "Region" } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { diff --git a/Example/NavigationBarExtension/SwitchExtensionTableViewController.swift b/Example/NavigationBarExtension/SwitchExtensionTableViewController.swift index 7e16f0c..60fc94b 100644 --- a/Example/NavigationBarExtension/SwitchExtensionTableViewController.swift +++ b/Example/NavigationBarExtension/SwitchExtensionTableViewController.swift @@ -19,6 +19,7 @@ class SwitchExtensionTableViewController: UIViewController { super.init(nibName: nil, bundle: nil) } + @available(*, unavailable) required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } diff --git a/Example/NavigationBarExtension/ViewController.swift b/Example/NavigationBarExtension/ViewController.swift index ad80583..cc295ff 100644 --- a/Example/NavigationBarExtension/ViewController.swift +++ b/Example/NavigationBarExtension/ViewController.swift @@ -9,15 +9,4 @@ import UIKit class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - } diff --git a/Example/Tests/Tests.swift b/Example/Tests/Tests.swift index 5d9750d..2d72580 100644 --- a/Example/Tests/Tests.swift +++ b/Example/Tests/Tests.swift @@ -2,26 +2,8 @@ import XCTest import ADNavigationBarExtension class Tests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } } diff --git a/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift b/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift index fe8d1fe..09c6a60 100644 --- a/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift +++ b/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift @@ -10,8 +10,7 @@ public class ExtensibleNavigationBarNavigationController: UINavigationController // ?!!! (Samuel Gallet) 29/01/2020 isTranslucent property does not work with iOS 12. Use this property // to set isTranslucent to the custom navigationBar with iOS 12 @available(iOS, deprecated: 13.0, message: "Use appearance instead of this property") - // swiftlint:disable:next identifier_name - public static var ad_isTranslucent: Bool = true + public static var ad_isTranslucent = true public private(set) var navigationBarToolbar: UIToolbar? public private(set) var navigationBarExtensionToolbar: UIToolbar? @@ -60,6 +59,7 @@ public class ExtensibleNavigationBarNavigationController: UINavigationController // MARK: - NSObject + // swiftlint:disable:next implicitly_unwrapped_optional override public func responds(to aSelector: Selector!) -> Bool { if shouldForwardSelector(aSelector) { return navigationControllerDelegate?.responds(to: aSelector) ?? false @@ -67,6 +67,7 @@ public class ExtensibleNavigationBarNavigationController: UINavigationController return super.responds(to: aSelector) } + // swiftlint:disable:next implicitly_unwrapped_optional override public func forwardingTarget(for aSelector: Selector!) -> Any? { if shouldForwardSelector(aSelector) { return navigationControllerDelegate @@ -78,7 +79,7 @@ public class ExtensibleNavigationBarNavigationController: UINavigationController public func setNavigationBarExtensionView(_ view: UIView?, forHeight height: CGFloat = 0) { navBarExtensionView?.removeFromSuperview() - guard let view = view else { + guard let view else { self.navBarExtensionView = nil navigationBarAdditionalSize = height updateShadowImage() @@ -183,6 +184,7 @@ public class ExtensibleNavigationBarNavigationController: UINavigationController return view } + // swiftlint:disable:next implicitly_unwrapped_optional private func shouldForwardSelector(_ aSelector: Selector!) -> Bool { let description = protocol_getMethodDescription(UINavigationControllerDelegate.self, aSelector, false, true) return @@ -197,42 +199,38 @@ public class ExtensibleNavigationBarNavigationController: UINavigationController private func updateShadowImage() { let needsToShowExtension = self.needsToShowExtension(for: topViewController) - if #available(iOS 13, *) { - let compactNavigationBarAppearance = UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .compactAppearance - let scrollEdgeNavigationBarAppearance = UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .scrollEdgeAppearance - let standardNavigationBarAppearance: UINavigationBarAppearance? = UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .standardAppearance - var color = needsToShowExtension - ? nil - : standardNavigationBarAppearance?.shadowColor - if let standardNavigationBarAppearance = standardNavigationBarAppearance { - navigationBar.standardAppearance = UINavigationBarAppearance( - barAppearance: standardNavigationBarAppearance - ) - navigationBar.standardAppearance.shadowColor = color - } - color = needsToShowExtension - ? nil - : scrollEdgeNavigationBarAppearance?.shadowColor - navigationBar.scrollEdgeAppearance = scrollEdgeNavigationBarAppearance.map { - UINavigationBarAppearance(barAppearance: $0) - } - navigationBar.scrollEdgeAppearance?.shadowColor = color - color = needsToShowExtension - ? nil - : compactNavigationBarAppearance?.shadowColor - navigationBar.compactAppearance = compactNavigationBarAppearance.map { - UINavigationBarAppearance(barAppearance: $0) - } - navigationBar.compactAppearance?.shadowColor = color - } else { - navigationBar.shadowImage = needsToShowExtension ? UIImage() : nil + let compactNavigationBarAppearance = UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .compactAppearance + let scrollEdgeNavigationBarAppearance = UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .scrollEdgeAppearance + let standardNavigationBarAppearance: UINavigationBarAppearance? = UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .standardAppearance + var color = needsToShowExtension + ? nil + : standardNavigationBarAppearance?.shadowColor + if let standardNavigationBarAppearance { + navigationBar.standardAppearance = UINavigationBarAppearance( + barAppearance: standardNavigationBarAppearance + ) + navigationBar.standardAppearance.shadowColor = color + } + color = needsToShowExtension + ? nil + : scrollEdgeNavigationBarAppearance?.shadowColor + navigationBar.scrollEdgeAppearance = scrollEdgeNavigationBarAppearance.map { + UINavigationBarAppearance(barAppearance: $0) + } + navigationBar.scrollEdgeAppearance?.shadowColor = color + color = needsToShowExtension + ? nil + : compactNavigationBarAppearance?.shadowColor + navigationBar.compactAppearance = compactNavigationBarAppearance.map { + UINavigationBarAppearance(barAppearance: $0) } + navigationBar.compactAppearance?.shadowColor = color } private func resetExtensionContainerBottomConstraint() { diff --git a/NavigationBarExtension/Classes/UIToolbar+Appearance.swift b/NavigationBarExtension/Classes/UIToolbar+Appearance.swift index 7e7719d..8ef10f4 100644 --- a/NavigationBarExtension/Classes/UIToolbar+Appearance.swift +++ b/NavigationBarExtension/Classes/UIToolbar+Appearance.swift @@ -17,21 +17,15 @@ extension UIToolbar { .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) .barTintColor isTranslucent = ExtensibleNavigationBarNavigationController.ad_isTranslucent - if #available(iOS 13, *) { - let compactNavigationBarAppearance = UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .compactAppearance - compactAppearance = compactNavigationBarAppearance.map { UIToolbarAppearance(barAppearance: $0) } - let standardNavigationBarAppearance: UINavigationBarAppearance? = UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .standardAppearance - if let appearance = standardNavigationBarAppearance { - standardAppearance = UIToolbarAppearance(barAppearance: appearance) - } - } else { - backgroundColor = UINavigationBar - .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) - .backgroundColor + let compactNavigationBarAppearance = UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .compactAppearance + compactAppearance = compactNavigationBarAppearance.map { UIToolbarAppearance(barAppearance: $0) } + let standardNavigationBarAppearance: UINavigationBarAppearance? = UINavigationBar + .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) + .standardAppearance + if let appearance = standardNavigationBarAppearance { + standardAppearance = UIToolbarAppearance(barAppearance: appearance) } } } From c85989a7479d14aad33d2d7f88dcf03d73a3baf8 Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:46:45 +0100 Subject: [PATCH 09/10] Update homepage in podspec --- ADNavigationBarExtension.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ADNavigationBarExtension.podspec b/ADNavigationBarExtension.podspec index 1ba4718..34a2216 100644 --- a/ADNavigationBarExtension.podspec +++ b/ADNavigationBarExtension.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.name = 'ADNavigationBarExtension' s.version = '1.0.4' s.author = 'Fabernovel Technologies' - s.homepage = 'https://technologies.fabernovel.com/' + s.homepage = 'https://fabernovel.com/' s.summary = 'ADNavigationBarExtension is a UI library written in Swift to show and hide an extension to your UINavigationBar' s.license = { :type => 'MIT', :text => 'Created and licensed by Fabernovel Technologies. Copyright 2014-2018 Fabernovel Technologies. All rights reserved.' } s.source = { :git => 'https://github.com/faberNovel/ADNavigationBarExtension.git', :tag => "v#{s.version}" } From ddb99da0bdacf6605282ce67fea336c2b02841db Mon Sep 17 00:00:00 2001 From: Alexandre Podlewski Date: Mon, 4 Mar 2024 15:49:01 +0100 Subject: [PATCH 10/10] Remove workaround for iOS 12 The deprecation caused warnings in the pod lint --- CHANGELOG.md | 3 ++- .../ExtensibleNavigationBarNavigationController.swift | 5 ----- NavigationBarExtension/Classes/UIToolbar+Appearance.swift | 1 - README.md | 8 -------- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27c9441..9ce55fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ ### Fix - Fix safe area when setting the child VCs directly -### Removes +### Removed - Drop support of iOS 11, 12 and 13 +- Remove workaround property `ad_isTranslucent`, use `UINavigationBar.appearance().isTranslucent` instead. ## [1.0.4] diff --git a/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift b/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift index 09c6a60..ce3f2c3 100644 --- a/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift +++ b/NavigationBarExtension/Classes/ExtensibleNavigationBarNavigationController.swift @@ -7,11 +7,6 @@ public protocol ExtensibleNavigationBarInformationProvider { public class ExtensibleNavigationBarNavigationController: UINavigationController { - // ?!!! (Samuel Gallet) 29/01/2020 isTranslucent property does not work with iOS 12. Use this property - // to set isTranslucent to the custom navigationBar with iOS 12 - @available(iOS, deprecated: 13.0, message: "Use appearance instead of this property") - public static var ad_isTranslucent = true - public private(set) var navigationBarToolbar: UIToolbar? public private(set) var navigationBarExtensionToolbar: UIToolbar? diff --git a/NavigationBarExtension/Classes/UIToolbar+Appearance.swift b/NavigationBarExtension/Classes/UIToolbar+Appearance.swift index 8ef10f4..eeb2938 100644 --- a/NavigationBarExtension/Classes/UIToolbar+Appearance.swift +++ b/NavigationBarExtension/Classes/UIToolbar+Appearance.swift @@ -16,7 +16,6 @@ extension UIToolbar { barTintColor = UINavigationBar .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) .barTintColor - isTranslucent = ExtensibleNavigationBarNavigationController.ad_isTranslucent let compactNavigationBarAppearance = UINavigationBar .appearance(whenContainedInInstancesOf: [ExtensibleNavigationBarNavigationController.self]) .compactAppearance diff --git a/README.md b/README.md index b812bf8..b1dc918 100644 --- a/README.md +++ b/README.md @@ -86,14 +86,6 @@ let navigationController = ExtensibleNavigationBarNavigationController() navigationController.navigationControllerDelegate = self ``` -There is an issue with iOS 12 where the `isTranslucent` property cannot be retrieved from the -`UINavigationBar.appearance()` method. -So if you need to set your UINavigationBar translucent, you can use this: - -```swift -ExtensibleNavigationBarNavigationController.ad_isTranslucent = true -``` - ## Credits ADNavigationBarExtension is owned and maintained by [Fabernovel](https://fabernovel.com/). You can follow us on Twitter at [@FabernovelApp](https://twitter.com/fabernovelapp).