我正在使用swift开发一个xcode mac应用程序。我实现了拖放文件到NSTableView,它工作得很好,除了从文件系统拖放操作之后,窗口失去了焦点。
override func performDragOperation(sender: NSDraggingInfo) -> Bool {
let thefilesNSArray = sender.draggingPasteboard().propertyListForType(NSFilenamesPboardType) as! NSArray
let theFiles = thefilesNSArray as AnyObject as! [String]
let pageDict = ["key": theFiles]
return false
}拖拽操作完成后,如何将焦点设置到App上?
发布于 2016-06-21 10:05:24
我能很容易地做这件事
我必须返回true而不是false
https://stackoverflow.com/questions/37934379
复制相似问题