I'm trying to create a custom layout for some subviews. My file is a ViewController, so I have to refer to its view as self.view. The subviews are subviews of self.view.
When I call [self layoutSubviews]; explicitly in viewDidLoad, it will execute the code in -layoutSubviews without a problem.
However, I've read that I shouldn't call -layoutSubviews explicitly, or call it on self since that's a UIViewController. I tried implementing -setNeedsLayout by calling it like this: [self.view setNeedsLayout] in viewDidLoad, and taking out the explicit call of -layoutSubviews but keeping its declaration. But that didn't seem to work.
I was linked to an article about when layoutSubviews is called and it seems like it should be called when I add subviews, but that doesn't seem to be happening here.
If I want to be safe, and do things the way it suggests in the class reference for UIView and its methods, how should I go about being able to use both methods?