Questions tagged [nscollectionview]

NSCollectionView is a NSView subclass which provides basic functionality for displaying, arranging, grouping and manipulating graphical representations of collections of objects.

NSCollectionView is a NSView () subclass which provides basic functionality for displaying, arranging, grouping and manipulating graphical representations of collections of objects.

Xcode 7 introduced a new API for NSCollectionView so that it can be implemented similarly to the iOS counterpart (UICollectionView). In OS X 10.11+ you can access NSCollectionView using its datasource and delegate protocols.

428 questions
33
votes
3 answers

How to create NSCollectionView programmatically from scratch?

NSCollectionView remains one of the most mysterious parts of the Cocoa API that I've ever seen. Documentation is poor and there are many moving parts, many of which are often implemented in Interface Builder, making documentation…
Tronathan
  • 6,473
  • 5
  • 22
  • 24
33
votes
9 answers

Selection Highlight in NSCollectionView

I have a working NSCollectionView with one minor, but critical, exception. Getting and highlighting the selected item within the collection. I've had all this working prior to Snow Leopard, but something appears to have changed and I can't quite…
21
votes
8 answers

Cocoa - Where is the link between a NSCollectionView and a NSCollectionViewItem? Xcode 6 Bug?

When you drag a NSCollectionView to a view, a NSCollectionViewItem appears on the storyboard, floating around. Imagine I drag several NScollectionViews to the same view. I will have a bunch of NSCollectionViewItems. How a collection view knows…
Duck
  • 34,902
  • 47
  • 248
  • 470
12
votes
3 answers

Extend selection in NSCollectionView with Shift key

I recently reviewed one of my Applications that I released a year ago. And I see that nowadays the NSCollectionView inside it has lost the selection functioning such as SHIFT + Select now it behaving as CMD + Select. (Secondary issue: I am also not…
Coldsteel48
  • 3,482
  • 4
  • 26
  • 43
12
votes
0 answers

NSCollectionView drag and drop placeholder size

I've managed to get drag and drop working on my NSCollectionView, but there are some issues with the visual appearance and behaviour. The main issue is that the drop zone / placeholder is the wrong size i.e. it's smaller than the collection view's…
Luke Rogers
  • 2,369
  • 21
  • 28
12
votes
4 answers

Unknown segue relationship: Prototype with NSCollectionView

Just by adding an NSCollectionView to Storyboard, the code won't compile with the error: Unknown segue relationship: Prototype. Is this a known bug of Swift/XCode6-beta4 or am I missing something?
user3903523
11
votes
3 answers

NSCollectionView doesn't popup context menu?

I've bounded the menu to the NSCollectionView in interface builder. But when I CTRL+click (right click) on it the menu is not showing. I've tried adding some method to the NSCollectionView subclass. None of them is invoked: + (NSMenu*)defaultMenu -…
aneuryzm
  • 63,052
  • 100
  • 273
  • 488
11
votes
2 answers

Hover Over effect in NSCollectionView

I have an NSCollectionView with a few NSViews in it. The NSView has an NSBox in it that changes color when it is selected. I want to also make the NSBox change color when hovered over. I subclassed NSBox and added the mouseEntered and mouseExited…
marcopolo
  • 1,963
  • 4
  • 18
  • 31
10
votes
3 answers

Transparent NSCollectionView Background

I'm again struggling with setting NSViews background colors to transparent. I have a NSCollectionView as part of NSClipView which is part of a NSScrollview. My MainViewController has an outlet to the collectionView. With adding the two lines of…
JFS
  • 2,992
  • 3
  • 37
  • 48
10
votes
1 answer

10.11 NSCollectionView - determining cell size dynamically

AppKit Release Notes for OS X v10.11 suggests that collection view items can be resized on a per-item basis: Item size can be determined globally for all of a CollectionView’s items (by setting an NSCollectionViewFlowLayout’s “itemSize” property),…
Etan
  • 17,014
  • 17
  • 89
  • 148
9
votes
2 answers

NSCollectionView with sections - like in iPhoto

I'd like to build a NSCollectionView similar to the one in iPhoto '11. I want to group several pictures in section, and create a section header as well. The section header of a specific section is always visible until the last element of that…
burki
  • 2,946
  • 6
  • 37
  • 51
9
votes
10 answers

How to hide NSCollectionView Scroll indicator

I have an NSCollectionView and I would like to hide the horizontal scroll indicators. I've tried collectionView.enclosingScrollView?.verticalScroller?.isHidden = true But it is not working. Thank you in advance.
Jonathanff
  • 409
  • 3
  • 12
9
votes
6 answers

NSCollectionView does not scroll items past initial visible rect

I'm running into an issue with an existing app while trying to fix a few outstanding macOS 10.13 bugs. I have a small NSCollectionView that looks similar to the small monthly calendar in the Calendar app. It displays days and scrolls vertically on…
ppilone
  • 1,082
  • 1
  • 10
  • 16
9
votes
5 answers

Filter a collection with LINQ vs CollectionView

I want to filter a ObservableCollection with max 3000 items in a DataGrid with 6 columns. The user should be able to filter in an "&&"-way all 6 columns. Should I use LINQ or a CollectionView for it? LINQ seemed faster trying some www samples. Do…
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
9
votes
1 answer

Cocoa NSCollectionView not calling dataSource methods

Having a brain fart and cannot figure out why the dataSource methods for NSCollectionView are not being called. All the samples that I'm coming across for NSCollectionView are using bindings. Even Apple's "Programming Guide" is extremely short and…
gngrwzrd
  • 5,902
  • 4
  • 43
  • 56
1
2 3
28 29