I'm going through the newly published SwiftUI tutorials, in particular Drawing Paths and Shapes here: https://developer.apple.com/tutorials/swiftui/drawing-paths-and-shapes
In Step 4 of 5 "Combine the Badge Foreground and Background", intermediate step 3 you are required to add the GeometryReader code to the body variable...
var body: some View {
ZStack {
BadgeBackground()
GeometryReader { geometry in
self.badgeSymbols
.scaleEffect(1.0 / 4.0, anchor: .top)
.position(x: geometry.size.width / 2.0, y: (3.0 / 4.0) * geometry.size.height)
}
}
}
But Xcode complains after adding the GeometryReader that the ZStack trailing closure is "Unable to infer complex closure return type; add explicit type to disambiguate"
Am I missing something? To my eyes, my code is identical to the tutorials.
I decided to compile the Complete version of the tutorial that comes with the downloaded zip. That seems to compile without complaint. Here's a screenshot of the two source code files side by side. https://imgur.com/azzjjx9