The Window loses focus after Drag & Drop

295 Views Asked by At

I am working on a xcode mac app using swift. I implemented Drag & Drop files to NSTableView and it works fine except after the drag and drop operation from the file system the window loses focus.

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
}

How to i set focus to the App after the drag operation is complete?

1

There are 1 best solutions below

0
On

I am able to do it easily

i have to return true instead of false