iOS Multiple Scrolling Sections - Right way - ios

i have question regarding one screen which i should implement in app, as iOS giving us various possibilities i don't know which one is the best practice for this current task.
Sections as visible on the screen should scroll and while we select one of them, should show unique data.
Scrolling Data Is Static.
My ideas:
1) Create multiple tableView's to support scrolling and get button actions.
2) Using the scrollView - programmatically add buttons on scrollview with multiple IBActions.
3) Modify UIPickerController to support such template.
As i mention there are lot of options and maybe i have missed more, but question is: In which way you would finish this tasks and how do you think is right way to handle such a design because on iPhone 5s we know that this UIView will be resized and will be smaller so UIView should be inserted in ScrollView itself.

Related

UICollectionView sticky supplementary view

Assuming I'm on a chat scenario, I want user images to move along with scroll until the other user's messages appear. Some visual example:
I'm using a subclass of UICollectionViewFlowLayout to display the messages and provide that initial left offset for the messages (the sectionInset property is not working on iOS 9 for some reason) and I assumed handling a custom supplementary view to do what's shown above should not be that hard, but apparently it is :)
Some info:
I'm not using standard header/footers for flowLayout since it add a space between sections that I don't want
Found this link which is pretty interesting from performance perspective but the example is somehow incomplete (great post though)
I'm trying to avoid shouldInvalidateLayoutForBoundsChange: to return true and recreate attributes every time since chat cells can be complex in terms of size calculation.
I believe this is not a weird scenario, have anyone accomplish something like this successfully? If so, I would appreciate some pointers.
Thank you in advance.
you can use sections for each cell groups. When using sections they have to be a clear background and be customized. So message cells can be scrolled below sections and circle images on section will be on top of its cells.
As a second way, you can use circle images apart from all collection items. For this, you have to create circle images that how many required. While scrolling up/down, they have to be moved as they will be anchored on top of message cells group.
I hope it helps for you :)

Multitasking - Should I go for UICollectionView or UITableView?

My requirement is basically listing some details of an employee.
So, it is a list of 100s of employees.
The app is an iPad landscape application. The screen will look somewhat as follows.
I was thinking of a UITableView with a custom cell, that contain labels horizontally arranged on it as per my client's requirement.
But on considering the multitasking in iOS 9, I now face an issue in using this as I will not be able to maintain the same layout if the view reduce to 1/3rd or 1/2.
Now the best option I can think of is to use a UICollectionView with the labels shown as rows. That is something as follows:
I would like to get your suggestions on this and the best practises to be considered on designing a similar layout.

scrollsToTop and multiple scrollViews on-screen

I'm currently working on an iPad app that should feature two UITableViews side-by-side (unfortunately, they can't be combined into a single one for some specific reasons).
As far as I know, scrollsToTop won't work properly for both of them, since only one scrollView should have this property enabled at a time. The thing, the app could really use this feature for both tableViews, but I haven't figured out how to do it.
Is there any workaround that would allow me to have scrollsToTop enabled and working for both of them? Or maybe disabling it on both and then listening for touches on the status bar so the app can determine above which tableView they happen and scroll as appropriately? Or any other clever solutions?
Edit: tableViews shouldn't scroll up together. Each should scroll only if the tap on the status bar is right above them (just like if we had two iPhones side by side, for the lack of a better example).
If you have many scrollviews this category is really useful.
-[UIScrollView makeOnlyThisScrollViewScrollToTopOnStatusBarTap];
https://gist.github.com/hfossli/6776203
It basically sets scrollsToTop to NO on all other scrollViews than the one you are specifying + taking care of the default value.
There's a scroll view delegate method scrollViewShouldScrollToTop:. Implement the method on one table view and in the method body tell the other one to also scroll to the top (probably with setContentOffset:animated:).

UITableView vs UIScrollView

I am working on an animation application. I would like to have an horizontal UITableView or horizontal UIScrollView that will show little images representing a drawing at page X.
Since that my animation app can easily have 200 drawings, this means that my UITableView or UIScrollView can contain 200 images.
Finally, I would like to implement UIAnimation, where the user will be able to reorder the images by drag and dropping. I would like to have something smooth...
I have 2 questions :
Which classes is the better for memory management? I think I understood UITableView automaticly unload cells that are off screen, not UIScrollView. Is that true?
Which one might be easier to implement, considering possible heavy load? (I found this for horizontal UITableView : EasyTableView
Thank you
You should look into tiling with UIScrollView. There have been some very good sessions talking about advanced use of UIScrollView at WWDC over the past three years, and the videos of those sessions are available if you're a registered developer. They'll show you how to use UIScrollView's tiling feature to load just the content that you need, much as UITableView loads only the content that it needs.
As far as I'm aware, UITableView doesn't work in a horizontal mode, so UIScrollView is currently your only choice if you're only considering classes in Cocoa Touch. I'm sure there are some third party options, but I don't know enough to recommend one.

What's the technique to do expand/compact stack on iPad like Reeder and Photos?

On iPad, both the native Photos app as well as Reeder use a "expand/collapse stack" technique. Initially there is a stack of items on top of one another, each angled a bit with different corners showing. When you interact with them, the stack expands into a full screen and the items are laid out in a grid. When you collapse them, they collapse back into a stack.
What's the best way to set up my views to do the same thing? Should I just have a bunch of UIviews (one for each item) and manipulate their coordinates/transforms with an animation, or is there something more to it? Any example apps with code?
(Note: I am not asking about the interaction to invoke expand/collapse, I'm only asking what's the most appropriate way to lay out and set up my items.)
These days, use UICollectionView with different layouts and transitioning between layouts.

Resources