First Steps with SwiftUI
iOS Classic - First Steps with SwiftUI
This page describes how to install Taboola dependencies in your SwiftUI project.
While reading the documentation, take a look at our Sample App.
Add the Taboola SwiftUI Umbrella package
The Taboola SwiftUI Umbrella package provides pre-built SwiftUI components that simplify the integration.
Using your preferred method, add the Taboola SwiftUI Umbrella package:
Method I:
- In
Xcode, selectFile>Add Package Dependencies...A modal dialogue displays.
- In the search box (top, right), enter the URL:
{user.spm_url}.Information about the Taboola SDK package is shown.
- Select a
Dependency Rule(top, right) - e.g.Up To Next Major Version. - Click on
Add Package(bottom, right).The package tree displays in the Project navigator pane, under
Package Dependencies.
Method II:
Add the dependency to Package.swift - e.g.:
dependencies: [
.package(url: "{user.spm_url}", .upToNextMajor(from: "{user.iosV4Version}"))
]The package tree
The Taboola SwiftUI Umbrella package provides pre-built SwiftUI components that simplify the integration. Take a moment to review them in the Project navigator pane:
Note the following components:
ClassicUnitSwiftUI- A SwiftUI wrapper for Classic SDK placementsWebUnitSwiftUI- A SwiftUI wrapper for Web SDK placementsNativeUnitSwiftUI- A SwiftUI wrapper for Native SDK placements- Protocols and Helpers - Supporting types for integration
Add the skAdNetwork ID
Edit Info.plist in a text editor and add the skAdNetwork ID for Taboola:
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>p4ybsjem3u.skadnetwork</string>
</dict>
</array>
Need a hand?Go ahead! Ask a question in our Support Forum.
Tip: Provide as much detail as possible, including your platform and SDK version.
Updated 6 days ago
