---
title: layout()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsalert/layout()
---

# layout()

Specifies that the alert must do immediate layout instead of lazily just before display.

## Declaration

```swift
func layout()
```

## Discussion

Discussion You need to call this method only when you need to customize the alert’s layout. Call this method after all the alert’s attributes have been customized, including the suppression checkbox and the accessory layout. After the method returns, you can make the necessary layout changes; for example, adjusting the frame of the accessory view. note: The standard alert layout is subject to change in future system software versions. Therefore, if you rely on custom alert layout, you should make sure your layouts work as expected in future releases of  macOS.

## See Also

### Configuring Alerts

- [alertStyle](appkit/nsalert/alertstyle.md)
- [accessoryView](appkit/nsalert/accessoryview.md)
- [showsHelp](appkit/nsalert/showshelp.md)
- [helpAnchor](appkit/nsalert/helpanchor.md)
- [delegate](appkit/nsalert/delegate.md)
