NSCollectionView indexPathForItem(at: point) returns nil for first item
Ok, nevermind. Turns out to be my fault.
For the scenario where the issue occurred I wanted to suppress the header.
Lazy as I am I just returned a plain NSView() as the header view in
func collectionView(_ collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) -> NSView
I guess not returning a properly layout-constrained view messed up the collectionView layout.
NSCollectionView renders all NSCollectionViewItems at the same point
I've never seen this problem, but here's a guess:
In CollectionViewItem
you are overriding loadView()
but it never calls super.loadView()
. CollectionViewItem
is a subclass of NSViewController
and if you override loadView()
you must first invoke super.loadView()
so the view controller can initialize its internal state.
If you're going to be targeting macOS 10.10 and later, you probably want to override viewDidLoad()
instead.
Collection View not displaying properly
i used [arrayController removeObjects:[arrayController content]];
instead of [arrayController removeObjects:[arrayController arrangedObjects]];
. i just replaced arranged objects to content.
Related Topics
How to Convert String to Date Without Time in Swift 3
Avaudiopcmbuffer Built Programmatically, Not Playing Back in Stereo
Generating Random Doable Math Problems Swift
Using Nsdate to Get Date for Easter
Need Clarification on Typealias Syntax in Swift
Why Does My Swift Bundle Get The Wrong Principal Class
Aws Cognito Credentialsprovider.Login Always Shows Nil (Swift)
Swiftui Concatenate Multiline Tappable Text
Retrieving Common Values in Firebase
Error When Running Coreml in The Background: Error Computing Nn Outputs Error
Implementing Undo and Redo in a UItextview with Attributedtext
Swift - Nsdate - Remove Part of Date
Swift 3/4 Dash to Camel Case (Snake to Camelcase)
Print Not Working in Swift 3 Extensions
How to Put Gamecenter on Application with Swift
Uibutton Borders Function Only Gives Back White Borders
Os X App Doesn't Launch New Window on Dock Icon Press in Swift
Why Does Core Data Context Object Have to Be Passed via Environment Variable