Skip to content

Commit 8032cd2

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

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,26 @@ imageView.image = svg.rasterize() // 240x200
3838

3939
### SwiftUI
4040

41-
SVGs can be displayed within `SVGView` just like using SwiftUI's built-in `Image`:
41+
`SVGView` works much like SwiftUIs built-in `Image` view:
4242

4343
```swift
4444
SVGView("sample.svg")
4545
```
4646

47-
By default, SVGs are rendered at their original (intrinsic) size. To make them flexible within layouts, mark them as resizable — exactly like `Image`:
47+
By default, the SVG is rendered at its intrinsic size. To make it flexible within layouts, mark it as resizable — just like `Image`:
4848

4949
```swift
5050
SVGView("sample.svg")
51-
.resizable()
52-
.scaledToFit()
51+
.resizable()
52+
.scaledToFit()
5353
```
5454

55-
This allows the SVG to scale proportionally to fit within its container. Use `.scaledToFill()` to completely cover the container and use `.resizable(resizingMode: .tile)` to draw the SVG in repeating tiles filling the available space.
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.
5658

57-
When you load by name, SVGView uses an internal cache so repeated lookups are efficient.
58-
For more predictable performance (avoiding any cache lookup or parsing), you can pass an already-created SVG instance:
59+
When loading by name, `SVGView` maintains an internal cache for efficient repeated lookups.
60+
For more predictable performance (avoiding cache lookups or parsing), you can pass in an already-constructed `SVG` instance:
5961

6062
```swift
6163
var image: SVG

0 commit comments

Comments
 (0)