Instance Method


Initializes and returns a data detector instance.


- (instancetype)initWithTypes:(NSTextCheckingTypes)checkingTypes error:(NSError * _Nullable *)error;



The checking types. The supported checking types are a subset of the types NSTextCheckingType. Those constants can be combined using the C-bitwise OR operator.


An out parameter that if an error occurs during initialization contains the encountered error.

Return Value

Returns the newly initialized data detector. If an error was encountered returns nil, and error contains the error.


Currently, the supported data detectors checkingTypes are: NSTextCheckingTypeDate, NSTextCheckingTypeAddress, NSTextCheckingTypeLink, NSTextCheckingTypePhoneNumber, and NSTextCheckingTypeTransitInformation.

See Also

Creating Data Detector Instances

+ dataDetectorWithTypes:error:

Creates and returns a new data detector instance.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software