Skip to content

Commit

Permalink
Make Library conform to Identifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
koher committed Sep 9, 2023
1 parent 38165b5 commit 2f2173d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Sources/LicenseList/Library.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Sources/LicenseList/LicenseListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2f2173d

Please sign in to comment.