---
title: "contentMargins(for:edges:)"
framework: SwiftUI
role: symbol
role_heading: Instance Method
platforms: [iOS 27.1+, iPadOS 27.1+, Mac Catalyst 27.1+, macOS 27.1+, tvOS 27.1+, visionOS 27.1+, watchOS 27.1+]
path: "swiftui/geometryproxy/contentmargins(for:edges:)"
---

# contentMargins(for:edges:)

The insets of a content margin guide for the given edges.

## Declaration

```swift
func contentMargins(for guide: ContentMarginGuide, edges: Edge.Set = .all) -> EdgeInsets
```

## Parameters

- `guide`: The guide that provides the insets.
- `edges`: The edges to read insets for.

## Return Value

Return Value The insets guide provides for edges. Edges not in the set have a value of zero.

## Discussion

Discussion Read a guide when you need its value rather than the inset, like a view that draws its own content: GeometryReader { proxy in     Canvas { context, size in         drawChart(             in: context, size: size,             insets: proxy.contentMargins(for: .container, edges: .horizontal))     } }
