Is it possible to have like a main menu based on a let's say a DialogViewController, and navigate to a OpenGL-ES based iPhoneOSGameView ?
Yes. You can even add multiple OpenGL ES views as subviews of a standard UIView.
Though you ask about iPhoneOSGameView specifically, I recommend considering GLKView available as of iOS 5. This provides some of the same features as the iPhoneOSGameView as well as some of the generated boilerplate around animation and CADisplayLink. It would also give you the option of creating the view in the Interface Builder, should you desire. Finally, it is provided by Apple to fill a similar role and, arguably, would be more aligned with future development.
I have done the reverse. In fact, MonoGame supports opening iPhoneOSGameView as the main view and displaying standard modal view controllers over top of it. This functionality is in the GamerServices section of XNA.
I think you should create a simple example, print a solid color in the game view and try presenting it over top of a standard controller.
I would think it would work fine.
Related
I'm new to cocoa development, and been trying to look for something similar in the attached image.
Basically an app with multiple views or sections or panels, where I'd link separate classes to each of them instead of one Delegate class doing everything.
I'm also confused between the old xib and the new storyboard style and wondering how can I accomplish the same, like what kind of visual objects to use. attached images explains where I'm trying to get at.
In Mac OS Cocoa it's common to just uses plain NSView objects to hierarchically subdivide complex views.
If you also want visual dividers there's NSBox. For resizable parts use NSSplitView.
Regarding the controller tier it's also pretty common to set up individual controller objects for separated panes (subviews) in a window.
You are talking about one single view. So what is possible would be to create a background view and then add multiple custom subviews (NSView subclass), each with their own custom class to control them, and even custom controllers.
As to accomplish something that looks similar to the screenshot, you can select a few UI elements in interface builder and do Embed In > Box to group them like in the screenshot.
Is there a more simple way of doing this that creating a view based outline view? (I'm working on an application for OS X)
Using an NSOutlineView is almost certainly not the approach to take.
Apple provide the disclosure triangle as a button in Interface Builder's Object Library, so this is the first bit of the puzzle.
They also provide an NSStackView within the same library:
This class was introduced recently, and the demo Apple have provided to showcase it is - serendipitously for you - a rudimentary Inspector-type view:
With the button, the stack view, and this demo, you should be able to put together whatever it is you're after.
I found this tutorial to be supremely helpful: http://jpopham.github.io/01-sidebar-swift-OSX/
I want to know how can I create custom widgets/controls in Cocoa.
Not a full tutorial, but some guidance on what to start looking into. I'm confused by custom views, Core Animation, etc. I feel lost.
I see a lot of cool looking controls, like in Reeder App, or Sparrow etc. For example:
The left side is a collapsable menu that includes animations etc. How can I achieve something similar? I thought of using a WebView + HTML + JavaScript, but that doesn't seem like a very optimized solution.
Controls are views, so if custom views confuse you, you'll need to get that figured out before moving on to custom controls. Although you should really read the entire View Programming Guide, the section called Creating a Custom View will get you started on creating your own views. Try creating a simple view that draws a circle, for example, or the time.
When you've got views figured out, move on to custom controls. Most controls work about the same way. The user touches them, and the control responds by: a) tracking the user's input, b) changing its value, c) sending its action message to its target, and d) giving the user some feedback by redrawing itself. To get started, first make sure that you know how to use controls. Reading Control and Cell Programming Topics should help, and the section titled Subclassing NSControl covers (obviously) creating your own subclasses.
The example you provided is pretty clearly Apple's Mail.app. The view on the left side of the window might be an instance of NSOutlineView, or it might be a custom class. Either way, NSOutlineView would be a good starting point if you want to duplicate that functionality. NSOutlineView is a subclass of NSTableView, which in turn is a subclass of NSControl, which in turn is a subclass of NSView. Read Outline View Programming Topics for help getting started -- tables and outlines are extremely useful, but also more complicated to use than basic controls like buttons and text fields.
I know it's only a part of the UI, but I've recently coded something similar to the sidebar. If you look though the source-code it may give you some help on learning how to use custom controls and cells.
You can check it out on Github:
https://github.com/iluuu1994/ITSidebar
I currently have to develop a system very similar to MIT's Scratch's UI. In case you don't know it, here a screenshot: http://kidconfidence.com/blogs/wp-content/uploads/2007/10/scratch1.png
Basically you have bricks in the library on the left you can drop into the window on the right side. The problem I have is that I'm new to Cocoa and not sure what would be the best way to accomplish that.
Because you can nest these bricks sometimes and other times stick them together I wonder if there is something that would help implementing that. I recognize this is not a very common interface that there are probably no implementations of that around, but maybe there are helpers for parts of this.
Regards,
Armin
Edit: switching to desktop
There are no standard cocoa controls that you could leverage for the building blocks. You will probably want to subclass NSControl to make your standard brick object.
The list on the left could be an NSTableView. The main work area can be an NSScrollView.
You probably want to use your own brick hierarchy independent of the view hierarchy because of the freeform dragging.
the app I want to create will have an interface very like Keynote, with a list of pages on the left and one page in full on the right. These kinds of interfaces are very common yet I don't know how to do them in Interface Builder.
Are there any ready-made components? Apple doesn't offer any, afaik. Or does every developer recreate this from scratch?
I only need a general idea or tutorial, no finished code.
Thanks in advance!!
If you're referring to a scrollable list of same-size thumbnails, use NSCollectionView / NSCollectionViewItem. Should be very easy: the item would just display a thumbnail image based on your document editor view's current state. In 10.6, it got some drag and drop support, if I remember correctly from WWDC '09, so you can drag-reorder your pages this way, too.
For the editor side, the collection view would only work if all your pages are the same size, as it doesn't allow for variable-sized items. If all your "pages" are the same size, though, the collection view should actually work for this too.