Skip to content

Commit

Permalink
LicenseList has ended support for iOS 13.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyome22 committed Nov 22, 2023
1 parent 101ffe8 commit b593522
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 42 deletions.
4 changes: 0 additions & 4 deletions LicenseDemo/LicenseDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription
let package = Package(
name: "LicenseList",
platforms: [
.iOS(.v13)
.iOS(.v14)
],
products: [
.executable(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/LicenseList/LegacyLicenseView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Sources/LicenseList/LicenseListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public struct LicenseListView: View {
}
}
}
.listStyleInsetGroupedIfPossible()
.listStyle(.insetGrouped)
}

@ViewBuilder
Expand Down
38 changes: 4 additions & 34 deletions Sources/LicenseList/View+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<S>(_ 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")
})
}
}
}
}
Expand Down

0 comments on commit b593522

Please sign in to comment.