Changing OSX app window size based on user input that changes views
<p>I'm trying my hand at developing an OSX app. Xcode and Swift are all new to me.</p>

<p>The defaults are all very good at modifying objects when the user changes the window size, but not so good at changing the window size when objects in the view change.</p>

<p>I've seen a couple of examples of recalculating the origin and frame size - I think the math part of it will be straight forward. However, I cannot get a working reference to the NSWindow object. click-drag will not deposit an IBOutlet for the window in any of the .swift files (AppDelegate, ViewController, custom). And typing it in doesn't bind it. </p>

<p>A simplified example of what I am trying to accomplish:
Based on user input, change the content of the display, and adjust the window size to encompass the newly modified display.
On my main storyboard
- Window Controller, segued to 
- View Controller, containing a Horizontal Slider and a Container view. The container view is segued to 
- Horizontal Split View Controller, segued to
- three repetitive instances of a View Controller.</p>

<p>When the user changes the slider bar, one or more of the three bottom most view controllers will be hidden/unhidden.</p>

<p>The attached pictures show the behavior I am looking for.</p>

<p>Imagine where the text "small group" is, there is a collection of drop down boxes, text boxes, radio buttons, etc.</p>

<p><a href="https://i.stack.imgur.com/TjXKJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TjXKJ.png" alt="Slider bar at three, see three groups"></a></p>

<p><a href="https://i.stack.imgur.com/BHGOe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BHGOe.png" alt="Slider bar at two, see two groups"></a></p>

<p><a href="https://i.stack.imgur.com/zU21b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zU21b.png" alt="Slider bar at one, see one group"></a></p>