ios – SwiftUI – place at prime main this view at `x` and `y`

Match SwiftUI place coordinates with Figma.

On Figma, the anchor is on the prime main of the layer.
On SwiftUI, the anchor is on the heart of the layer, because the documentation mentions:

/// - Returns: A view that fixes the middle of this view at `x` and `y`.
@inlinable public func place(x: CGFloat = 0, y: CGFloat = 0) -> some View

So when each SwiftUI and Figma are set to x:0 and y:0 positions, they do not match.

Query: how can I set the anchor in SwiftUI to be on the prime main nook?

enter image description here

enter image description here

import SwiftUI

struct ContentView: View {
    var physique: some View {
        ZStack {
            .body(width: 132.0, peak: 132.0)
            .place(x: 0, y: 0)
        .body(width: 731, peak: 418)




Leave a Reply

Your email address will not be published.