IPhone : Adding UIView to UIViewController dynamically

on Thursday, April 9, 2015

I have an Array of 5 items. This array is dynamic therefore the number of items may vary.


I have aUIVIewController as shown in the following image. In my UIView, there are few components (Like buttons, etc). Based on the number of items in the above array i want to add the UIVIew to my UIViewContorlleras shown in the image.


For example: There're 5 items in the Array, then i need to add 5 UIView's to my UIViewController.


enter image description here


1.) I don't want to use a XIBfile for the UIView but want to use only StoryBoard. How can i design the UIView in StoryBoard ?


2.) How can i add UIView to the UIViewController dynamically as the number of items in the array increased ?


0 comments:

Post a Comment