I'm trying to create a iPhoto like application, where using an array of objects I want to display a thumb along with a title at the bottom of each thumb. How do I display objects like iPhoto does?
Have a look at NSCollectionView / NSCollectionViewItem.
There is another tool palette in Interface Builder called Image Kit. You have to enable the plugin in IB's preferences (the Plug-ins palette). Then, under the object library, select the Image Kit to see the controls it offers. IKImageBrowserView gives you a ready-made control (with the ability to show titles) but I don't think it's as flexible as NSCollectionView/Item.
Related
I am interested in creating a video editor similar to iMovie on macOS. The scrubber is an interesting component, and I am wondering if anyone knows what control is used to create it.
My personal guess is that it is NSCollectionView.
It is a custom view. It is a subclass of TLKTimelineView called CETimelineView that is embedded in a custom scroll view called LKScrollView.
This makes sense as the video has to be in sync with the timeline, audio and video. Would require a highly optimized control. You can debug the view in xCode.
I am Trying to Create a NSComboBox like the image attached with the list of Fonts. Any body knows and custom special control is available.
I have kept the image in dropbox
I see you're new to SO. You say "I'm trying to create", what have you tried? In general on SO you should show what you've attempted, what did not work, what piece of information eluded you, etc.
Here's some information to get you started:
NSComboBox justs takes "objects" and says it will display "common value classes" (ref). Have you tried NSAttributedString?
NSFontManager has a method availableFonts
You can use those to quickly produce a menu of styled font names, it probably won't be what you want but it will be a start.
Note that on a Mac the recommended ways to select fonts are standard Font menus and the Font Panel (NSFontPanel), do you really want to mimic a Windows UI for a Mac app?
HTH
Swift 5.0 🔸
let fonts = NSFontManager.sharedFontManager().availableFonts();
//Then add this array to an NSComboBox component, programtatically or via XCode-Interface-builder
When one uses the Interface Builder to arrange the UI Components, there is an option where you have to click to resize or arrange all UI components (buttons, labels, etc.) to fit the view. What is this feature called? And how can you do this programmatically?
I think you are referring to the autoresizingMask property for a UIView.
Have a look at the documentation
I was wondering what the best way of selecting photos from iPhoto within a cocoa application? Right now, the open file dialogue doesn't allow me to go into the iPhoto library. How can I allow the user to go into that folder? IKPictureTaker was one option, but it appears that it allows the selection of one picture at a time. I'd like a user to be able to select 1 picture, or many.
Just use NSOpenPanel and set the allowed file types to the public.image UTI:
[panel setAllowedFileTypes:[NSArray arrayWithObject:#"public.image"]];
This will automatically add a Media section and Photos item to the sidebar in the open panel that allows the user to select from their iPhoto library.
Alternatively, you can use Karelia's open-source iMedia Browser.
There is a private API of Apple that contains exactly the control you want; this control is an ILMediaBrowserView and provides the exact same view than the one in NSOpenDialog.
If you are planning an AppStore release of your app don't use it but it can be useful.
The framework to integrate to your project to get that view is iLifeMediaBrowser.framework in /System/Library/PrivateFrameworks.
Let's all hope Apple brings the same view in the documented IK.
Several iLife '11 applications on the Mac use iOS-style black toolbars. For instance, the toolbar at the bottom of this screenshot of iPhoto:
(source: pocket-lint.com)
This sort of look is available in the iOS SDK as "UITabBar."
I am wondering if there is an easy way to achieve this in my ordinary, non-iOS Mac application. If not, what would be the best way to go about creating this effect?
There's nothing that will give you this view out of the box. You'll need to build it yourself.
The simplest method would be to create a custom view with a gradient background and place monochrome buttons in it.
Better would be to create a set of classes similar to NSToolBar that handle positioning, highlighting etc. Even better, build it and then open-source it :-)
However, you'll have to build it yourself. Apart from NSButton there's not much that will help in the pre-existing objects.