Braze iOS SDK
Documentation for the Braze iOS SDK
 All Classes Functions Properties
Instance Methods | Class Methods | Properties | List of all members
ABKContentCardsTableViewController Class Reference

Instance Methods

(NSString *) - localizedAppboyContentCardsString:
 
(void) - setUp
 
(void) - setUpUI
 
(void) - setUpEmptyFeedLabel
 
(void) - setUpEmptyFeedView
 
(void) - registerTableViewCellClasses
 
(NSString *) - findCellIdentifierWithCard:
 
(ABKBaseContentCardCell *) - dequeueCellFromTableView:forIndexPath:forCard:
 
(void) - handleCardClick:
 
(void) - requestNewCardsIfTimeout
 
(void) - populateContentCards
 

Class Methods

(instancetype) + getNavigationContentCardsViewController
 

Properties

IBOutlet UIView * emptyFeedView
 
IBOutlet UILabel * emptyFeedLabel
 
id
< ABKContentCardsTableViewControllerDelegate
delegate
 
NSMutableArray< ABKContentCard * > * cards
 
BOOL disableUnreadIndicator
 
NSTimeInterval cacheTimeout
 
CGFloat maxContentCardWidth
 
BOOL enableDarkTheme
 

Method Documentation

- (ABKBaseContentCardCell *) dequeueCellFromTableView: (UITableView *)  tableView
forIndexPath: (NSIndexPath *)  indexPath
forCard: (ABKContentCard *)  card 
Parameters
tableViewThe table view which need the cell to diplay the card UI.
indexPathThe index path of the card UI in the table view.
cardThe card model for the cell.

This method dequeues and returns the corresponding card cell based on card type from the given table view.

- (NSString *) findCellIdentifierWithCard: (ABKContentCard *)  card

Given a Content Card, return its type identifier

+ (instancetype) getNavigationContentCardsViewController

This method returns an instance of ABKContentCardsTableViewController. You can call it to get a Content Cards view controller for your navigation controller.

Warning
To use a custom Content Card view controller, instantiate your own subclass instead (e.g. via alloc / init).
- (void) handleCardClick: (ABKContentCard *)  card

This method handles the user's click on the card.

If you wish to handle card clicks yourself, refer to ABKContentCardsTableViewControllerDelegate's contentCardTableViewController:shouldHandleCardClick: method.

Warning
Overriding handleCardClick: yourself might prevent ABKContentCardsTableViewControllerDelegate's contentCardTableViewController:shouldHandleCardClick: and contentCardTableViewController:didHandleCardClick: from firing properly.

If you decide to override this method, you must call [card logContentCardClicked] manually inside of your new method to send the click event to the Braze server.

- (NSString *) localizedAppboyContentCardsString: (NSString *)  key

This method returns the localized string from AppboyContentCardsLocalizable.strings file. You can easily override the localized string by adding the keys and the translations to your own Localizable.strings file.

To do custom handling with the Appboy localized string, you can override this method in a subclass.

- (void) populateContentCards

This method is called when the cards stored in the cards property should be refreshed.

- (void) registerTableViewCellClasses

Registers Content Card type identifiers with the cell classes that implement their view.

- (void) setUp

initialization that always occurs for the Content Cards table view controller

- (void) setUpEmptyFeedLabel

specific view property initialization that is in place of Storyboard or XIB initialization. Called by the setUpUI method and is exposed here to allow overriding.

- (void) setUpUI

Initialization that is in place of Storyboard or XIB initialization. This method should call all the property specific setUp methods.

Property Documentation

- (NSTimeInterval) cacheTimeout
readwriteatomic

This property defines the timeout for stored Content Cards in the Braze SDK. If the cards in the Braze SDK are older than this value, the Content Cards view controller will request a Content Cards update.

The default value is 60 seconds.

- (NSMutableArray<ABKContentCard *>*) cards
readwritenonatomicassign

This property stores the cards displayed in the Content Cards feed. By default, the view controller updates this value when it receives an ABKContentCardsProcessedNotification notification from the Braze SDK.

This field's value should not be set directly from a subclass; instead, it should be set from within a populateContentCards: implementation.

- (id<ABKContentCardsTableViewControllerDelegate>) delegate
readwritenonatomicweak
- (BOOL) disableUnreadIndicator
readwritenonatomicassign

This property allows you to enable or disable the unread indicator on the cards. The default value is NO, which will enable the displaying of the unread indicator on cards.

- (IBOutlet UIView*) emptyFeedView
readwritenonatomicstrong

UI elements which are used in the Content Cards table view. You can find them in the Content Cards Storyboard.

- (BOOL) enableDarkTheme
readwritenonatomicassign

This boolean determines if the Content Card will attempt to use dark theme colors, granted the device is in dark mode.

The default of this value is YES but can be overriden before the view controller is presented to ensure that the dark theme is disabled for any Content Card displayed.

- (CGFloat) maxContentCardWidth
readwritenonatomicassign

If set, this property overrides the maximum width of Content Cards set by the storyboard.