From b593522407146fae3894d0521086b1bf613e2a5f Mon Sep 17 00:00:00 2001 From: "Takuto NAKAMURA (Kyome)" Date: Wed, 22 Nov 2023 15:35:32 +0900 Subject: [PATCH] LicenseList has ended support for iOS 13. --- .../LicenseDemo.xcodeproj/project.pbxproj | 4 -- Package.swift | 2 +- README.md | 2 +- Sources/LicenseList/LegacyLicenseView.swift | 2 +- Sources/LicenseList/LicenseListView.swift | 2 +- Sources/LicenseList/View+Extensions.swift | 38 ++----------------- 6 files changed, 8 insertions(+), 42 deletions(-) diff --git a/LicenseDemo/LicenseDemo.xcodeproj/project.pbxproj b/LicenseDemo/LicenseDemo.xcodeproj/project.pbxproj index c41da84..26a7cfb 100644 --- a/LicenseDemo/LicenseDemo.xcodeproj/project.pbxproj +++ b/LicenseDemo/LicenseDemo.xcodeproj/project.pbxproj @@ -420,7 +420,6 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -450,7 +449,6 @@ INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -481,7 +479,6 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -512,7 +509,6 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Package.swift b/Package.swift index eaae33c..c5d6dce 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,7 @@ import PackageDescription let package = Package( name: "LicenseList", platforms: [ - .iOS(.v13) + .iOS(.v14) ], products: [ .executable( diff --git a/README.md b/README.md index a572a3d..4ef3d61 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Generate a list of licenses for the Swift Package libraries that your app depend ## Requirements - Written in Swift 5.9 -- Compatible with iOS 13.0+ +- Compatible with iOS 14.0+ - Developement with Xcode 15.0+ ## Installation diff --git a/Sources/LicenseList/LegacyLicenseView.swift b/Sources/LicenseList/LegacyLicenseView.swift index c65dde0..e35dece 100644 --- a/Sources/LicenseList/LegacyLicenseView.swift +++ b/Sources/LicenseList/LegacyLicenseView.swift @@ -53,7 +53,7 @@ public struct LegacyLicenseView: View { .onAppear { lines = resolve(library.licenseBody) } - .navigationBarTitleInlineIfPossible(library.name) + .navigationBarTitle(library.name, displayMode: .inline) ._licenseListViewStyle(licenseListViewStyle) { if let url = library.url { UIApplication.shared.open(url) diff --git a/Sources/LicenseList/LicenseListView.swift b/Sources/LicenseList/LicenseListView.swift index ccea93f..edeb0b8 100644 --- a/Sources/LicenseList/LicenseListView.swift +++ b/Sources/LicenseList/LicenseListView.swift @@ -59,7 +59,7 @@ public struct LicenseListView: View { } } } - .listStyleInsetGroupedIfPossible() + .listStyle(.insetGrouped) } @ViewBuilder diff --git a/Sources/LicenseList/View+Extensions.swift b/Sources/LicenseList/View+Extensions.swift index 79590d2..a082783 100644 --- a/Sources/LicenseList/View+Extensions.swift +++ b/Sources/LicenseList/View+Extensions.swift @@ -8,44 +8,14 @@ import SwiftUI extension View { - func listStyleInsetGroupedIfPossible() -> some View { - Group { - if #available(iOS 14, *) { - self.listStyle(.insetGrouped) - } else { - self.listStyle(.grouped) - } - } - } - - func navigationBarTitleInlineIfPossible(_ title: S) -> some View where S : StringProtocol { - Group { - if #available(iOS 14, *) { - self.navigationBarTitle(title, displayMode: .inline) - } else { - self.navigationBarTitle(title) - } - } - } - func navigationBarRepositoryAnchorLink(action: @escaping () -> Void) -> some View { - Group { - if #available(iOS 14, *) { - self.toolbar { - ToolbarItem(placement: .topBarTrailing) { - Button { - action() - } label: { - Image(systemName: "link") - } - } - } - } else { - self.navigationBarItems(trailing: Button { + self.toolbar { + ToolbarItem(placement: .topBarTrailing) { + Button { action() } label: { Image(systemName: "link") - }) + } } } }