OSX Multiple toolbars in NSTabViewController - xcode

I have a structure which is represented in the picture below (sorry but apparently in OS Sierra Xcode does not support anymore zooming in the storyboard -.- )
Window > TabController > View Controllers
Basically what I wanted to do is to have multiple toolbars, each one for a different ViewControllers. If I were on iOS I could have set a UINavigationController as target of the TabViewController and then do whatever I wanted with the related navigation bar, but here in OSX I cannot link the TabViewController to a WindowController (which handles the toolbar), hence having a window controller per view controller.
Is there any simple workaround for that?
Or the only solution is to empty-refill the toolbar with the correct buttons every time a Tab is selected?

Related

TouchBar don't displayed NSViewController Storyboard

I use Xcode 8.2.1 on macOS 10.12.3
I try to display element on TouchBar with my NSViewController but I can't do it... I have just drag&drop the TouchBar element on my NSViewController element in my Storyboard and add a label but this label is not displayed.
You have to drag the TouchBar in the Window Controller, not the View Controller. Also make sure that your Window is initial controller.
PS
An information in some ways related with this question: when, in the view, there is a text field in focus, the standard touch bar will overwrite your customized touch bar. More information here.

NSPanel removed in Xcode 8?

In the past I can find Panel available in Interface Builder's Library, but in Xcode 8, I searched the whole library in storyboard editor, no Panel available. Has Apple just removed NSPanel or I got something wrong?
Assuming you want to add a second window (as a panel) to your storyboard, add a new window controller. Then select its window and change its class to NSPanel. In the attributes inspector you will find that your panel can then be changed to regular, utility or HUD.
For Cocoa apps, I find that Nibs/Xibs are sometimes easier to work with than storyboards.

Navigate Views in a same window in Mac OS Apps

I'm trying to build an app with two or more viewControllers contained in a single window.
Think of System Preferences, the app store, etc: you click on something, and segue to a view in the same window. You also have a back button
Problem is, I have no idea how to achieve this.
I've tried looking for navigation controllers, but those don't exist for OS X apps.
Neither has changing the type of segue.
I've thought of a workaround: superimposing views in now ViewController then setting them as Hidden or Visible, but that doesn't seem very clean...

XCode, Storyboard, View Controller items are not being displayed

When opening up a project today, there is some weird behavior in XCode. Things have disappeared in the storyboard view like the NavigationBar in viewController, the buttons associated with it, etc. I can see in the Scene list that they still exist. Is there any way to have these show up again?
You probably need to add a navigation controller to your storyboard and make your view controller the root. You cannot simply set the top bar in simulated metrics in storyboard to navigation bar.

Designing views/windows in Mac OSX first time

I am about to tackle my first Mac OSX project after developing for iOS.
In my iOS applications, it is clear to me the whole NavigationViewController->MyViewController->MyViews paradigm.
A bit more background on the iOS app so it would be easier to understand me:
The application is some sort of graphic viewer. Once you login you have a list of drawings, and if you select one, it opens it up.
Now in the iOS app I have a custom UIViewController that have some menu UI and a UIScrollView that holds a UIView in which I draw the drawing.
The custom UIViewController is responsible for acting as the "application" where the UIView inside is merely a graphic context.
Now - back to Mac:
I was thinking that my main window would show the drawings and once one is selected,
I would add another window with an NSView that is the graphic context of the drawing,
and the window will be acting as the UIViewController in the iOS app.
Does that make sense?
You can have NSViewController or NSWindowController on the Mac, to put your controller logic in. If you're going for separate windows, subclassing NSWindowController would make sense.

Resources