I wanted to understand how .refresh() method works? Do you need to add the functionality in the class PlayerNSTableController: NSViewController {} or is this an automatic thing?
Also maybe this is irrelevant but if i want to do the same in ios app, i can use table view from uikit. My main worry is how i can make additional functionality on the table for example if i want to highlight one of the rows in the table. How can i accomplish that in swiftui interfacing to appkit or uikit. Do you know?
I build systems to solve difficult problems. Expert in full-stack software development, hardware deployment, and networking computer systems in extreme environments.
Hi Hassan! I've never done any work in UIKit, so I can't speak for how similar the UIKit TableView is to the AppKit NSTableView. My impression is that generally UIKit and AppKit classes have only superficial similarities.
As for additional functionality - Honestly, I've found that NSTableView is great for simple tables, but can get fiddly if you try to skew it too far beyond Apple's vision for what constitutes a "table". The key is to use NSView as the basis for your cell views - Get comfortable with drawing custom NSViews, rather than trying to tweak something like an NSButton to suit what you're trying to do.
Overall, I would say the best option is to ditch AppKit and UIKit and work with SwiftUI. It's far easier to create fully custom tables as SwiftUI views, in my opinion. Here's some first impressions I had of SwiftUI: dev.to/hugh_jeremy/swiftui-first-i...
Thanks for the tutorial - but is it really far easier to create a fully custom table view in SwiftUI? How do you handle the column auto sizing and ability to manually resize them?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I wanted to understand how .refresh() method works? Do you need to add the functionality in the class PlayerNSTableController: NSViewController {} or is this an automatic thing?
Also maybe this is irrelevant but if i want to do the same in ios app, i can use table view from uikit. My main worry is how i can make additional functionality on the table for example if i want to highlight one of the rows in the table. How can i accomplish that in swiftui interfacing to appkit or uikit. Do you know?
Hi Hassan! I've never done any work in UIKit, so I can't speak for how similar the UIKit TableView is to the AppKit NSTableView. My impression is that generally UIKit and AppKit classes have only superficial similarities.
As for additional functionality - Honestly, I've found that NSTableView is great for simple tables, but can get fiddly if you try to skew it too far beyond Apple's vision for what constitutes a "table". The key is to use NSView as the basis for your cell views - Get comfortable with drawing custom NSViews, rather than trying to tweak something like an NSButton to suit what you're trying to do.
Overall, I would say the best option is to ditch AppKit and UIKit and work with SwiftUI. It's far easier to create fully custom tables as SwiftUI views, in my opinion. Here's some first impressions I had of SwiftUI: dev.to/hugh_jeremy/swiftui-first-i...
Thanks for the tutorial - but is it really far easier to create a fully custom table view in SwiftUI? How do you handle the column auto sizing and ability to manually resize them?