Initializer

init(types:)

Initializes and returns a data detector instance.

Declaration

init(types checkingTypes: NSTextCheckingTypes) throws

Parameters

checkingTypes

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

error

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.

Discussion

Currently, the supported data detectors checkingTypes are: date, address, link, NSTextCheckingTypePhoneNumber, and NSTextCheckingTypeTransitInformation.

See Also