title: iOS LayoutSubviews being called multiple times when a subview resizes
body: <p>In my program I have started doing all initialization of objects in the init method without setting a frame and then in layoutSubviews I set the frames for these objects to make sure that they are properly set.</p>
  
  <p>Firstly is this proper practice to initialize all objects in the init function without a set frame and then in layoutSubviews set each of their frames.  The reason for my concern is that it is called quite often.</p>
  
  <p>So I have a UIView subclass where I call these methods in the layoutSubviews</p>
  
  <pre><code>- (void)layoutSubviews 
  {
      [super layoutSubviews];
      [self.filterSwitcherView setFrame:self.viewFrame];
      [self.drawingView setFrame:self.viewFrame];
      [self.textView setFrame:self.textViewFrame];
      [self.colorPicker setFrame:self.colorPickerFrame];
  }
  </code></pre>
  
  <p>This currently works fine and all the objects are set correctly, but the problem is in my colorPicker class when the user touches the screen I adjust the frame of the colorPicker and by doing so this method gets called from the subview colorPicker and it readjusts a frame that it shouldn't since it has been modified in the subview.  The subview causes the superviews layoutSubview to be called and this is not what I need.</p>
  
  <p>My question is, is there a way to stop this behavior from happening or should I not use layoutSubviews to set frames because I was told this is a better way of making views programmatically?</p>