TL;DR: For those who can't downgrade the SDK below 7.68.0, open the xib
as a source code and manually edit the code to set the Custom Class and to link outlets to views.
You can set the custom class to GADUnifiedNativeAdView
(or GADNativeAdView
as GADUnifiedNativeAdView
is now deprecated) by typing the class name directly to the field.
Note that you don't need to worry if the class name doesn't show up in the dropdown list. You can just type it as you can see from the below screenshot. (GADUnifiedNativeAdView
for example)

However, you can't link outlets to views (e.g., link your views to each native ad views) as you won't see the outlets in the GADUnifiedNativeAdView
as you can see from the following screenshot.

In this case, you can link the outlets by editing the view's source code.
- Complete your Native Ad layout from the interface builder.
- From the Project Navigator panel, right-click the view (
*.xib
) file and select Open As > Source Code.
- Within the
<view>
tag for the GADUnifiedNativeAdView
/ GADNativeAdView
, add the <connections>
tag and declare the outlet for each native ad views. Note that you need to reference your view's object ID from the destination
tag and generate an object ID for each outlet by yourself.
Here's an example that lays out four native ad assets (media, icon, headline and body):
<?xml version="1.0" encoding="UTF-8"?>
<document ...>
<objects>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="GADUnifiedNativeAdView">
<subviews>
<view ... id="BAF-yb-wZL" userLabel="media" customClass="GADMediaView">
...
</view>
<view ... id="U4D-Gx-1Wm" userLabel="bottom">
<subviews>
<imageView ... id="6hd-Ad-50f" userLabel="icon">
...
</imageView>
<stackView ...>
<subviews>
<label ... id="UdA-3o-ttn" userLabel="headline">
...
</label>
<label ... id="Dqe-NX-Uu2" userLabel="body">
...
</label>
</subviews>
</stackView>
</subviews>
</view>
</subviews>
<!-- TODO: Add outlet connections -->
<connections>
<outlet property="bodyView" destination="Dqe-NX-Uu2" id="GAD-Nat-Bdy"/>
<outlet property="headlineView" destination="UdA-3o-ttn" id="GAD-Nat-Hdl"/>
<outlet property="iconView" destination="6hd-Ad-50f" id="GAD-Nat-Ico"/>
<outlet property="mediaView" destination="BAF-yb-wZL" id="GAD-Nat-Mdv"/>
</connections>
</view>
</objects>
</document>
Important: You need to generate an object ID for outlets similar to others (e.g., XXX-YYY-ZZZ
), to avoid unexpected errors. I used GAD-Nat-XXX
format in the above example.
If you want to lookup the property name for each outlet, click the grey arrow button in the custom class dropdown.

Then, you'll find the property name for the outlets from its header file. (GADUnifiedNativeAdView
for example)

Important: You need to build your project at least once to make your Xcode to find the header for your custom class.
From the Project Navigator, Open the view file with the interface builder by right-clicking the view and selecting Open As > Interface Builder XIB Document.
From the connections inspector, confirm the connections that you added in the previous step. You'll see a warning icon, but you can ignore it.

- Load and display the ad.