<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSRuleEditorDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSRuleEditorDelegate"
  },
  "title" : "NSRuleEditorDelegate"
}
-->

# NSRuleEditorDelegate

The `NSRuleEditorDelegate` protocol defines the optional methods implemented by delegates of [`NSRuleEditor`](/documentation/AppKit/NSRuleEditor) objects.

```
protocol NSRuleEditorDelegate : NSObjectProtocol
```

## Topics

### Providing Data

[`ruleEditor(_:child:forCriterion:with:)`](/documentation/AppKit/NSRuleEditorDelegate/ruleEditor(_:child:forCriterion:with:))

Returns the child of a given item at a given index.

[`ruleEditor(_:displayValueForCriterion:inRow:)`](/documentation/AppKit/NSRuleEditorDelegate/ruleEditor(_:displayValueForCriterion:inRow:))

Returns the value for a given criterion.

[`ruleEditor(_:numberOfChildrenForCriterion:with:)`](/documentation/AppKit/NSRuleEditorDelegate/ruleEditor(_:numberOfChildrenForCriterion:with:))

Returns the number of child items of a given criterion or row type.

[`ruleEditor(_:predicatePartsForCriterion:withDisplayValue:inRow:)`](/documentation/AppKit/NSRuleEditorDelegate/ruleEditor(_:predicatePartsForCriterion:withDisplayValue:inRow:))

Returns a dictionary representing the parts of the predicate determined by the given criterion and value.

[`NSRuleEditor.PredicatePartKey`](/documentation/AppKit/NSRuleEditor/PredicatePartKey)

These strings are used as keys to the dictionary returned from the delegate’s [`ruleEditor(_:predicatePartsForCriterion:withDisplayValue:inRow:)`](/documentation/AppKit/NSRuleEditorDelegate/ruleEditor(_:predicatePartsForCriterion:withDisplayValue:inRow:)) optional method. To construct a valid predicate, the union of the dictionaries for each item in the row must contain the required parts.

### Monitoring Row Changes

[`ruleEditorRowsDidChange(_:)`](/documentation/AppKit/NSRuleEditorDelegate/ruleEditorRowsDidChange(_:))

Notifies the receiver that a rule editor’s rows changed.



---

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)