# 在 iOS 中实现插页式广告

> 在 iOS 应用中实现插页式广告。加载广告内容，通过 Objective-C 或 Swift 代码展示广告，并使用委托来处理广告事件。

## 插页式视频广告示例##interstitial-video-ad-example

使用 [`show`](/grow/ads/ios-sdk/ios-api.md#show) 方法展示加载的广告，并使用 [`UnityAdsShowDelegate`](/grow/ads/ios-sdk/ios-api.md#unityadsshowdelegate) 委托处理各种展示事件的逻辑。此示例使用一个按钮来触发广告：

1. **Objective-C**

   ```objective-c
   // Implement a button that calls the show method when clicked: 
   #pragma mark : 按钮
   - (IBAction)showInterstitialButton:(UIButton *)sender {
     [UnityAds show:self placementId:@"Interstitial_iOS" showDelegate:self];
   }

   // Implement callbacks for events related to the show method:
   #pragma mark:UnityAdsShowDelegate
   - (void)unityAdsShowComplete:(NSString *)placementId withFinishState:(UnityAdsShowCompletionState)state {
     NSLog(@" - UnityAdsShowDelegate unityAdsShowComplete %@ %ld", placementId, state);
   }

   - (void)unityAdsShowFailed:(NSString *)placementId withError:(UnityAdsShowError)error withMessage:(NSString *)message {
     NSLog(@" - UnityAdsShowDelegate unityAdsShowFailed %@ %ld", message, error);
     // Optionally execute additional code, such as attempting to load another ad.
   }

   - (void)unityAdsShowStart:(NSString *)placementId {
     NSLog(@" - UnityAdsShowDelegate unityAdsShowStart %@", placementId);
   }

   - (void)unityAdsShowClick:(NSString *)placementId {
     NSLog(@" - UnityAdsShowDelegate unityAdsShowClick %@", placementId);
   }
   ```

**后续步骤**：请参阅关于[在 iOS 中实现奖励广告](/grow/ads/ios-sdk/rewarded-ads.md)的文档以改进您的实现。
