AdFormat

@objcMembers
public class AdFormat : NSObject, OptionSet

AdFormat is a class that represents different types of ad formats using an OptionSet. The class also includes a deprecated display format for backward compatibility, marked with a deprecation message.

  • The underlying type of the raw value.

    Declaration

    Swift

    public typealias RawValue = Int
  • The raw integer value representing the ad format.

    Declaration

    Swift

    public let rawValue: Int
  • The string representation of the ad format.

    Declaration

    Swift

    public private(set) var stringEquivalent: String? { get }
  • Initializes an AdFormat instance with a specified raw value and its string equivalent.

    Declaration

    Swift

    public convenience init(rawValue: RawValue, stringEquivalent: String)

    Parameters

    rawValue

    The raw value representing the ad format.

    stringEquivalent

    A string equivalent of the ad format.

  • Initializes an AdFormat instance with a specified raw value.

    Declaration

    Swift

    public required init(rawValue: RawValue)

    Parameters

    rawValue

    The raw value representing the ad format.

  • Represents a banner ad format.

    Declaration

    Swift

    public static let banner: AdFormat
  • Represents a video ad format.

    Declaration

    Swift

    public static let video: AdFormat
  • Represents a native ad format.

    Declaration

    Swift

    public static let native: AdFormat
  • Represents a deprecated display ad format.

    Declaration

    Swift

    @available(*, deprecated, message: "Display ad format is deprecated. Please, use banner ad format instead.")
    public static let display: AdFormat
  • An array containing all cases of ad formats, excluding deprecated ones.

    Declaration

    Swift

    public static var allCases: [AdFormat] { get }