用於拖放到UICollectionView
在IOS 11貝塔4.改變處於測試1-3中的API,代碼看起來像:拖放到`UICollectionView`佔位符在IOS 11 Beta 4的
let placeholderContext = coordinator.drop(
item.dragItem,
toPlaceholderInsertedAt: indexPath,
withReuseIdentifier: "reuseID",
cellUpdateHandler: { _ in }
)
在beta 4中,引入了UICollectionViewDropPlaceholder
。我的代碼是
let placeholder = UICollectionViewDropPlaceholder(
insertionIndexPath: indexPath,
reuseIdentifier: "reuseID"
)
let placeholderContext = coordinator.drop(item.dragItem, to: placeholder)
我得到這個編譯錯誤:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_UICollectionViewDropPlaceholder", referenced from:
objc-class-ref in StickerLibraryViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: symbol(s) not found for architecture arm64
error: linker command failed with exit code 1 (use -v to see invocation)
除了沒有使用佔位符,直到測試5,任何人對如何在測試4得到這個工作的任何想法?
謝謝!
不幸的是,它沒有任何工作建築。只要將它放在#if塊中就行不通了(我所有的拖放代碼都是圍繞使用佔位符設計的)。幸運的是,進入Obj-C運行時間後,它一直運行到beta 5。 –