File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -44,17 +44,19 @@ imageView.image = svg.rasterize() // 240x200
44
44
SVGView (" sample.svg" )
45
45
```
46
46
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:
48
48
49
49
``` swift
50
50
SVGView (" sample.svg" )
51
51
.resizable ()
52
52
.scaledToFit ()
53
53
```
54
54
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.
58
60
59
61
When loading by name, ` SVGView ` maintains an internal cache for efficient repeated lookups.
60
62
For more predictable performance (avoiding cache lookups or parsing), you can pass in an already-constructed ` SVG ` instance:
You can’t perform that action at this time.
0 commit comments