MarketingCloudSDKInboxMessagesDataSource

Objective-C

@interface MarketingCloudSDKInboxMessagesDataSource
    : NSObject <UITableViewDataSource>

Swift

class MarketingCloudSDKInboxMessagesDataSource : NSObject, UITableViewDataSource

The MarketingCloudSDKInboxMessagesDataSource is an interface object for Inbox support. It was designed to be used as the datasource for a UITableView, and can be allocated and used as such without too much other customization. Of course, you are welcomed to use it any way you want other than that.

Should you wish to customize the display of the Data Source, you should subclass from here. At that time, you may override any typical UITableViewDataSource protocol members. You will likely be the most interested in cellForRowAtIndexPath:. If you do, you can access the current message by asking the messages array for the object corresponding to your NSIndexPath row. It will be a NSDictionary object representing an Inbox object.

  • Create an instance of a basic UITableView data source to handle all loading for a simple view controller showing Inbox messages.

    Declaration

    Objective-C

    - (id _Nullable)initWithMarketingCloudSDK:(MarketingCloudSDK *_Nonnull)sdk
                                    tableView:(UITableView *_Nonnull)tableView;

    Swift

    init?(marketingCloudSDK sdk: MarketingCloudSDK, tableView: UITableView)

    Parameters

    sdk

    An instance of MarketingCloudSDK.

    tableView

    The UITableView used in the view controller. The data source will “own” population of the data and display of simple cells.

    Return Value

    An instance of MarketingCloudSDKInboxMessagesDataSource, a class which implements a simple set of methods from the UITableViewDataSource protocol.