---
title: "presentController(withNamesAndContexts:)"
framework: watchkit
role: symbol
role_heading: Instance Method
path: "watchkit/wkinterfacecontroller/presentcontroller(withnamesandcontexts:)"
---

# presentController(withNamesAndContexts:)

Presents a page-based interface modally.

## Declaration

```swift
@MainActor @preconcurrency func presentController(withNamesAndContexts namesAndContexts: [(name: String, context: AnyObject)])
```

## Parameters

- `namesAndContexts`: An array of tuples. Each tuple must contain the following named elements:

## Mentioned in

Navigating Between Scenes

## Discussion

Discussion After calling this method, the WatchKit extension loads and initializes the new interface controllers and animates them into position on top of the current interface controller. A modal interface slides up from the bottom of the screen and completely covers the previous interface. The watchOS app displays the first interface controller in the names array initially. The user can navigate to the other interfaces by swiping horizontally. The title of the modal interface is set to the string Cancel by default. Change the title using the setTitle(_:) method. Tapping the title dismisses the interface automatically. To dismiss the interface programmatically, call the dismiss() method. Always call this method from your WatchKit extension’s main thread.

## See Also

### Presenting interface controllers modally

- [presentController(withName:context:)](watchkit/wkinterfacecontroller/presentcontroller(withname:context:).md)
- [presentController(withNames:contexts:)](watchkit/wkinterfacecontroller/presentcontroller(withnames:contexts:).md)
- [presentAlert(withTitle:message:preferredStyle:actions:)](watchkit/wkinterfacecontroller/presentalert(withtitle:message:preferredstyle:actions:).md)
- [WKAlertControllerStyle](watchkit/wkalertcontrollerstyle.md)
- [dismiss()](watchkit/wkinterfacecontroller/dismiss().md)
