Post

Replies

Boosts

Views

Activity

UIDragItem causes memory leak when Context Menu has been initialised
Hi! I have a CollectionView with Drag and Drop and Context Menu functionality. There's a memory leak caused by returned [UIDragItem] array in ItemsForBeginning method when I initialise cell's context menu. Objects are being kept in memory when I pop to rootViewController. All is OK though when drag session was happened. I've ended up commenting out everything, keeping blank UIDragItem and problem is still there:     func collectionView(_ collectionView: UICollectionView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) - [UIDragItem] {         let dragItem = UIDragItem(itemProvider: NSItemProvider(object: "" as NSString))         return [dragItem]     } Does anybody experience this? Looks like it's a UIKit bug... Please help!
2
0
1.3k
Sep ’22
UIDragItem causes memory leak when Context Menu has been initialised
Hi! I have a CollectionView with Drag and Drop and Context Menu functionality. There's a memory leak caused by returned [UIDragItem] array in ItemsForBeginning method when I initialise cell's context menu. Objects are being kept in memory when I pop to rootViewController. All is OK though when drag session was happened. I've ended up commenting out everything, keeping blank UIDragItem and problem is still there:     func collectionView(_ collectionView: UICollectionView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) - [UIDragItem] {         let dragItem = UIDragItem(itemProvider: NSItemProvider(object: "" as NSString))         return [dragItem]     } Does anybody experience this? Looks like it's a UIKit bug... Please help!
Replies
2
Boosts
0
Views
1.3k
Activity
Sep ’22