scaledToFit3D()
Scales this view to fit its parent.
Declaration
@export(implementation) nonisolated func scaledToFit3D() -> some View
Return Value
A view that scales this view to fit its parent, maintaining this view’s aspect ratio.
Discussion
This view’s 3D aspect ratio is maintained as the view scales. This method is equivalent to calling aspectRatio3D(nil, contentMode: .fit).
Model3D(named: "Plane") { resolved in
resolved
.resizable()
.scaledToFit3D()
} placeholder: {
ProgressView()
}
.frame(width: 400, height: 400)
.frame(depth: 200)
.border(Color(white: 0.75))