Skip to content

Commit 289e0bd

Browse files
committed
Remove thte unused helper code in Example
1 parent 465e5fc commit 289e0bd

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Example/SDWebImageSwiftUIDemo/ContentView.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ import SwiftUI
1010
import SDWebImage
1111
import SDWebImageSwiftUI
1212

13-
// Allows `String` in `ForEach`
14-
extension String : Identifiable {
15-
public typealias ID = Int
16-
public var id: Int {
17-
self.hashValue
18-
}
19-
}
20-
2113
#if os(watchOS)
2214
// watchOS does not provide built-in indicator, use Espera's custom indicator
2315
extension Indicator where T == LoadingFlowerView {
@@ -107,7 +99,7 @@ struct ContentView: View {
10799

108100
func contentView() -> some View {
109101
List {
110-
ForEach(imageURLs) { url in
102+
ForEach(imageURLs, id: \.self) { url in
111103
NavigationLink(destination: DetailView(url: url, animated: self.animated)) {
112104
HStack {
113105
if self.animated {

0 commit comments

Comments
 (0)