Update to the latest Xcode 11-beta5 syntax of SwiftUI
This commit is contained in:
parent
30cf499e5d
commit
2ba09192c2
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>()
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue