MRQViewController Class Reference
Inherits from | UIViewController |
---|---|
Declared in | MRQViewController.h |
Overview
Abstract base implementation of view controllers that display MobileRQ content. MRQViewControllers register for MRQ content update notification messages using NSNotificationCenter. These messages are sent by MRQSDK to tell MRQViewControllers to refresh displayed content.
MRQViewControllers use MRQViewControllerDelegate to notify the application of content view and tap events. The default implementation of MRQViewControllerDelegate is MRQViewControllerDefaultDelegate. MRQViewControllerDefaultDelegate responds to tap events by attempting to open the creative URL (if present). MRQViewControllerDefaultDelegate sends view and tap events to the MRQ backend for tracking and analytics.
MRQViewControllers can be assigned a slot by calling slotName. The slot name is used to filter content displayed in the control. If the slot name is set, only content for that slot is displayed in the control. If the slot name is not set (default), only content not assigned a slot is displayed in the control.
– refresh
Automatically called when [MRQSDK matchingContent] changes. Calls selectContent with matchingContent. If content has changed since last refresh, updates selectedContent and calls reloadContent:.
- (void)refresh
Declared In
MRQViewController.h
– selectContent:
This method implements any view-specific filtering that should occur. The passed in content array has already been filtered by MRQ using audience matching rules and locally by MRQSDK using slot matching rules.
- (NSArray *)selectContent:(NSArray *)content
Parameters
content |
array of MRQContent to be filtered |
---|
Declared In
MRQViewController.h
– reloadContent:
Called when content changes. This function should update the underlying view and display the new content.
- (void)reloadContent:(NSArray *)content
Parameters
content |
array of MRQContent from the last call to selectContent |
---|
Declared In
MRQViewController.h
slotName
Sets the slot name for this controller. Only content assigned the same slot name will be displayed. A nil value, which is the default, will only display content not assigned a slot.
@property NSString *slotName
Declared In
MRQViewController.h
selectedContent
The contents selected by the last call to refresh.
@property (readonly) NSArray *selectedContent
Declared In
MRQViewController.h
delegate
Called to notify applications of interactions with MRQContent.
@property id<MRQViewControllerDelegate> delegate
Declared In
MRQViewController.h
noContentView
This view is automatically used when there is no matching content.
@property (nonatomic) IBOutlet UIView *noContentView
Declared In
MRQViewController.h