# Customize zooming options in our iOS viewer

This guide shows how to programmatically manage the zoom scale of a PDF page.

## Manual zooming

You can use [`PDFDocumentViewController.zoom(toPDFRect:forPageAt:animated:)`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfdocumentviewcontroller/zoom(topdfrect:forpageat:animated:)) to zoom to a specific rect inside a page of the current document.

This method’s rect needs to be specified in [PDF coordinates](/guides/ios/faq/coordinate-spaces.md).

The method will make sure to switch to the correct page if necessary before applying the zoom.

### SWIFT

```swift

let annotationPosition = annotation.boundingBox
let pageIndex = annotation.absolutePageIndex

// Zoom to the annotation.
documentViewController.zoom(toPDFRect: annotationPosition, forPageAt: pageIndex, animated: true)

```

### OBJECTIVE-C

```objc

CGRect annotationPosition = annotation.boundingBox;
NSUInteger pageIndex = annotation.absolutePageIndex;

// Zoom to the annotation.
[documentViewController zoomToPDFRect:annotationPosition forPageAtIndex:pageIndex animated:YES];

```

[`zoom(toPDFRect:forPageAt:animated:)`](/api/ios/documentation/pspdfkitui/pdfdocumentviewcontroller/zoom\(topdfrect:forpageat:animated:\)) will automatically go to the given page if some other page is currently being viewed. There’s no need to switch the page manually!

## Disabling zooming

Zooming can be disabled by setting the [`maximumZoomScale`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration/maximumzoomscale) of [`PDFConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration) to `1`. It’s important to set this value before creating the view. Alternatively, you can set [`zoomEnabled`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfdocumentviewcontroller/iszoomenabled) to `NO` on [`PDFDocumentViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfdocumentviewcontroller):

### SWIFT

```swift

let controller = PDFViewController(document: document) {
    $0.maximumZoomScale = 1
}

```

### OBJECTIVE-C

```objc

PSPDFViewController *controller = [[PSPDFViewController alloc] initWithDocument:document configuration:[PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    builder.maximumZoomScale = 1.0f;
}]];

```
---

## Related pages

- [Drag and drop text or images in our iOS viewer](/guides/ios/features/drag-and-drop.md)
- [Keyboard shortcuts in our iOS viewer](/guides/ios/features/keyboard-shortcuts.md)
- [Selecting text in our iOS viewer](/guides/ios/features/text-selection.md)
- [Trackpad and mouse support in our iOS viewer](/guides/ios/features/trackpad-and-mouse-support.md)
- [Customize user interactions on iOS](/guides/ios/customizing-the-interface/handling-user-interactions.md)

