I want to programatically create UIViews which depend on the size of the bounds of self.view. I've put the code to create the UIViews in viewDidLayoutSubviews.
The problem is that viewDidLayoutSubviews is called multiple times when my viewController appears on screen, thus creating multiple instances of the UIView.
I'm thinking that this could be solved by using some sort of flag.
Is there a better way to do this? Should the code be put somewhere else in the view controller lifecycle?