Skip to content

Commit 9e6fa2f

Browse files
authored
Fix Example project build issue (#55)
1 parent 9d03a47 commit 9e6fa2f

File tree

10 files changed

+129
-131
lines changed

10 files changed

+129
-131
lines changed

Example/Example.xcodeproj/project.pbxproj

+117-97
Large diffs are not rendered by default.

Example/HostingExample/ViewController.swift

+3-9
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ class ViewController: UINavigationController {
1919
}
2020
}
2121

22-
struct ContentView: UIViewRepresentable {
23-
func makeUIView(context: Context) -> UIView {
24-
let view = UIView()
25-
view.backgroundColor = .red
26-
return view
27-
}
28-
29-
func updateUIView(_ uiView: UIView, context: Context) {
30-
print("Update UIView")
22+
struct ContentView: View {
23+
var body: some View {
24+
EmptyView()
3125
}
3226
}

Example/Package.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ let package = Package(
1717
name: "Example",
1818
platforms: [
1919
.macOS(.v10_15),
20+
.iOS(.v13),
2021
],
2122
products: [.executable(name: "Example", targets: ["Example"])],
2223
dependencies: [
2324
.package(path: "../"),
24-
.package(url: "https://github.com/OpenSwiftUIProject/OpenGraph", branch: "main"),
25+
.package(path: "../../OpenGraph")
2526
],
2627
targets: [
2728
exampleTarget,

Package.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"location" : "https://github.com/OpenSwiftUIProject/OpenGraph",
77
"state" : {
88
"branch" : "main",
9-
"revision" : "ccb771c9fd939f1e1eefb46f69139e94ebb0dc82"
9+
"revision" : "6bdaabae4e0e23868f657c24fd09580f8915519c"
1010
}
1111
},
1212
{

Sources/COpenSwiftUI/MovableLock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void _MovableLockSyncMain(MovableLock lock, const void *context, void (*function
9595
pthread_cond_signal_thread_np(&lock->cond1, lock->main);
9696
} else if (!lock->unknown4) {
9797
lock->unknown4 = true;
98-
dispatch_async_f(dispatch_get_main_queue(), lock, &sync_main_callback);
98+
dispatch_async_f(dispatch_get_main_queue(), lock, (dispatch_function_t)&sync_main_callback);
9999
if (lock->unknown5) {
100100
pthread_cond_signal_thread_np(&lock->cond1, lock->main);
101101
}

Sources/OpenSwiftUI/Core/Graph/Extensions/OGSubgraph.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ internal import OpenGraphShims
33
extension OGSubgraph {
44
func willRemove() {
55
#if canImport(Darwin)
6-
OGSubgraph.apply(self, flags: .removable) { attribute in
6+
forEach(.removable) { attribute in
77
let type = attribute._bodyType
88
if let removableType = type as? RemovableAttribute.Type {
99
removableType.willRemove(attribute: attribute)
@@ -14,7 +14,7 @@ extension OGSubgraph {
1414

1515
func didReinsert() {
1616
#if canImport(Darwin)
17-
OGSubgraph.apply(self, flags: .removable) { attribute in
17+
forEach(.removable) { attribute in
1818
let type = attribute._bodyType
1919
if let removableType = type as? RemovableAttribute.Type {
2020
removableType.didReinsert(attribute: attribute)
@@ -25,7 +25,7 @@ extension OGSubgraph {
2525

2626
func willInvalidate(isInserted: Bool) {
2727
#if canImport(Darwin)
28-
OGSubgraph.apply(self, flags: isInserted ? [.removable, .invalidatable] : [.invalidatable]) { attribute in
28+
forEach(isInserted ? [.removable, .invalidatable] : [.invalidatable]) { attribute in
2929
let type = attribute._bodyType
3030
if let invalidatableType = type as? InvalidatableAttribute.Type {
3131
invalidatableType.willInvalidate(attribute: attribute)

Sources/OpenSwiftUI/Core/Graph/GraphHost.swift

-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ class GraphHost {
137137

138138
// TODO: _ArchivedViewHost.reset()
139139
final func incrementPhase() {
140-
var data = data
141140
data.phase.value += 2
142141
graphDelegate?.graphDidChange()
143142
}

Sources/OpenSwiftUI/Integration/UIKit/UIHostingView.swift

+2-18
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import UIKit
1515
open class _UIHostingView<Content>: UIView where Content: View {
1616
private var _rootView: Content
1717
var viewGraph: ViewGraph
18+
var currentTimestamp: Time = .zero
19+
var propertiesNeedingUpdate: ViewRendererHostProperties = []
1820
var isRendering: Bool = false
1921
var inheritedEnvironment: EnvironmentValues?
2022
var environmentOverride: EnvironmentValues?
@@ -112,24 +114,6 @@ open class _UIHostingView<Content>: UIView where Content: View {
112114
}
113115

114116
extension _UIHostingView: ViewRendererHost {
115-
var currentTimestamp: Time {
116-
get {
117-
fatalError("TODO")
118-
}
119-
set {
120-
fatalError("TODO")
121-
}
122-
}
123-
124-
var propertiesNeedingUpdate: ViewRendererHostProperties {
125-
get {
126-
fatalError("TODO")
127-
}
128-
set {
129-
fatalError("TODO")
130-
}
131-
}
132-
133117
func requestUpdate(after: Double) {
134118
// TODO
135119
}

0 commit comments

Comments
 (0)