After some codes, I have an array of image views with this code:
**var imageViews = [NSImageView]()**
and they are filled with images from a folder in my system. I want a way to use them in a collectionView as data source. Is it possible? And How?
I want a very very simple grid of them and I think collectionView is what I should use rather than gridView.
I want a simple and quick way to show the items. I cannot use a code like: collectionView.dataSource = imageviews
because after an error, Xcode suggests to do this: collectionView.dataSource = imageViews as? NSCollectionViewDataSource
and its not working.
with no error but not working. I even tried it in xib file loader and again nothing. Even 1 of them.
And what if I want o use a button to load items? In this way items will load at loading time, but I want to load them with click of a button.