diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 9582a9abe..89f5e4fd6 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ 27186AE02D538A6B009E05F9 /* RenderBox.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6C4D42D2842810010502F /* RenderBox.xcframework */; }; 27186AE32D538A76009E05F9 /* AttributeGraph.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6C4D12D2842740010502F /* AttributeGraph.xcframework */; }; + 278EF52D2E2272F2009C32EB /* Equatable in Frameworks */ = {isa = PBXBuildFile; productRef = 278EF52C2E2272F2009C32EB /* Equatable */; }; + 278EF52F2E227304009C32EB /* Equatable in Frameworks */ = {isa = PBXBuildFile; productRef = 278EF52E2E227304009C32EB /* Equatable */; }; 279284972DFF136E00234D64 /* AttributeGraph.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6C4D12D2842740010502F /* AttributeGraph.xcframework */; }; 279284982DFF136E00234D64 /* AttributeGraph.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 27E6C4D12D2842740010502F /* AttributeGraph.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 279284992DFF136E00234D64 /* CoreUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27EE91722DD0C753006C85FD /* CoreUI.xcframework */; }; @@ -152,6 +154,7 @@ files = ( 27CD0B5F2AFC8DA7003665EB /* OpenSwiftUI in Frameworks */, 27E6C4D62D2842810010502F /* RenderBox.xcframework in Frameworks */, + 278EF52F2E227304009C32EB /* Equatable in Frameworks */, 27EE91762DD0C77E006C85FD /* CoreUI.xcframework in Frameworks */, 27E6C4D32D2842740010502F /* AttributeGraph.xcframework in Frameworks */, ); @@ -163,6 +166,7 @@ files = ( 27D49E0E2BA60AF600F6E2E2 /* OpenSwiftUI in Frameworks */, 27EE91732DD0C753006C85FD /* CoreUI.xcframework in Frameworks */, + 278EF52D2E2272F2009C32EB /* Equatable in Frameworks */, 27186AE02D538A6B009E05F9 /* RenderBox.xcframework in Frameworks */, 27186AE32D538A76009E05F9 /* AttributeGraph.xcframework in Frameworks */, ); @@ -284,6 +288,7 @@ name = Example; packageProductDependencies = ( 27CD0B5E2AFC8DA7003665EB /* OpenSwiftUI */, + 278EF52E2E227304009C32EB /* Equatable */, ); productName = Example; productReference = 27CD0B492AFC8D37003665EB /* Example.app */; @@ -308,6 +313,7 @@ name = HostingExample; packageProductDependencies = ( 27D49E0D2BA60AF600F6E2E2 /* OpenSwiftUI */, + 278EF52C2E2272F2009C32EB /* Equatable */, ); productName = HostingExample; productReference = 27D49DF82BA604FB00F6E2E2 /* HostingExample.app */; @@ -348,6 +354,7 @@ mainGroup = 27CD0B402AFC8D37003665EB; packageReferences = ( 275752022DEE147E003E467C /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */, + 278EF52B2E2272F2009C32EB /* XCRemoteSwiftPackageReference "equatable" */, ); preferredProjectObjectVersion = 56; productRefGroup = 27CD0B4A2AFC8D37003665EB /* Products */; @@ -1371,9 +1378,27 @@ minimumVersion = 1.18.4; }; }; + 278EF52B2E2272F2009C32EB /* XCRemoteSwiftPackageReference "equatable" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/OpenSwiftUIProject/equatable.git"; + requirement = { + branch = main; + kind = branch; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ + 278EF52C2E2272F2009C32EB /* Equatable */ = { + isa = XCSwiftPackageProductDependency; + package = 278EF52B2E2272F2009C32EB /* XCRemoteSwiftPackageReference "equatable" */; + productName = Equatable; + }; + 278EF52E2E227304009C32EB /* Equatable */ = { + isa = XCSwiftPackageProductDependency; + package = 278EF52B2E2272F2009C32EB /* XCRemoteSwiftPackageReference "equatable" */; + productName = Equatable; + }; 2792849E2DFF137400234D64 /* SnapshotTesting */ = { isa = XCSwiftPackageProductDependency; package = 275752022DEE147E003E467C /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */; diff --git a/Example/HostingExample/ViewController.swift b/Example/HostingExample/ViewController.swift index d82fcdf54..5b84729f2 100644 --- a/Example/HostingExample/ViewController.swift +++ b/Example/HostingExample/ViewController.swift @@ -66,9 +66,6 @@ class ViewController: NSViewController { struct ContentView: View { var body: some View { - MyViewThatFitsByLayout { - Color.red.frame(width: 50, height: 50) - Color.green.frame(width: 50, height: 50) - }.frame(width: 200, height: 200) + EquatableDemoView(count: 0, tag: 0) } } diff --git a/Example/SharedExample/View/AppearanceActionModifierExample.swift b/Example/SharedExample/View/AppearanceActionModifierExample.swift index 84770e102..b54fc443c 100644 --- a/Example/SharedExample/View/AppearanceActionModifierExample.swift +++ b/Example/SharedExample/View/AppearanceActionModifierExample.swift @@ -1,6 +1,6 @@ // // AppearanceActionModifierExample.swift -// HostingExample +// SharedExample #if OPENSWIFTUI import OpenSwiftUI diff --git a/Example/SharedExample/View/ConditionalContentExample.swift b/Example/SharedExample/View/ConditionalContentExample.swift index 0252ec7f6..b310c1465 100644 --- a/Example/SharedExample/View/ConditionalContentExample.swift +++ b/Example/SharedExample/View/ConditionalContentExample.swift @@ -1,6 +1,6 @@ // // ConditionalContentExample.swift -// HostingExample +// SharedExample #if OPENSWIFTUI import OpenSwiftUI diff --git a/Example/SharedExample/View/EquatableDemoView.swift b/Example/SharedExample/View/EquatableDemoView.swift new file mode 100644 index 000000000..1ebd52c7a --- /dev/null +++ b/Example/SharedExample/View/EquatableDemoView.swift @@ -0,0 +1,24 @@ +// +// EquatableView.swift +// SharedExample + +#if OPENSWIFTUI +import OpenSwiftUI +#else +import SwiftUI +#endif +import Equatable +import Foundation + +@Equatable +struct EquatableDemoView: View { + @Namespace private var namespace + let count: Int + @EquatableIgnored let tag: Int + + var body: some View { + VStack { + Color.red + } + } +} diff --git a/Example/SharedExample/View/NamespaceExample.swift b/Example/SharedExample/View/NamespaceExample.swift index 057f8b0fd..99f5408d4 100644 --- a/Example/SharedExample/View/NamespaceExample.swift +++ b/Example/SharedExample/View/NamespaceExample.swift @@ -1,6 +1,6 @@ // // NamespaceExample.swift -// HostingExample +// SharedExample #if OPENSWIFTUI import OpenSwiftUI diff --git a/Tests/OpenSwiftUICompatibilityTests/View/EquatableViewTests.swift b/Tests/OpenSwiftUICompatibilityTests/View/EquatableViewTests.swift index f55f4db58..09bc584c4 100644 --- a/Tests/OpenSwiftUICompatibilityTests/View/EquatableViewTests.swift +++ b/Tests/OpenSwiftUICompatibilityTests/View/EquatableViewTests.swift @@ -100,7 +100,7 @@ struct EquatableViewTests { #if os(iOS) let expectedCount = 1 // FIXME: Not expected, probably due to triggerLayout implementation #elseif os(macOS) - let expectedCount = 2 ... 3 // FIXME: Not expected, local 3 while CI 2 :( + let expectedCount = 1 ... 3 // FIXME: Not expected, local 3 while CI 1 or 2 :( #endif await confirmation(expectedCount: expectedCount) { @MainActor confirmation in await withUnsafeContinuation { (continuation: UnsafeContinuation) in @@ -121,7 +121,7 @@ struct EquatableViewTests { #if os(iOS) let expectedCount = 1 // FIXME: Not expected, probably due to triggerLayout implementation #elseif os(macOS) - let expectedCount = 2 + let expectedCount = 1 ... 2 // FIXME: Not expected, local 2 while CI 1 or 2 :( #endif await confirmation(expectedCount: expectedCount) { @MainActor confirmation in await withUnsafeContinuation { (continuation: UnsafeContinuation) in