I wondered how I can make a
NSTableView to behave like a
UITableView on iOS. For example, splitting the content into sections as well as the typical behaviour of the section headers.
Is that possible? If so, how?
Thank you very much.
3 Solutions Collect From Internet About “UITableView-like NSTableView”
One of the differences is that UITableView’s “cells” are actually Views, while NSTableView’s are proper cells. Views suck up more memory and there’s a bit of work involved in getting NSTableView to accept views like cells, then a bit more to optimize it so that if you have a huge list it isn’t too memory intesnive.
Luckily it’s already (mostly) been done, and there’s a github project:
1) https://github.com/Perspx/PXListView#readme (also check his blog for more info)
I wasted several days on this – so you don’t have to.
There is a Twitter UI framework TwUI which they went to a lot of trouble to get their desktop clients to look and behave like the iPhone. The Appkit is showing its age these days.
The con with this library is you can’t add NSViews to their TWUIViews.
This maybe fine if you haven’t spent a lot of time creating custom nsviews.
You can try this fork which I hacked to mimic the sticky header view.
It has group based tableviews like uitableview.
It turns out Apple have a nice sample library here
And a simplified version here which demonstrates the FloatsGroupRows property with this line
which for all intents and purposes makes the nstableview / sections look like a uitableview.
The con with that is – it’s not available for cell based table views.
It is only available on View Based tableviews.
Since Microsoft have recently reversed engineered UIKit including the UITableView – in c++, it may one day someone be so kind to port this back to OSX. An exercise for the reader.
- how to change to before and after constraints when pressing button (swift code)?
- Could not load the “” image referenced from a nib
- How to get the image from uiwebview in ios
- Change UITabbar selectedItem in Swift
- calculate time taken to cover a journey in Apple Maps
- Xcode 4.2 showing the wrong line of code on error
- How can I get a view's current width and height when using autolayout constraints?
- WebKitErrorDomain error 101
- Swift – How to set cookie in NSMutableURLRequest
- Write XML in swift on iOS
- AFNetworking 2 authentication with AFHTTPRequestOperation
- How to print Boolean flag in NSLog?
- How to post data from iOS app to MySQL database?
- Can Swift return value from an async Void-returning block?
- How do I change the z index or stack order of UIView?