Implement "sticky" section headers when scrolling in iOS - objective-c

This implementation is similar to a normal UITableView, but with one caveat that drasticly changes the complexity of the work in my opinion. The ask is that all section headers will be visible at all times, no matter how long the table is.
Explaining the exact UX is a little difficult, but if you follow the link below there is an interactive example of exactly what I would like to accomplish in native iOS:
http://slinky.iclanzan.com/
It is my understanding that utilizing the normal UITableView will not be enough to satisfy this case. Aside from using a mashup of multiple TableViews, ScrollViews, and/or CollectionViews, I was wondering if anyone knew of some existing libraries that already perform this implementation?
Or if anyone has any high level suggestions on how to accomplish this with custom code that would be appreciated as well (Not looking for someone to write this all out for me, just an idea would suffice).

Found a solution after working with some teammates on a POC. I'll at a high level explain the implementation.
We know that a tableview's header and footer will remain static while we scroll. Since we want our sections headers to "stick" to the bottom and top of the tableview, we mimic this by dynamically adding any section header views that would have been hidden to the tableview's own header or footer.
We do this by maintaining an array of section header views, and calculating in layoutSubviews when we need to change the tableview's header and footer.

Related

Prevent NSOutlineView (or NSTableView) from redrawing on scroll

It seems that my view-based OutlineView try to re-render text every time user scrolling. I think that was because it tried to save memory by re-using rows that fall outside of visible rectangle, then re-render new data to those old views. How can I disable this? I'm willing to sacrifice memory to archive this so that I can get better scrolling performance. (I have tried with various optimize like layer or so, but no luck).
EDIT: There is another question with same purpose as mine here How to make NSTableView not reuse TableCellViews, but no answer yet :(
I think you are confused -- it doesn't re-render the text. The table only shows views for the visible area (caveat below), and pulls in new views as you scroll -- potentially re-using old views.
You provide the view. Use the delegate method viewForTableColumn:row: and return your own cached view for a given row.
But that isn't going to prevent drawing; the view will likely still get marked dirty and draw.
I don't think you are asking the right question. It sounds like you have a performance problem. To help you with that, we'd have to see samples or instrument traces.
Caveat: Responsive Scrolling will pull in views that are in the non visible area. See the AppKit release notes about this.
corbin

Recreating the whole UICollectionView vs invalidating the UICollectionView layout on an orientation change

I have a horrible problem that is worthy of a separate stackoverflow question. Perhaps I can save time by asking a different question:
What are the downsides to recreating the whole UICollectionView layout on every device rotation rather than invalidating the UICollectionView layout with invalidateLayout?
Bare in mind that its a small view with a maximum of 6 text based cells - not a lot of data.
This question is a follow on from this one. I implemented the UICollection view and everything is working except the first two buttons inside the cells aren’t changing width on a orientation change, its a mess. Its almost like the method to update the cells is definitely being called but with the data from the last orientation view. Even after lots of debugging I'm still unsure exactly what the problem is.
Update
I managed to solve my nightmare with the information from this answer and the actual code from this answer. But if someone can still answer this question it would be helpful and interesting, I still want to know the answer!

TableView how to implement cells overlap with custom scroll

I need to implement vertical and horizontal tables with overlapped cells and custom scrolling.
It should looks like this:
Table can have many cells (about 1000), so recycling is need too.
Do you know any third party components or may be standart that can helps me. Or i need to write my custom "TableView"?
What you're describing would be very difficult in a standard UITableView, since it requires controlling the layout of individual cells. The good news is that Apple does provide an API for specifying the the layout of reusable cells in whatever manner you want; the only wrinkle being that it is for UICollectionViews, not UITableViews. If you don't need to support older versions of iOS, I would encourage you to watch the WWDC sessions on collection views, and then check out Schwa's Coverflow project for a solid implementation of a similar style layout.

Customising UITableView scrolling!

Is it possible to make the table view allow scrolling only in one section and not others OR in other words allowing scrolling only in desired sections of the grouped table?
Many thanks.
Sure, this is entirely possible if you're willing to forego the use of a tableview. If you use a scrollview, you can achieve what you want by defining custom behaviour. It's not going to be easy but here are some suggestions:
Figure out how you want it laid out on the screen
Create a "floating cell" that will hang around, this will be your "not scrolling" section
With respect to #2 above, you'll have to figure out what kind of logic you want to make that floating cell disappear versus the other data.
The rest, you're effectively reimplementing a tableview.
Now, you can probably achieve this with a tableview, but it's be hairy big time.

Changing how IKImageBrowserView indicates the drop position

I can make a single row IKImageBrowserView by setting the
[imageBrowser setContentResizingMask:NSViewWidthSizable];
but in this case while i drag an image inside image browser to rearrange it, the drop place highlights with horizontal line(vertical line expected).
how can this be changed?
Many thanks.
There is no defined way to do what you want.
You may be better off writing your own custom view where you can control every detail of how things are drawn. In general, Apple's controls are "as-is" and unless they provide an explicit way to control behavior or mention that you can custom an object in some way, don't count on being able to do it easily (if at all).
I would also suggest heading to http://bugreport.apple.com and making the enhancement request - it would be best if you attached a sample application demonstrating the behavior.
EDIT: You could also try out the NSCollectionView to see if it might work for you.