How can i split a nswindow? - macos

So I am trying to emulate the new cleanlymac app. It looks like it has two windows on top of each other, one without the traffic lights and the other with it, but they were treated as one. That had the ability for the back one to slip out at the beginning. Would anyone have a good idea of how this was constructed?
Here is a photo of the cleanmymac app:

They are actually ONE WINDOW.
You can easily acheive this by using vertical NSSplitView with 2 panes.
Here you can opt for divider in between or fix the splitter.
And in each of the splitViews a new NSView is placed. Here in this view you can put your views from a single or multiple xibs.
Check here for ViewOnWindow how you can show a view from another xib to your main window.
Check here for tutorial.

That looks like a custom window with the black background for the top right part of the window. Search for custom window cocoa to find examples of how to do this. I don't see the point of the custom window in this situation, you could just split the content of the window, it probable branding.

Related

How to add a background image

I have a Image View on my storyboard, and when I am trying to use it as a background. No matter what I do, it always stays on top. How would I change it so that it would be a background image, I don't care weather I do it programmatically through swift or through another way.
In the Xcode Interface Builder, you can adjust which views are in the front by selecting the view and going to Editor -> Arrange -> Send to Front, Back, etc.
This can also be done programmatically using UIView methods like bringSubviewToFront:
By moving any of item up/down you can set their layer state. The first one will be on back then second will appear on the first one then.... last one will appear on top most.
I hope this will help you.
If you decide to do it programmatically, you can modify the zPosition property of the view:
myImageView.layer.zPosition = 1
Higher numbers are closer to your face, lower numbers are closer to the screen. So to set your image view as a background, make sure the other views have higher z-positions than it.

Build a Cocoa UI for OSX

I'm trying to build a UI which look like this:
I'm using a storyboard with Xcode but I don't know how to start. I think a need different view in the window to manage button, text and tree but I don't know I to do it. I have try to use a split view but it gave me only 2 views instead of 3.
Any help in Cocoa and storyboard is welcome.
Thanks
Can't see where you'd want to use an NSSplitView but the UI you're attemting to create is trivial -
A plain NSWindow with the toolbar items configured as per your screenshot.
An NSOutlineView for the tree view with the three columns,
the content border of the window sized accordingly to make room for the label you intend to put at the bottom of the window.
As mentioned in the comments one way to populate the outline view would be to use an NSTreeController and Cocoa bindings. That's probably the only slightly more complicated bit about this UI..

Split View Controller showing only one view (Xcode 6)

I'm trying to get the split view controller working properly but apparently there's a bug in there or I'm missing something.
First of all, I've started a blank OSX Obj-C application, and in the Storyboard I've dragged the split view controller. Next, I've linked the segues from the main window controller to the split view and added two labels.
http://i.imgur.com/dlFObaF.png
When I build the project, it shows only the second page. Not to mention strange window size in the final build.
http://i.stack.imgur.com/IqRqr.png
I've tried everything.
This occurs in both vertical and horizontal split view.
Any suggestions?
I had the same issue myself today, but it's just the split line wasn't initiated properly.
To see, this, once you run your app, move your mouse toward the edge of the window and drag it, you will now see another view emerging.
To my best knowledge, I do not know how to fix this in IB or in code. Apparently NSSplitViewController does not have a property like UISplitViewControllerAutomaticDimension. Would appreciate if someone can contribute to this.
Edited: Found an answer via another thread. Basically, try to add some constraints to the subviews inside each view and that should prevent the size of a view to be zero. In my toy example, adding margin constraints to my buttons worked out well.

IOS/Xcode: storyboard screen turning black

I am just learning Xcode. I did something that caused a view controller to turn black below the navigation bar when you build app.
It looks white in storyboard.
Also, when I pull a label onto the storyboard, it aligns to the left margin and does not show the drag boxes around it.
I may have inadvertently clicked something but when I compared it in attributes and identity inspectors line by line to another project, nothing seems amiss, i.e. everything is the default value.
Has anyone run across this?
There is not code in associated class that would cause this as it is generic i.e. plain vanilla.
Would appreciate any suggestions. Thx.
With that little information i'd say you removed the root view of the controller?
Either way, you say there is no code, so I'd suggest you simply delete that controller and create another one (bottom right, objects, viewcontroller). Since it's empty you're not gonna lose any data or time :)
Then link it to your class in the Identity Inspector and you're good to go as if it was a new one.

Cocoa Cover flow using NSBrowser

I have seen quote a few examples of implementing Finder with in the app.
http://developer.apple.com/mac/library/samplecode/SourceView/
I would like to know, using the existing NSBroswer can one be able to show the same contents in a coverflow? I mean to say the horizontal navigation with the items being displayed on the top?
Thanks.

Resources