Topics

How to Initial Views using Manual Layout?

Dave
 

XCode 11
Mac

Hi,

I have the following view hierarchy in a Storyboard file

Window->RootView-BottomView->BoardView->CellView1
Window->RootView-BottomView->BoardView->CellView2
Window->RootView-BottomView->BoardView->CellView3
…..
…..
Window->RootView-BottomView->BoardView->CellView81

I’m laying out the view manually because it is so much easier than using Auto Layout and I had no luck on making it work anyway.

I’m overriding in all classes:

-(void) resizeWithOldSuperviewSize:(NSSize) theOldSuperViewSize

Which handles the resizing.


However when the Window/WindowController is first display from the storyboard the View Hierarchy is not initialised and the Initial view window content is as it was in the Storyboard file (all over the place!), Also I’m using “Flipped” coordinates (isFlipped = YES) and so it appears bottom up instead of top down.

If I resize the window, everything snaps into place nicely! How can I initialise the View System so that it appears ok when the Window it first displayed?

Thanks a lot for any help.
All the Best
Dave