diff --git a/Sources/LicenseList/Library.swift b/Sources/LicenseList/Library.swift index 682592a..a7276f5 100644 --- a/Sources/LicenseList/Library.swift +++ b/Sources/LicenseList/Library.swift @@ -7,9 +7,15 @@ import Foundation -public struct Library: Hashable { +public struct Library: Identifiable, Hashable { + public let id: UUID = .init() public let name: String public let licenseBody: String + + public init(name: String, licenseBody: String) { + self.name = name + self.licenseBody = licenseBody + } } extension Library { diff --git a/Sources/LicenseList/LicenseListView.swift b/Sources/LicenseList/LicenseListView.swift index cdbc68a..1956742 100644 --- a/Sources/LicenseList/LicenseListView.swift +++ b/Sources/LicenseList/LicenseListView.swift @@ -31,7 +31,7 @@ public struct LicenseListView: View { public var body: some View { List { - ForEach(libraries, id: \.name) { library in + ForEach(libraries) { library in if useUINavigationController { HStack { libraryButton(library)