<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSRuleEditorDelegate/ruleEditor(_:numberOfChildrenForCriterion:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSRuleEditorDelegate(im)ruleEditor:numberOfChildrenForCriterion:withRowType:"
  },
  "title" : "ruleEditor(_:numberOfChildrenForCriterion:with:)"
}
-->

# ruleEditor(_:numberOfChildrenForCriterion:with:)

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

```
@MainActor func ruleEditor(_ editor: NSRuleEditor, numberOfChildrenForCriterion criterion: Any?, with rowType: NSRuleEditor.RowType) -> Int
```

## Parameters

`editor`

The rule editor that sent the message.

`criterion`

The criterion for which the number of children is required.

`rowType`

The type of row of `criterion`.

## Return Value

The number of child items of `criterion`. If `criterion` is `nil`, return the number of root criteria for the row type `rowType`.

## Discussion

The delegate must implement this method.

---

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)