title: How to implement google native ads in flutter using ios swift ui instead of xib
body: <p>I havent work on XIB before just use the swift View to create UI in ios but in documentation of flutter native ads for ios is only using XIB <a href="https://developers.google.com/admob/ios/native/advanced#code_example" rel="nofollow noreferrer">here</a></p>
  <p>how i can create UI on swiftUI instead of XIB for this</p>
  <p>Currently it uses this in app Delegate class to load a the nativeAdFactory</p>
  <pre><code>let listTileFactory = PageAd()
  FLTGoogleMobileAdsPlugin.registerNativeAdFactory(
               self, factoryId: &quot;listTile&quot;, nativeAdFactory: listTileFactory)
  </code></pre>
  <p>and the Page add data in XIB like this</p>
  <pre><code>class PageAd : FLTNativeAdFactory  {
      func createNativeAd(_ nativeAd: GADNativeAd,
                          customOptions: [AnyHashable : Any]? = nil) -&gt; GADNativeAdView? {
          let nibView = Bundle.main.loadNibNamed(&quot;PageAdUi&quot;, owner: nil, options: nil)!.first
          let nativeAdView = nibView as! GADNativeAdView
          
          (nativeAdView.headlineView as! UILabel).text = nativeAd.headline
          
          (nativeAdView.bodyView as! UILabel).text = nativeAd.body
          nativeAdView.bodyView!.isHidden = nativeAd.body == nil
          
          (nativeAdView.iconView as! UIImageView).image = nativeAd.icon?.image
          nativeAdView.iconView!.isHidden = nativeAd.icon == nil
          
          (nativeAdView.iconView as! UIImageView).image = nativeAd.icon?.image
          nativeAdView.iconView!.isHidden = nativeAd.icon == nil
          
          nativeAdView.callToActionView?.isUserInteractionEnabled = false
          
          nativeAdView.nativeAd = nativeAd
          
          return nativeAdView
      }
  }
  </code></pre>
  <p>so i am trying something like this but no knowledge how to call this in AppDelegate</p>
  <pre><code>struct ContentView: GADNativeAdView {
      var nativeAdView : GADNativeAd;
      func ContentView(_ nativeAd: GADNativeAd, customOptions: [AnyHashable : Any]? = nil){
          nativeAdView = nativeAd
      }
      
      var body: some View {
          Text(nativeAdView.headline)
      }
      
  
  }
  
  struct ContentView_Previews: PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  </code></pre>