I have trouble accessing the stringValue of a textLabel in a xib-file, that I use for my generic NSCollectionViewItem.
Registering collectionView from xib-file:
override func viewDidLoad() {
super.viewDidLoad()
let item = NSNib(nibNamed: NSNib.Name("collectionViewItem"), bundle: nil)
collectionView.register(item, forItemWithIdentifier: NSUserInterfaceItemIdentifier("collectionViewItem"))
collectionView.delegate = self
collectionView.dataSource = self
}
Making NSCollectionViewItem:
func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
let item = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier("collectionViewItem"), for: indexPath)
// Here I want to access the stringValue of the textLabel within my collectionViewItem.
return item
}
Any ideas as to how I could create a reference to this textLabel and manipulating it?