/
Swift UI
Swift UI
To add AdPlayer on a SwiftUI page wrap AdPlayerPlacementView
with a class that conforms UIViewRepresentable
protocol
And then use it as a regular SwiftUI View
import SwiftUI
struct BasicExample: View {
let tagId: String
var body: some View {
AdPlacementView(
tagId: tagId,
animation: .default
)
.padding(.vertical, 1)
.border(.green, width: 1)
}
}
Please find the complete example here:
SwiftUI example
, multiple selections available,
Related content
Interstitial - iOS
Interstitial - iOS
More like this
[Older versions < 1.11.0] Displaying a Player
[Older versions < 1.11.0] Displaying a Player
More like this
Displaying a Player - UIKit
Displaying a Player - UIKit
More like this
Observing Player Events
Observing Player Events
More like this
Displaying A Player - Flutter
Displaying A Player - Flutter
More like this
AdPlayerTag APIs - iOS
AdPlayerTag APIs - iOS
More like this