Skip to content

Commit

Permalink
Merge branch 'main' of github.com:vtourraine/AcknowList
Browse files Browse the repository at this point in the history
  • Loading branch information
vtourraine committed Jun 12, 2024
2 parents 819d4af + 9ec7464 commit 0144297
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
7 changes: 4 additions & 3 deletions AcknowList.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AcknowList",
"version": "3.1.0",
"version": "3.2.0",
"summary": "Acknowledgements screen displaying a list of licenses, for example from CocoaPods and Swift Package Manager dependencies.",
"homepage": "https://github.com/vtourraine/AcknowList",
"license": {
Expand All @@ -12,7 +12,7 @@
},
"source": {
"git": "https://github.com/vtourraine/AcknowList.git",
"tag": "3.1.0"
"tag": "3.2.0"
},
"source_files": "Sources/AcknowList/*.swift",
"osx": {
Expand All @@ -28,7 +28,8 @@
"ios": "13.0",
"tvos": "13.0",
"watchos": "7.0",
"osx": "10.15"
"osx": "10.15",
"visionos": "1.0"
},
"swift_version": "5.0"
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 3.2.0 (11 June 2024)

- Add visionOS support


## 3.1.0 (25 January 2024)

- Add `GitHubAPI` to get licenses from GitHub API
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Acknowledgements screen displaying a list of licenses, for example from [CocoaPods](https://cocoapods.org) and [Swift Package Manager](https://swift.org/package-manager/) dependencies.

![Platform iOS tvOS watchOS macOS](https://img.shields.io/cocoapods/p/AcknowList.svg)
![Platform iOS tvOS watchOS macOS visionOS](https://img.shields.io/cocoapods/p/AcknowList.svg)
[![Build & Test](https://github.com/vtourraine/AcknowList/actions/workflows/ios.yml/badge.svg)](https://github.com/vtourraine/AcknowList/actions/workflows/ios.yml)
![Swift 5](https://img.shields.io/badge/Swift-5-blue.svg)
![Swift Package Manager](https://img.shields.io/badge/support-Swift_Package_Manager-orange.svg)
Expand Down Expand Up @@ -110,6 +110,7 @@ Instantiate a `AcknowListSwiftUIView` with a path to the `plist` file, or with a
|:--|:--|:--|
| 📱 | iOS 9.0+ | iOS 13.0+ |
| 📺 | tvOS 9.0+ | tvOS 13.0+ |
| 🥽 | visionOS 1.0+ | visionOS 1.0+ |
| ⌚️ | *not supported* | watchOS 7.0+ |
| 💻 | *not supported* | macOS 10.15+ |

Expand Down
6 changes: 3 additions & 3 deletions Sources/AcknowList/AcknowListSwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension Acknow: Identifiable {
}

/// View that displays a list of acknowledgements.
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, *)
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, visionOS 1.0.0, *)
public struct AcknowListSwiftUIView: View {

/// The represented array of `Acknow`.
Expand Down Expand Up @@ -111,7 +111,7 @@ public struct AcknowListSwiftUIView: View {
}

/// View that displays a row in a list of acknowledgements.
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, *)
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, visionOS 1.0.0, *)
public struct AcknowListRowSwiftUIView: View {

/// The represented `Acknow`.
Expand Down Expand Up @@ -159,7 +159,7 @@ public struct AcknowListRowSwiftUIView: View {
}
}

@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, *)
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, visionOS 1.0.0, *)
struct AcknowListSwiftUI_Previews: PreviewProvider {
static let license = """
Copyright (c) 2015-2024 Vincent Tourraine (https://www.vtourraine.net)
Expand Down
16 changes: 10 additions & 6 deletions Sources/AcknowList/AcknowListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@

import Foundation

#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
import UIKit
#endif

#if os(iOS)
#if os(iOS) || os(visionOS)
import SafariServices
#endif

#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
/// Subclass of `UITableViewController` that displays a list of acknowledgements.
@available(iOS 9.0.0, tvOS 9.0.0, *)
@available(iOS 9.0.0, tvOS 9.0.0, visionOS 1.0.0, *)
@available(iOSApplicationExtension, unavailable)
open class AcknowListViewController: UITableViewController {

Expand Down Expand Up @@ -135,6 +135,7 @@ open class AcknowListViewController: UITableViewController {

// MARK: - View life cycle

#if !os(visionOS)
/// Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.
override open func awakeFromNib() {
super.awakeFromNib()
Expand All @@ -149,6 +150,7 @@ open class AcknowListViewController: UITableViewController {
configure(with: defaultAcknowList)
}
}
#endif

/// Called after the controller's view is loaded into memory.
open override func viewDidLoad() {
Expand Down Expand Up @@ -449,12 +451,14 @@ open class AcknowListViewController: UITableViewController {
}

private func openRepository(_ repository: URL) {
#if !os(tvOS)
if canOpenRepository(repository) {
#if os(visionOS)
UIApplication.shared.open(repository)
#elseif !os(tvOS)
let safariViewController = SFSafariViewController(url: repository)
present(safariViewController, animated: true)
}
#endif
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/AcknowList/AcknowSwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import SwiftUI

/// View that displays a single acknowledgement.
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, *)
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, visionOS 1.0.0, *)
public struct AcknowSwiftUIView: View {

/// The represented acknowledgement.
Expand Down Expand Up @@ -75,7 +75,7 @@ public struct AcknowSwiftUIView: View {
}
}

@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, *)
@available(iOS 13.0.0, macOS 10.15.0, watchOS 7.0.0, tvOS 13.0.0, visionOS 1.0.0, *)
struct AcknowSwiftUI_Previews: PreviewProvider {
static let license = """
Copyright (c) 2015-2024 Vincent Tourraine (https://www.vtourraine.net)
Expand Down
4 changes: 2 additions & 2 deletions Sources/AcknowList/AcknowViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
import UIKit

/// Subclass of `UIViewController` that displays a single acknowledgement.
@available(iOS 9.0.0, tvOS 9.0.0, *)
@available(iOS 9.0.0, tvOS 9.0.0, visionOS 1.0.0, *)
open class AcknowViewController: UIViewController {

/// The main text view.
Expand Down

0 comments on commit 0144297

Please sign in to comment.