UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on 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

4      

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

4      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

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.