简体   繁体   English

封装iAd实施?

[英]encapsulate iAd implementation?

I have been doing a lot of cut-and-paste programming to put iAd into different apps. 我一直在进行很多剪切和粘贴编程,以将iAd放入不同的应用程序中。 Is it possible to encapsulate it somehow? 是否可以以某种方式封装它?

Of course. 当然。

You can create a view controller, and the view it manages is the iAd view. 您可以创建一个视图控制器,它管理的视图是iAd视图。

Have this view controller implement the iAd delegate protocols and then you can create an instance of this view controller and add its view as subviews of other views throughout your app. 让该视图控制器实现iAd委托协议,然后您可以创建该视图控制器的实例,并将其视图添加为整个应用中其他视图的子视图。

Simples :) 简单:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM