diff --git a/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index e0035e60..6cfecc16 100644 --- a/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,12 +1,13 @@ { + "originHash" : "5b4b29c1d60c84b81b9ecde166ab224a4e4d4068063e21db2aae21b52f89aacd", "pins" : [ { "identity" : "kingfisher", "kind" : "remoteSourceControl", "location" : "https://github.com/onevcat/Kingfisher.git", "state" : { - "revision" : "5b92f029fab2cce44386d28588098b5be0824ef5", - "version" : "7.11.0" + "revision" : "3340001633525fd68c53d3a359e3c118797ad08e", + "version" : "8.0.2" } }, { @@ -28,5 +29,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Package.resolved b/Package.resolved index e0035e60..ee4c4516 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/onevcat/Kingfisher.git", "state" : { - "revision" : "5b92f029fab2cce44386d28588098b5be0824ef5", - "version" : "7.11.0" + "revision" : "3340001633525fd68c53d3a359e3c118797ad08e", + "version" : "8.0.2" } }, { diff --git a/Package.swift b/Package.swift index 58e8b4f9..15059247 100644 --- a/Package.swift +++ b/Package.swift @@ -20,7 +20,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/onevcat/Kingfisher.git", from: "7.12.0"), + .package(url: "https://github.com/onevcat/Kingfisher.git", from: "8.0.2"), .package(url: "https://github.com/EnesKaraosman/SwiftUIEKtensions.git", from: "0.4.0"), .package(url: "https://github.com/dkk/WrappingHStack.git", from: "2.2.11") ], diff --git a/Sources/SwiftyChat/MessageViews/ImageMessageView.swift b/Sources/SwiftyChat/MessageViews/ImageMessageView.swift index fbcdfe74..87cdb8d7 100644 --- a/Sources/SwiftyChat/MessageViews/ImageMessageView.swift +++ b/Sources/SwiftyChat/MessageViews/ImageMessageView.swift @@ -33,6 +33,7 @@ struct ImageLoadingKindCell: View { imageView } + @MainActor @ViewBuilder private var imageView: some View { switch imageLoadingType { @@ -53,6 +54,7 @@ struct ImageLoadingKindCell: View { .frame(width: width, height: height) } + @MainActor private func remoteImage(url: URL) -> some View { KFAnimatedImage(url) .cacheOriginalImage() diff --git a/Sources/SwiftyChatMock/MessageMocker.swift b/Sources/SwiftyChatMock/MessageMocker.swift index 32093d28..492afc92 100644 --- a/Sources/SwiftyChatMock/MessageMocker.swift +++ b/Sources/SwiftyChatMock/MessageMocker.swift @@ -23,15 +23,20 @@ public struct MessageMocker { case video case custom } + + private static func avatarUrl(_ id: Int) -> URL? { + let string = "https://github.com/radically-straightforward/radically-straightforward/blob/main/examples/avatars/png/\(id).png?raw=true" + return URL(string: string) + } public static var sender: ChatUserItem = .init( userName: "Sender", - avatarURL: URL(string: "https://leafac.github.io/fake-avatars/avatars/png/\(Int.random(in: 1...250)).png") + avatarURL: avatarUrl(Int.random(in: 1...250)) ) public static var chatbot: ChatUserItem = .init( userName: "Chatbot", - avatarURL: URL(string: "https://leafac.github.io/fake-avatars/avatars/png/\(Int.random(in: 1...250)).png") + avatarURL: avatarUrl(Int.random(in: 1...250)) ) private static var randomUser: ChatUserItem {