# `GSFrameView zoomViewToFitRect:`

*Instance Method*

Zooms so that the passed rect will fit in the view.

## Declaration

```swift
func zoom(toFit rect: NSRect)
```

```objc
- (void) zoomViewToFitRect:(NSRect) rect;
```

```python
zoomViewToFitRect_(rect: NSRect)
```

## Discussion

In general this should be used for a zoom OUT, such as a “fit to window” command, though it will zoom in if the view is smaller than the current frame.

