---
title: NSRuleEditor
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsruleeditor
---

# NSRuleEditor

An interface for configuring a rule-based list of options.

## Declaration

```swift
class NSRuleEditor
```

## Overview

Overview A rule editor lets the user visually create and configure a list of options that are expressed as a predicate (as described in Predicate Programming Guide). Each row displayed by the rule editor represents a particular path down a tree of choices. The rule editor’s delegate provides the tree of choices to be displayed. The rule editor presents those choices to the user as a row of popup buttons, static text fields, and custom views. NSRuleEditor exposes one binding, rows. You can bind rows to an ordered collection (such as an instance of NSMutableArray). Each object in the collection should have the following properties: note: If you override viewDidMoveToWindow() in a subclass of NSRuleEditor, you must invoke super’s implementation.

## Topics

### Configuring the Delegate

- [delegate](appkit/nsruleeditor/delegate.md)
- [NSRuleEditorDelegate](appkit/nsruleeditordelegate.md)

### Configuring a Rule Editor

- [isEditable](appkit/nsruleeditor/iseditable.md)
- [nestingMode](appkit/nsruleeditor/nestingmode-swift.property.md)
- [NSRuleEditor.NestingMode](appkit/nsruleeditor/nestingmode-swift.enum.md)
- [canRemoveAllRows](appkit/nsruleeditor/canremoveallrows.md)
- [rowHeight](appkit/nsruleeditor/rowheight.md)

### Working with Formatting

- [formattingDictionary](appkit/nsruleeditor/formattingdictionary.md)
- [formattingStringsFilename](appkit/nsruleeditor/formattingstringsfilename.md)

### Providing Data

- [reloadCriteria()](appkit/nsruleeditor/reloadcriteria().md)
- [setCriteria(_:andDisplayValues:forRowAt:)](appkit/nsruleeditor/setcriteria(_:anddisplayvalues:forrowat:).md)
- [criteria(forRow:)](appkit/nsruleeditor/criteria(forrow:).md)
- [displayValues(forRow:)](appkit/nsruleeditor/displayvalues(forrow:).md)

### Obtaining Row Information

- [numberOfRows](appkit/nsruleeditor/numberofrows.md)
- [parentRow(forRow:)](appkit/nsruleeditor/parentrow(forrow:).md)
- [row(forDisplayValue:)](appkit/nsruleeditor/row(fordisplayvalue:).md)
- [rowType(forRow:)](appkit/nsruleeditor/rowtype(forrow:).md)
- [NSRuleEditor.RowType](appkit/nsruleeditor/rowtype.md)
- [subrowIndexes(forRow:)](appkit/nsruleeditor/subrowindexes(forrow:).md)

### Working with the Selection

- [selectedRowIndexes](appkit/nsruleeditor/selectedrowindexes.md)
- [selectRowIndexes(_:byExtendingSelection:)](appkit/nsruleeditor/selectrowindexes(_:byextendingselection:).md)

### Manipulating Rows

- [addRow(_:)](appkit/nsruleeditor/addrow(_:).md)
- [insertRow(at:with:asSubrowOfRow:animate:)](appkit/nsruleeditor/insertrow(at:with:assubrowofrow:animate:).md)
- [removeRow(at:)](appkit/nsruleeditor/removerow(at:).md)
- [removeRows(at:includeSubrows:)](appkit/nsruleeditor/removerows(at:includesubrows:).md)

### Working with Predicates

- [predicate](appkit/nsruleeditor/predicate.md)
- [reloadPredicate()](appkit/nsruleeditor/reloadpredicate().md)
- [predicate(forRow:)](appkit/nsruleeditor/predicate(forrow:).md)

### Supporting Bindings

- [rowClass](appkit/nsruleeditor/rowclass.md)
- [rowTypeKeyPath](appkit/nsruleeditor/rowtypekeypath.md)
- [subrowsKeyPath](appkit/nsruleeditor/subrowskeypath.md)
- [criteriaKeyPath](appkit/nsruleeditor/criteriakeypath.md)
- [displayValuesKeyPath](appkit/nsruleeditor/displayvalueskeypath.md)

### Notifications

- [rowsDidChangeNotification](appkit/nsruleeditor/rowsdidchangenotification.md)

### Structures

- [NSRuleEditor.RowsDidChangeMessage](appkit/nsruleeditor/rowsdidchangemessage.md)

## Relationships

### Inherits From

- [NSControl](appkit/nscontrol.md)

### Inherited By

- [NSPredicateEditor](appkit/nspredicateeditor.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSAnimatablePropertyContainer](appkit/nsanimatablepropertycontainer.md)
- [NSAppearanceCustomization](appkit/nsappearancecustomization.md)
- [NSCoding](foundation/nscoding.md)
- [NSDraggingDestination](appkit/nsdraggingdestination.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSStandardKeyBindingResponding](appkit/nsstandardkeybindingresponding.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)
- [NSUserInterfaceItemIdentification](appkit/nsuserinterfaceitemidentification.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Controls

- [Responding to control-based events using target-action](uikit/responding-to-control-based-events-using-target-action.md)
- [NSButton](appkit/nsbutton.md)
- [NSColorWell](appkit/nscolorwell.md)
- [Combo Box](appkit/combo-box.md)
- [NSComboButton](appkit/nscombobutton.md)
- [Date Picker](appkit/date-picker.md)
- [NSImageView](appkit/nsimageview.md)
- [NSLevelIndicator](appkit/nslevelindicator.md)
- [Path Control](appkit/path-control.md)
- [NSPopUpButton](appkit/nspopupbutton.md)
- [NSProgressIndicator](appkit/nsprogressindicator.md)
- [NSPredicateEditor](appkit/nspredicateeditor.md)
- [Search Field](appkit/search-field.md)
- [NSSegmentedControl](appkit/nssegmentedcontrol.md)
- [Slider](appkit/slider.md)
