【发布时间】:2017-07-25 03:44:27
【问题描述】:
在 iOS 11 Beta 4 中更改了用于拖放到 UICollectionView 的 API。在 beta 1-3 中,代码如下所示:
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)
除了在 beta 5 之前不使用占位符之外,还有人知道如何在 beta 4 中使用这个占位符吗?
谢谢!
【问题讨论】:
标签: ios drag-and-drop uicollectionview ios11