From 2ba09192c2ba5ef11f4b7e382ad8af81e4a258af Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Fri, 9 Aug 2019 18:06:47 +0800 Subject: [PATCH] Update to the latest Xcode 11-beta5 syntax of SwiftUI --- SDWebImageSwiftUI/Classes/AnimatedImage.swift | 4 ++-- SDWebImageSwiftUI/Classes/ImageManager.swift | 2 +- SDWebImageSwiftUI/Classes/WebImage.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SDWebImageSwiftUI/Classes/AnimatedImage.swift b/SDWebImageSwiftUI/Classes/AnimatedImage.swift index 0cea458..f68107c 100644 --- a/SDWebImageSwiftUI/Classes/AnimatedImage.swift +++ b/SDWebImageSwiftUI/Classes/AnimatedImage.swift @@ -16,7 +16,7 @@ public struct AnimatedImage: ViewRepresentable { var name: String? var bundle: Bundle? var data: Data? - var scale: Length = 0 + var scale: CGFloat = 0 #if os(macOS) public typealias NSViewType = SDAnimatedImageView @@ -74,7 +74,7 @@ public struct AnimatedImage: ViewRepresentable { self.bundle = bundle } - public init(data: Data, scale: Length = 0) { + public init(data: Data, scale: CGFloat = 0) { self.data = data self.scale = scale } diff --git a/SDWebImageSwiftUI/Classes/ImageManager.swift b/SDWebImageSwiftUI/Classes/ImageManager.swift index 9ce0a28..efad3a4 100644 --- a/SDWebImageSwiftUI/Classes/ImageManager.swift +++ b/SDWebImageSwiftUI/Classes/ImageManager.swift @@ -10,7 +10,7 @@ import SwiftUI import Combine import SDWebImage -class ImageManager : BindableObject { +class ImageManager : ObservableObject { var willChange = PassthroughSubject() var didChange = PassthroughSubject() diff --git a/SDWebImageSwiftUI/Classes/WebImage.swift b/SDWebImageSwiftUI/Classes/WebImage.swift index 43f881a..22777cf 100644 --- a/SDWebImageSwiftUI/Classes/WebImage.swift +++ b/SDWebImageSwiftUI/Classes/WebImage.swift @@ -15,7 +15,7 @@ public struct WebImage : View { public var options: SDWebImageOptions public var context: [SDWebImageContextOption : Any]? - @ObjectBinding var imageManager: ImageManager + @ObservedObject var imageManager: ImageManager public init(url: URL, placeholder: Image? = nil, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]? = nil) { self.url = url