Anu
Anu

Reputation: 1

Add same custom view multiple times

How to add same custom view as multiple times when clicking on add button. I tried to add using for loop but every times views are adding and overlapping previous views.

Upvotes: 0

Views: 117

Answers (1)

GeneCode
GeneCode

Reputation: 7588

Like this:

-(IBAction)addNewCustomView {

  YourView *view = [[YouView alloc] init];
  // view.property = set
  [self.view addSubview:view];

}

Upvotes: 1

Related Questions