Instance Method

initWithRules:defaultAction:

Creates a new settings instance from an array of rules and a default action.

Declaration

- (instancetype)initWithRules:(NSArray<NEFilterRule *> *)rules defaultAction:(NEFilterAction)defaultAction;

Parameters

rules

An array containing an ordered list of NEFilterRule objects. The maximum number of rules that this array can contain is 1000.

defaultAction

The NEFilterAction to take for flows of network data that don’t match any of the specified rules. The default defaultAction is NEFilterActionFilterData. If defaultAction is NEFilterActionAllow or NEFilterActionDrop, then the rules array must contain at least one NEFilterRule.

See Also

Creating Filter Settings

NEFilterRule

A rule for filters that combines a rule to match network traffic and an action to take when the rule matches.