Skip to content

Commit 2ba0919

Browse files
committed
Update to the latest Xcode 11-beta5 syntax of SwiftUI
1 parent 30cf499 commit 2ba0919

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

SDWebImageSwiftUI/Classes/AnimatedImage.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public struct AnimatedImage: ViewRepresentable {
1616
var name: String?
1717
var bundle: Bundle?
1818
var data: Data?
19-
var scale: Length = 0
19+
var scale: CGFloat = 0
2020

2121
#if os(macOS)
2222
public typealias NSViewType = SDAnimatedImageView
@@ -74,7 +74,7 @@ public struct AnimatedImage: ViewRepresentable {
7474
self.bundle = bundle
7575
}
7676

77-
public init(data: Data, scale: Length = 0) {
77+
public init(data: Data, scale: CGFloat = 0) {
7878
self.data = data
7979
self.scale = scale
8080
}

SDWebImageSwiftUI/Classes/ImageManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import SwiftUI
1010
import Combine
1111
import SDWebImage
1212

13-
class ImageManager : BindableObject {
13+
class ImageManager : ObservableObject {
1414
var willChange = PassthroughSubject<ImageManager, Never>()
1515
var didChange = PassthroughSubject<ImageManager, Never>()
1616

SDWebImageSwiftUI/Classes/WebImage.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public struct WebImage : View {
1515
public var options: SDWebImageOptions
1616
public var context: [SDWebImageContextOption : Any]?
1717

18-
@ObjectBinding var imageManager: ImageManager
18+
@ObservedObject var imageManager: ImageManager
1919

2020
public init(url: URL, placeholder: Image? = nil, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]? = nil) {
2121
self.url = url

0 commit comments

Comments
 (0)