Last active
November 3, 2018 13:10
-
-
Save nicklockwood/35bc1734f2f8c97177010b1188345921 to your computer and use it in GitHub Desktop.
Simplified.swift
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, objectValueFor tableColumn: NSTableColumn?, row: Int) -> | |
guard let obj = (self.representedObject as? ModelType)?.collection(at:row) else { | |
return nil | |
} | |
switch tableColumn?.identifier.rawValue ?? "" { | |
case "column1": | |
return obj.field1 | |
case "column2": | |
return objc.field2 | |
//... | |
default: | |
return nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment