Skip to content

Instantly share code, notes, and snippets.

@danielwestendorf
Created May 27, 2011 19:45
Show Gist options
  • Save danielwestendorf/996000 to your computer and use it in GitHub Desktop.
Save danielwestendorf/996000 to your computer and use it in GitHub Desktop.
def tableView(aView, writeRowsWithIndexes:rowIndexes, toPasteboard:pboard)
row_data_array = [] #lets create an array to place the rows' data in
rowIndexes.each do |row| #for each of the rows being dragged. Row represents the index in the table's data source array
row_data_array << table_data_array[row] #add the data to the row_data_array
end
pboard.setString(row_data_array.to_yaml, forType:"MyRowDataType") #convert the array to YAML, then store it in the pasteboard. The type should be a custom type or your choice, unless you want to accept drops from other locations.
return true #the method must return true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment