Skip to content

Commit a61e09a

Browse files
authored
Update README.md
1 parent 8032cd2 commit a61e09a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,19 @@ imageView.image = svg.rasterize() // 240x200
4444
SVGView("sample.svg")
4545
```
4646

47-
By default, the SVG is rendered at its intrinsic size. To make it flexible within layouts, mark it as resizable — just like `Image`:
47+
By default, the SVG is rendered at its intrinsic size. To make it flexible within layouts, mark it as resizable:
4848

4949
```swift
5050
SVGView("sample.svg")
5151
.resizable()
5252
.scaledToFit()
5353
```
5454

55-
- Use `.scaledToFit()` to scale proportionally so the SVG fits inside its container.
56-
- Use `.scaledToFill()` to fill the entire container, cropping if necessary.
57-
- Use `.resizable(resizingMode: .tile)` to repeat the SVG as tiles across the available space.
55+
`SVGView` works just like `Image`:
56+
57+
- `.scaledToFit()` to scale proportionally so the SVG fits inside its container.
58+
- `.scaledToFill()` to fill the entire container, cropping if necessary.
59+
- `.resizable(resizingMode: .tile)` to repeat the SVG as tiles across the available space.
5860

5961
When loading by name, `SVGView` maintains an internal cache for efficient repeated lookups.
6062
For more predictable performance (avoiding cache lookups or parsing), you can pass in an already-constructed `SVG` instance:

0 commit comments

Comments
 (0)