kazui
kazui

Reputation: 141

How to create a UIView?

I'm following a tutorial (https://github.com/MrCapone/MyAdMobController-iOS) to add banner in my app, but I don't understand a thing, here:

"FOR SHOW BannerView FIRST CREATE A UIView AND ADD IT TO TOP OF ROOT UIView :

UIView *adView = [[UIView alloc] initWithFrame:adRect]; 
[[CCDirector sharedDirector].view addSubview:adView];

THEN ADD BannerView TO IT:

[[MyAdMobController sharedController] addBannerToView:adView];

where he says to create a UIView, It means that I have to create a new scene? because i don't know exactly what is a UIView (i'm a beginner), someone can give me an example of what i have to do?

Upvotes: 0

Views: 93

Answers (1)

Nils Ziehn
Nils Ziehn

Reputation: 4331

The line:

UIView *adView = [[UIView alloc] initWithFrame:adRect];

Shows you how a view is created. And no a UIVIew is not a Scene.

A view is the most simple building block of iOS interface components.. Basically just a rect angle..

Upvotes: 1

Related Questions