# Customizing page navigation in our iOS viewer

After loading a PDF document, you can programmatically interact with it, which allows you to scroll to different pages or zoom in and out. All of the interaction APIs are available on [`PDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller), which is the core PDF viewer.

## Changing the current page

A user can manually change the current page by swiping on a device. However, you can programmatically change pages using [`pageIndex`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller/pageindex) and [`setPageIndex(_:animated:)`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller/setpageindex(_:animated:)). You can also use [`pageIndex`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller/pageindex) to fetch the current page:

### SWIFT

```swift

let startPage = pdfController.pageIndex

// Change to page 13 (zero-based page numbers).
pdfController.pageIndex = 12

// Go to the last page using a transitioning animation.
let lastPage = document.pageCount - 1
pdfController.setPageIndex(lastPage, animated: true)

// Go back to the page where you started.
pdfController.pageIndex = startPage

```

### OBJECTIVE-C

```objc

NSUInteger startPage = pdfController.pageIndex;

// Change to page 13 (zero-based page numbers).
pdfController.pageIndex = 12;

// Go to the last page using a transitioning animation.
NSUInteger lastPage = document.pageCount - 1;
[pdfController setPageIndex:lastPage animated:YES];

// Go back to the page where you started.
pdfController.pageIndex = startPage;

```
---

## Related pages

- [iOS PDF viewer library](/guides/ios/viewer.md)
- [Embedded files and PDF portfolio collections](/guides/ios/features/embedded-files.md)
- [iOS image viewer library](/guides/ios/viewer/images.md)
- [Configure permissions for iOS PDF viewer](/guides/ios/features/document-permissions.md)
- [Enhance your PDF workflow with JavaScript support](/guides/ios/features/javascript.md)
- [Configuring scroll directions and page transitions in our viewer](/guides/ios/customizing-the-interface/document-presentation-options.md)
- [Swift PDF viewer library](/guides/ios/viewer/swift.md)
- [Troubleshooting](/guides/ios/viewer/troubleshooting.md)
- [visionOS AR/VR PDF viewer](/guides/ios/viewer/visionos.md)
- [Display PDFs with the view state on iOS](/guides/ios/view-management/store-load-view-state.md)

