If two views have a call to matchedGeometryEffect, with the same id and namespace, and both calls have isSource = false, the views SHOULD NOT match. However, the framework picks one of the views to act as source and the match occurs.
Bug Report: FB7968204
Workaround: No, use a combination of id and namespace not currently in use.
Last Version Checked: Xcode 12, Beta 4. Fixed in Beta 4!
Sample Code
struct ExampleView1: View {
@Namespace var ns
var body: some View {
HStack {
Rectangle().foregroundColor(Color.blue)
.matchedGeometryEffect(id: "id1", in: ns, isSource: false)
.frame(width: 100, height: 100)
Circle().foregroundColor(Color.green)
.matchedGeometryEffect(id: "id1", in: ns, isSource: false)
.frame(width: 100, height: 100)
}
}
}
This is the outcome: