开发笔记应用:从附件处理到iCloud集成
在开发笔记应用时,我们需要处理各种功能,包括附件的展示与打开、支持JSON附件、实现拖放添加附件、添加QuickLook功能以及集成iCloud等。下面将详细介绍这些功能的实现步骤。
1. 附件展示与打开
首先,我们需要实现附件在集合视图中的展示和打开功能。以下是相关代码:
func collectionView(collectionView: NSCollectionView,
itemForRepresentedObjectAtIndexPath indexPath: NSIndexPath)
-> NSCollectionViewItem {
// Get the attachment that this cell should represent
let attachment = self.attachedFiles![indexPath.item]
// Get the cell itself
let item = collectionView
.makeItemWithIdentifier("AttachmentCell", forIndexPath: indexPath)
as! AttachmentCell
// Display the image and file extension in the cell
item.imageView?.image = attachment.thumbnailImage
item.textField?.stringV
超级会员免费看
订阅专栏 解锁全文
24

被折叠的 条评论
为什么被折叠?



