TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | May 2015 |
Maintained by Tom Baranes.
Do you want to copy iTunes NSTableView's column management? You are at the right place!
TBHideableTableViewColumns does:
And more following the needed.
This category requires Xcode 6, targeting OSX 10.7 and above. It should work for previous versions, but never tested.
TBHideableTableViewColumns requires ARC.
To use TBHideableTableViewColumns, just drag the TBHideableTableViewColumns.h and .m files into your project and import the header file in your class.
TBHideableTableViewColumns extends NSTableView using several methods.
- (void)createHideableColumnContextualMenuWithAutoResizingColumns:(BOOL)autoResizingColumns identifierException:(NSArray *)identifierException;
In order to use it, you just have to call the following method. That will set everything by automatically: refresh the last state of your NSTableView, or start listening for columns change.
The contextual menu will display your column title. If this one is nil, it will use do a NSLocalizedString
on the identifier, and display it.
Parameters:
autoResizingColumns
: pass YES if you want to display Auto-resizing all columns
in your contextual menuidentifierException
: column's identifiers you want to display permanently.- (void)hideColumnWithIdentifiers:(NSArray *)identifiers;
This method is usefull if you want to hide by default some columns. Just pass their identifiers to identifiers
- (void)resizingAllColumn;
Resize all columns to fit their contents.
TBHideableTableViewColumns is using its own bundle in order to localize its strings. Currently, it's supporting the following languages:
Feel free to add more translations.
FSI is under the Apache license. See the LICENSE file for more information.