SBSDKTextLayoutRecognizer

@interface SBSDKTextLayoutRecognizer : NSObject

A helper class to determine the orientation of text in an image.

  • Synchronously recognizes the text orientation on an UIImage.

    Declaration

    Objective-C

    - (SBSDKTextOrientation)recognizeTextOrientationOnImage:
        (nonnull UIImage *)image;

    Swift

    func recognizeTextOrientation(on image: UIImage) -> SBSDKTextOrientation

    Parameters

    image

    The image to recognize the text orientation on.

    Return Value

    The recognized text orientation.

  • Synchronously recognizes the text orientation on an UIImage and evaluates the recognizers confidence value.

    Declaration

    Objective-C

    - (SBSDKTextOrientation)recognizeTextOrientationOnImage:(nonnull UIImage *)image
                                             withConfidence:
                                                 (float)requestedConfidence;

    Swift

    func recognizeTextOrientation(on image: UIImage, withConfidence requestedConfidence: Float) -> SBSDKTextOrientation

    Parameters

    image

    The image to recognize the text orientation on.

    requestedConfidence

    The minimum confidence value required to return a valid result.

    Return Value

    The recognized text orientation.

  • Synchronously recognizes the text orientation on an image at the given URL.

    Declaration

    Objective-C

    - (SBSDKTextOrientation)recognizeTextOrientationOnImageURL:
        (nonnull NSURL *)imageURL;

    Swift

    func recognizeTextOrientation(onImageURL imageURL: URL) -> SBSDKTextOrientation

    Parameters

    imageURL

    The file url of the image to recognize the text orientation on.

    Return Value

    The recognized text orientation.

  • Synchronously recognizes the text orientation on an image at the given URL and evaluates the recognizers confidence value.

    Declaration

    Objective-C

    - (SBSDKTextOrientation)
        recognizeTextOrientationOnImageURL:(nonnull NSURL *)imageURL
                            withConfidence:(float)requestedConfidence;

    Swift

    func recognizeTextOrientation(onImageURL imageURL: URL, withConfidence requestedConfidence: Float) -> SBSDKTextOrientation

    Parameters

    imageURL

    The file url of the image to recognize the text orientation on.

    requestedConfidence

    The minimum confidence value required to return a valid result.

    Return Value

    The recognized text orientation.

  • Asynchronously recognizes the text layout on an UIImage.

    Declaration

    Objective-C

    - (void)recognizeLayoutOnImage:(nonnull UIImage *)image
                        completion:(nonnull void (^)(
                                       SBSDKTextLayoutRecognizerResult *_Nullable,
                                       NSError *_Nullable))completion;

    Swift

    func recognizeLayout(on image: UIImage) async throws -> SBSDKTextLayoutRecognizerResult

    Parameters

    image

    The image to recognize the text layout on.

    completion

    The completion block that is called when the operation has finished. Delivers either the result or an error as a parameter to the main thread.

  • Asynchronously recognizes the text layout on an image at the specified file URL.

    Declaration

    Objective-C

    - (void)recognizeLayoutOnImageURL:(nonnull NSURL *)imageURL
                           completion:
                               (nonnull void (^)(
                                   SBSDKTextLayoutRecognizerResult *_Nullable,
                                   NSError *_Nullable))completion;

    Swift

    func recognizeLayout(onImageURL imageURL: URL) async throws -> SBSDKTextLayoutRecognizerResult

    Parameters

    imageURL

    The file url of the image to recognize the text layout on.

    completion

    The completion block that is called when the operation has finished. Delivers either the result or an error as a parameter to the main thread.