UITableView e.g. NSTableView

Ive been developing for iOS in the past and recently switched to Mac development. I started a project to โ€œfeelโ€ things and ran into a problem. I am trying to create an NSTableView to display several elements, including a label, 2 UIImageViews and a UIButton. NSTableViews are different from tables in iOS, and I can't just create my own TableViewCell (I think). A great example of how I would like to look is AlienBlue for Mac: (Medium table with message information)

AlienBlue for Mac

Can someone shed some light on how to do this?

+4
source share
2 answers

You have the option to return whole views instead of cells in NSTableViews.

Here is Apple's table-based table documentation and how to populate these views in a table .

The delegate method that I use most in my own view-based tables is " tableView:viewForTableColumn:row: "

I hope this indicates that you are in the right direction!

+5
source

Use NSCollectionView instead (set NSCollectionView.maxNumberOfColumns = 1). This is a more modern, extensible view of api, similar to UICollectionView.

In contrast, NSTableView was originally intended to display a spreadsheet table (with support for add-ins for user view cells) and is less consistent with UITableView.

+1
source

Source: https://habr.com/ru/post/1484309/


All Articles