Skip to content

Commit 91ed8da

Browse files
committed
Updating sample app to remove IterableEmbeddedViewDelegate references
1 parent 062a3ec commit 91ed8da

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

sample-apps/swift-sample-app/swift-sample-app/EmbeddedMessages/EmbeddedMessagesViewController.swift

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class EmbeddedMessagesViewController: UIViewController {
8080
}
8181

8282
func loadCardView(_ embeddedView: IterableEmbeddedView, _ embeddedMessage: IterableEmbeddedMessage) {
83-
embeddedView.iterableEmbeddedViewDelegate = self
8483
embeddedView.primaryBtn.isRoundedSides = true
8584
embeddedView.secondaryBtn.isRoundedSides = true
8685
// We are setting the width of buttons as 140 as per our embedded messages width. You can change as per your need
@@ -93,7 +92,6 @@ class EmbeddedMessagesViewController: UIViewController {
9392
func loadBannerView(_ embeddedMessage: IterableEmbeddedMessage) {
9493
let config = IterableEmbeddedViewConfig(borderCornerRadius: 10)
9594
let embeddedView = IterableEmbeddedView(message: embeddedMessage, viewType: .banner, config: config)
96-
embeddedView.iterableEmbeddedViewDelegate = self
9795
embeddedView.primaryBtn.isRoundedSides = true
9896
embeddedView.secondaryBtn.isRoundedSides = true
9997
// We are setting the width of buttons as 140 as per our embedded messages width. You can change as per your need
@@ -123,24 +121,6 @@ class EmbeddedMessagesViewController: UIViewController {
123121
}
124122
}
125123

126-
extension EmbeddedMessagesViewController: IterableEmbeddedViewDelegate {
127-
func didPressPrimaryButton(button: UIButton, viewTag: Int, message: IterableSDK.IterableEmbeddedMessage?) {
128-
let buttonData = message?.elements?.buttons?.first
129-
let url = buttonData?.action?.data
130-
openUrl(url)
131-
}
132-
133-
func didPressSecondaryButton(button: UIButton, viewTag: Int, message: IterableSDK.IterableEmbeddedMessage?) {
134-
let buttonData = message?.elements?.buttons?[1]
135-
let url = buttonData?.action?.data
136-
openUrl(url)
137-
}
138-
139-
func didPressBanner(banner: IterableSDK.IterableEmbeddedView, viewTag: Int, message: IterableSDK.IterableEmbeddedMessage?) {
140-
openUrl(message?.elements?.defaultAction?.data)
141-
}
142-
}
143-
144124
extension EmbeddedMessagesViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
145125

146126
func collectionView(_ collectionView: UICollectionView,

0 commit comments

Comments
 (0)