0% found this document useful (0 votes)
4 views1 page

Circle

The document describes how to create a Circle as a path within a specific CGRect using the Circle/path(in:) modifier in SwiftUI. It provides an example of a Circle that aligns itself within its containing view by default. Additionally, it mentions that Swift infers the type of the custom view from the implementation of the required body property.

Uploaded by

jon.moses2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Circle

The document describes how to create a Circle as a path within a specific CGRect using the Circle/path(in:) modifier in SwiftUI. It provides an example of a Circle that aligns itself within its containing view by default. Additionally, it mentions that Swift infers the type of the custom view from the implementation of the required body property.

Uploaded by

jon.moses2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Used to describe a Circle as a path in a `CGRect`.

A Circle can be described as a path within a specific


[`CGRect`](https://developer.apple.com/documentation/coregraphics/cgrect)
using the ``Circle/path(in:)`` modifier:

```
struct ExampleView: View {
var body: some View {
Circle()
.path(in: CGRect(x: 0, y: 0, width: 100, height: 100))
}
}
```

![Circle path example](Circle-example-4.png)

Creates a Circle that aligns itself inside of the view containing it


by default.

```
struct ExampleView: View {
var body: some View {
Circle()
}
}
```

![A view containing a circle with default black fill.](Circle-example-1.png)

The type defining the data to animate.


The type of view representing the body of this view.

When you create a custom view, Swift infers this type from your
implementation of the required `body` property.

You might also like