Moderator

public final class Moderator

Moderator

Pass images to a moderator to get a verdict on the image content.

  • Make a moderator for images — uses nudity1 algorithm. Provided for compatibility with SDK lower than 1.4

    Declaration

    Swift

    public convenience init(config: AlgorithmConfig? = nil)

    Parameters

    config

    (optional) configuration to override algorithm defaults

  • Make a moderator for images

    Declaration

    Swift

    public convenience init(algorithm: Algorithm, config: AlgorithmConfig? = nil)

    Parameters

    algorithm

    the algorithm to use for moderation

    config

    (optional) configuration to override algorithm defaults

  • Create a StreamModerator that uses this moderator.

    Set the StreamModeratorDelegate to consume its results.

    Optionally takes a NewResultStrategy to control what the delegate is informed about.

    Declaration

    Swift

    public func createStreamModerator(resultStrategy: StreamModerator.NewResultStrategy = .decisionChanged) -> StreamModerator
  • Get a moderation decision Result (via closure) for an individual UIImage

    Declaration

    Swift

    public func moderate(_ image: UIImage, completed: @escaping (_ result: ModeratorResult) -> ())

    Parameters

    image

    the input image

    completed

    callback with result. Assume this is not on the main queue. You should schedule resulting UI updates on the main thread.

    result

    Result type containing Analysis or ModeratorError | SDKError | Error

  • Get a moderation decision for an individual UIImage as a Promise.

    Declaration

    Swift

    public func moderate(_ image: UIImage) -> Promise<ModeratorSuccess>

    Parameters

    image

    the input image

    result

    Promise containing ModeratorSuccess or ModeratorError | SDKError | Error

  • Get a moderation decision for an individual UIImage as a Promise.

    Deprecated: use moderate(_ image: UIImage) -> Promise<ModeratorSuccess> instead.

    Declaration

    Swift

    public func moderate(_ image: UIImage) -> Promise<Analysis>

    Parameters

    image

    the input image

    result

    Promise containing Analysis or ModeratorError | SDKError | Error