Read and unread indicators
Content Cards contain a blue line at the bottom of the card which indicates whether or not the card has been viewed. This article provides examples of modifying this behavior. For more information on customizing Content Cards UI attributes, refer to Customizing Feed.
Disabling the unviewed indicator
Disable the unviewed indicator line by setting the attributes.cellAttributes.unviewedIndicatorColor
property in your Attributes
struct to .clear
.
Customizing the unviewed indicator
The color of the unviewed indicator can be set by assigning a value to the tint color of your BrazeContentCardUI.ViewController
instance:
1
2
let viewController = BrazeContentCardUI.ViewController(braze: AppDelegate.braze)
viewController.view.tintColor = .systemGreen
1
2
BRZContentCardUIViewController *viewController = [[BRZContentCardUIViewController alloc] initWithBraze:AppDelegate.braze];
[viewController.view setTintColor:[UIColor systemGreenColor]];
However, if you wish to modify only the unviewed indicator, you can access the unviewedIndicatorColor
property of your BrazeContentCardUI.ViewController.Attributes
struct. If you utilize Braze’s UITableViewCell
implementations, you should access the property before the cell is drawn.
For example, to set the color of the unviewed indicator to red:
1
2
3
4
var attributes = BrazeContentCardUI.ViewController.Attributes.defaults
attributes.cellAttributes.unviewedIndicatorColor = .red
let viewController = BrazeContentCardUI.ViewController(braze: AppDelegate.braze, attributes: attributes)
Customization via Attributes
is only available in Swift.