Re: Dynamically change NSCollectionView items based on view width
Re: Dynamically change NSCollectionView items based on view width
- Subject: Re: Dynamically change NSCollectionView items based on view width
- From: Demitri Muna <email@hidden>
- Date: Sun, 07 Apr 2019 17:12:10 -0400
Hi Mike,
On Apr 7, 2019, at 4:20 PM, Mike Abdullah <email@hidden> wrote:
> The obvious first question to me is: is your notification actually firing?
Yes, it fires upon every frame change so I know exactly when the view’s width
becomes is less than my threshold. I am observing changes in
self.view.superview where “self" is my view controller, “self.view” is the
scroll view containing the clip view and collection view.
What is strange is that when I place a breakpoint in the block (from
observerForName:object:queue:usingBlock) both
collectionView.indexPathsForVisibleItems and collectionView.visibleItems return
empty arrays, despite the fact I can see the items in the view. I had also
thought to try deleting the items (via deleteItemsAtIndexPaths:) and adding
them again, and reloadItemsAtIndexPaths: providing paths for the two items in
the view. Nothing is triggering
collectionView:itemForRepresentedObjectAtIndexPath: again.
Cheers,
Demitri
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden