<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/validModesForFontPanel:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)validModesForFontPanel:"
  },
  "title" : "validModesForFontPanel:"
}
-->

# validModesForFontPanel:

Returns the mode mask corresponding to the expected font panel mode.

```
- (NSFontPanelModeMask) validModesForFontPanel:(NSFontPanel *) fontPanel;
```

## Discussion

The mode masks are defined in <doc://com.apple.documentation/documentation/AppKit/mode-masks>.

The Font Panel has the ability to hide elements that are not applicable for a given context by having the target respond to [`validModesForFontPanel:`](/documentation/ObjectiveC/NSObject-swift.class/validModesForFontPanel:). If the target desires a font panel mode other than the standard mode mask, it must respond to this method.

This message is sent up the responder chain to the first responder implementing the method. Ideally that object should be the first responder found that also implements [`changeFont:`](/documentation/ObjectiveC/NSObject-swift.class/changeFont:).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)