---
title: "Customize modal view controllers in iOS PDF viewer | Nutrient"
canonical_url: "https://www.nutrient.io/guides/ios/faq/modally-presented-view-controllers/"
md_url: "https://www.nutrient.io/guides/ios/faq/modally-presented-view-controllers.md"
last_updated: "2026-06-09T10:32:42.832Z"
description: "There are a lot of view controllers presented modally in Nutrient, and you have the ability to customize the behavior and look of all of them."
---

# Customize view control modals on iOS

There are a lot of view controllers presented modally in Nutrient, and you have the ability to customize the behavior and look of all of them. This guide outlines how to achieve the exact behavior and look you desire.

## Hide the close button

We automatically add a close button to all modally presented view controllers. If you don’t want that button or if you want to customize this behavior, you hide the close button in two different ways (detailed below).

### Hide the close button for PSPDFViewController

To hide the close button on a modally presented [`PSPDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller), set the [`closeBarButtonItem`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/navigationitem/closebarbuttonitem) of the [`navigationItem`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller/navigationitem) to `nil`.

### Hide the close button on a view controller presented from PSPDFViewController

To hide the close button on a view controller presented from [`PSPDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller), override [`presentViewController:options:animated:sender:completion:`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller/present(_:options:animated:sender:completion:)) in your [`PSPDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller) subclass and edit the `options` dictionary to set `PSPDFPresentationCloseButtonKey` to `false`.

In the following code snippet, we hide the close button only for presented instances of [`PSPDFNoteAnnotationViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/noteannotationviewcontroller). Be aware that if you hide the close button without adding a custom close button, there is no other way to dismiss the view controller:

### SWIFT

```swift

override func present(_ controller: UIViewController, options: [String: Any]? = nil, animated: Bool, sender: Any?, completion: (() -> Void)? = nil) -> Bool {
    var customOptions = options
    if controller is PSPDFNoteAnnotationViewController {
        customOptions?[PSPDFPresentationCloseButtonKey] = false
    }
    return super.present(controller, options: customOptions, animated: animated, sender: sender, completion: completion)
}

```

### OBJECTIVE-C

```objc

- (BOOL)presentViewController:(UIViewController *)controller options:(nullable NSDictionary<NSString *, id> *)options animated:(BOOL)animated sender:(nullable id)sender completion:(void (^)(void))completion {
    NSMutableDictionary<NSString *, id> *customOptions = options.mutableCopy;
    if ([controller isKindOfClass:PSPDFNoteAnnotationViewController.class]) {
        customOptions[PSPDFPresentationCloseButtonKey] = @NO;
    }
    return [super presentViewController:controller options:customOptions animated:animated sender:sender completion:completion];
}

```
---

## Related pages

- [Customizing iOS PDF viewer icons](/guides/ios/customizing-the-interface/changing-an-image-used-in-pspdfkit.md)
- [Customizing toolbar button styling on iOS](/guides/ios/customizing-the-interface/changing-the-design-of-the-default-buttons.md)

