---
title: "viewSizeChanged(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolorpickingdefault/viewsizechanged(_:)"
---

# viewSizeChanged(_:)

Tells the recever when the color panel’s view size changes in a way that might affect the color picker.

## Declaration

```swift
@MainActor func viewSizeChanged(_ sender: Any?)
```

## Parameters

- `sender`: The NSColorPanel that contains the color picker.

## Discussion

Discussion Use this method to perform special preparation when resizing the color picker’s view. Because this method is invoked only as appropriate, it’s better to implement this method than to override the method superviewSizeChanged: for the NSView in which the color picker’s user interface is contained.

## See Also

### Related Documentation

- [provideNewView(_:)](appkit/nscolorpickingcustom/providenewview(_:).md)

### Handling Events

- [alphaControlAddedOrRemoved(_:)](appkit/nscolorpickingdefault/alphacontroladdedorremoved(_:).md)
