commit
7712d2eb78
|
@ -6,10 +6,10 @@ import PackageDescription
|
|||
let package = Package(
|
||||
name: "ObjectUI",
|
||||
platforms: [
|
||||
.iOS(.v13),
|
||||
.macOS(.v10_15),
|
||||
.watchOS(.v6),
|
||||
.tvOS(.v13)
|
||||
.iOS(.v14),
|
||||
.macOS(.v11),
|
||||
.watchOS(.v7),
|
||||
.tvOS(.v14)
|
||||
],
|
||||
products: [
|
||||
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import SwiftUI
|
||||
|
||||
public struct ObjectView<Content>: View where Content: View {
|
||||
@ObservedObject private var object: Object
|
||||
@StateObject private var object: Object = Object()
|
||||
|
||||
private var content: (Object) -> Content
|
||||
|
||||
|
@ -16,8 +16,8 @@ public struct ObjectView<Content>: View where Content: View {
|
|||
data: Any? = nil,
|
||||
content: @escaping (Object) -> Content
|
||||
) {
|
||||
self.object = Object(data)
|
||||
self.content = content
|
||||
self.object.consume(Object(data))
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
|
|
Loading…
Reference in New Issue