Last active
September 21, 2016 12:38
-
-
Save stevebartholomew/d42f5c87bb4ff82e06b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func tableView(tableView: NSTableView, acceptDrop info: NSDraggingInfo, row: Int, dropOperation: NSTableViewDropOperation) -> Bool { | |
var pasteboard = info.draggingPasteboard() | |
var rowData = pasteboard.dataForType(MyRowType) | |
if(rowData != nil) { | |
var dataArray = NSKeyedUnarchiver.unarchiveObjectWithData(rowData!) as! Array<NSIndexSet>, | |
indexSet = dataArray[0] | |
var movingFromIndex = indexSet.firstIndex | |
var item = items[movingFromIndex] as! String | |
// ...work to move the item | |
return true | |
} | |
else { | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment