AI-generated Key Takeaways
-
IMAFriendlyObstruction
allows marking specific views as "friendly" for viewability measurement, meaning they won't negatively impact ad viewability calculations. -
It requires specifying the obstructing
view
, thepurpose
of the obstruction (e.g., for navigation or a close button), and an optionaldetailedReason
. -
The optional
detailedReason
provides further context and should adhere to IAB standards (50 characters or less, alphanumeric and spaces only). -
Instances are created using the
initWithView:purpose:detailedReason:
initializer, taking the view, purpose, and detailed reason as arguments.
IMAFriendlyObstruction
@interface IMAFriendlyObstruction : NSObject
An obstruction that is marked as “friendly” for viewability measurement purposes.
-
The view causing the obstruction.
Declaration
Swift
var view: UIView { get }
Objective-C
@property (nonatomic, readonly) UIView *_Nonnull view;
-
The purpose for registering the obstruction as friendly.
Declaration
Swift
var purpose: IMAFriendlyObstructionPurpose { get }
Objective-C
@property (nonatomic, readonly) IMAFriendlyObstructionPurpose purpose;
-
Optional, detailed reasoning for registering this obstruction as friendly. If the
detailedReason
is not null, it must follow the IAB standard by being 50 characters or less and only containing charactersA-z
,0-9
, or spaces.Declaration
Swift
var detailedReason: String? { get }
Objective-C
@property (nonatomic, readonly, nullable) NSString *detailedReason;
-
Initializes a friendly obstruction.
Declaration
Swift
init(view: UIView, purpose: IMAFriendlyObstructionPurpose, detailedReason: String?)
Objective-C
- (nonnull instancetype)initWithView:(nonnull UIView *)view purpose:(IMAFriendlyObstructionPurpose)purpose detailedReason:(nullable NSString *)detailedReason;
Parameters
view
The view causing the obstruction.
purpose
The purpose for registering the obstruction as friendly.
detailedReason
Optional, detailed reasoning for registering this obstruction as friendly.
Return Value
A new IMAFriendlyObstruction instance