FREE TRIAL: Accelerate your app development career with Hacking with Swift+! >>

Hacking with MacOs project7 Drag and drop

Forums > macOS

Hi , In Hacking with MacOs in the drag and drop part ( page 392 ) I do not understand why the CollectionView needs to be updated in this way: // 6. update the array and collection view photos.insert(destinationURL, at: indexPath.item) ctaollectionView.insertItems(at: [indexPath])

And not simply by doing collectionView.reloadData() I would have thought that is was for performance reasons, but it just does not work and I cannot figure out why. Regards Etienne


Hacking with macOS is a complete coding series that teaches macOS ... You learn Swift whilst you're making actual macOS initiatives with AppKit and SwiftUI, so that you can apply ... Meet NSCollectionView for the primary time, then upload drag and drop picture


Hacking with Swift is sponsored by Sentry

SPONSORED With Sentry’s error and performance monitoring for iOS you see mobile vitals that actually matter, can solve any latency issues quickly, and learn how each release is performing over time.

Get started

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.