Update to the latest Xcode 11-beta5 syntax of SwiftUI

This commit is contained in:
DreamPiggy 2019-08-09 18:06:47 +08:00
parent 30cf499e5d
commit 2ba09192c2
3 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ public struct AnimatedImage: ViewRepresentable {
var name: String? var name: String?
var bundle: Bundle? var bundle: Bundle?
var data: Data? var data: Data?
var scale: Length = 0 var scale: CGFloat = 0
#if os(macOS) #if os(macOS)
public typealias NSViewType = SDAnimatedImageView public typealias NSViewType = SDAnimatedImageView
@ -74,7 +74,7 @@ public struct AnimatedImage: ViewRepresentable {
self.bundle = bundle self.bundle = bundle
} }
public init(data: Data, scale: Length = 0) { public init(data: Data, scale: CGFloat = 0) {
self.data = data self.data = data
self.scale = scale self.scale = scale
} }

View File

@ -10,7 +10,7 @@ import SwiftUI
import Combine import Combine
import SDWebImage import SDWebImage
class ImageManager : BindableObject { class ImageManager : ObservableObject {
var willChange = PassthroughSubject<ImageManager, Never>() var willChange = PassthroughSubject<ImageManager, Never>()
var didChange = PassthroughSubject<ImageManager, Never>() var didChange = PassthroughSubject<ImageManager, Never>()

View File

@ -15,7 +15,7 @@ public struct WebImage : View {
public var options: SDWebImageOptions public var options: SDWebImageOptions
public var context: [SDWebImageContextOption : Any]? 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) { public init(url: URL, placeholder: Image? = nil, options: SDWebImageOptions = [], context: [SDWebImageContextOption : Any]? = nil) {
self.url = url self.url = url