Skip to content

Commit

Permalink
Fix Example project build issue (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye committed Mar 25, 2024
1 parent 9d03a47 commit 9e6fa2f
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 131 deletions.
214 changes: 117 additions & 97 deletions Example/Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 3 additions & 9 deletions Example/HostingExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ class ViewController: UINavigationController {
}
}

struct ContentView: UIViewRepresentable {
func makeUIView(context: Context) -> UIView {
let view = UIView()
view.backgroundColor = .red
return view
}

func updateUIView(_ uiView: UIView, context: Context) {
print("Update UIView")
struct ContentView: View {
var body: some View {
EmptyView()
}
}
3 changes: 2 additions & 1 deletion Example/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ let package = Package(
name: "Example",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
],
products: [.executable(name: "Example", targets: ["Example"])],
dependencies: [
.package(path: "../"),
.package(url: "https://github.com/OpenSwiftUIProject/OpenGraph", branch: "main"),
.package(path: "../../OpenGraph")
],
targets: [
exampleTarget,
Expand Down
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"location" : "https://github.com/OpenSwiftUIProject/OpenGraph",
"state" : {
"branch" : "main",
"revision" : "ccb771c9fd939f1e1eefb46f69139e94ebb0dc82"
"revision" : "6bdaabae4e0e23868f657c24fd09580f8915519c"
}
},
{
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Sources/COpenSwiftUI/MovableLock.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void _MovableLockSyncMain(MovableLock lock, const void *context, void (*function
pthread_cond_signal_thread_np(&lock->cond1, lock->main);
} else if (!lock->unknown4) {
lock->unknown4 = true;
dispatch_async_f(dispatch_get_main_queue(), lock, &sync_main_callback);
dispatch_async_f(dispatch_get_main_queue(), lock, (dispatch_function_t)&sync_main_callback);
if (lock->unknown5) {
pthread_cond_signal_thread_np(&lock->cond1, lock->main);
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/OpenSwiftUI/Core/Graph/Extensions/OGSubgraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ internal import OpenGraphShims
extension OGSubgraph {
func willRemove() {
#if canImport(Darwin)
OGSubgraph.apply(self, flags: .removable) { attribute in
forEach(.removable) { attribute in
let type = attribute._bodyType
if let removableType = type as? RemovableAttribute.Type {
removableType.willRemove(attribute: attribute)
Expand All @@ -14,7 +14,7 @@ extension OGSubgraph {

func didReinsert() {
#if canImport(Darwin)
OGSubgraph.apply(self, flags: .removable) { attribute in
forEach(.removable) { attribute in
let type = attribute._bodyType
if let removableType = type as? RemovableAttribute.Type {
removableType.didReinsert(attribute: attribute)
Expand All @@ -25,7 +25,7 @@ extension OGSubgraph {

func willInvalidate(isInserted: Bool) {
#if canImport(Darwin)
OGSubgraph.apply(self, flags: isInserted ? [.removable, .invalidatable] : [.invalidatable]) { attribute in
forEach(isInserted ? [.removable, .invalidatable] : [.invalidatable]) { attribute in
let type = attribute._bodyType
if let invalidatableType = type as? InvalidatableAttribute.Type {
invalidatableType.willInvalidate(attribute: attribute)
Expand Down
1 change: 0 additions & 1 deletion Sources/OpenSwiftUI/Core/Graph/GraphHost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class GraphHost {

// TODO: _ArchivedViewHost.reset()
final func incrementPhase() {
var data = data
data.phase.value += 2
graphDelegate?.graphDidChange()
}
Expand Down
20 changes: 2 additions & 18 deletions Sources/OpenSwiftUI/Integration/UIKit/UIHostingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import UIKit
open class _UIHostingView<Content>: UIView where Content: View {
private var _rootView: Content
var viewGraph: ViewGraph
var currentTimestamp: Time = .zero
var propertiesNeedingUpdate: ViewRendererHostProperties = []
var isRendering: Bool = false
var inheritedEnvironment: EnvironmentValues?
var environmentOverride: EnvironmentValues?
Expand Down Expand Up @@ -112,24 +114,6 @@ open class _UIHostingView<Content>: UIView where Content: View {
}

extension _UIHostingView: ViewRendererHost {
var currentTimestamp: Time {
get {
fatalError("TODO")
}
set {
fatalError("TODO")
}
}

var propertiesNeedingUpdate: ViewRendererHostProperties {
get {
fatalError("TODO")
}
set {
fatalError("TODO")
}
}

func requestUpdate(after: Double) {
// TODO
}
Expand Down

0 comments on commit 9e6fa2f

Please sign in to comment.