Skip to content

Handling clicks manually

In cases where you are building your own Content Cards UI, you can manually handle Content Card clicks.

To do this, implement the BrazeContentCardUIViewControllerDelegate protocol and set your delegate object as the delegate property of your BrazeContentCardUI.ViewController. Refer to the Content Cards UI tutorial for an example.

1
2
3
4
5
6
7
8
9
10
11
12
// Set the delegate when creating the Content Cards controller
contentCardsController.delegate = delegate

// Method to implement in delegate
func contentCard(
    _ controller: BrazeContentCardUI.ViewController,
    shouldProcess clickAction: Braze.ContentCard.ClickAction,
    card: Braze.ContentCard
  ) -> Bool {
  // Intercept the content card click action here.
  return true
}
1
2
3
4
5
6
7
8
9
10
// Set the delegate when creating the Content Cards controller
contentCardsController.delegate = delegate;

// Method to implement in delegate
- (BOOL)contentCardController:(BRZContentCardUIViewController *)controller
                shouldProcess:(NSURL *)url
                         card:(BRZContentCardRaw *)card {
  // Intercept the content card click action here.
  return YES;
}
WAS THIS PAGE HELPFUL?
New Stuff!