UITableView vs UIScrollView - ios

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.

Related

How to create a collection view with images that change size on scroll

I want to implement an horizontal collection view displaying images that increases the size of the images with a smooth animation as they approach the center and reduces their size as they move away.
I have been studying the UICollectionView potentials but so far I have not been able to understand if such behaviour is possible to be implemented using UICollectionView or what would be the best alternative. For instance using UIScrollView instead (with a lot more work probably).
Some guidance or sample code would be most welcome. Thank you.

Add parallax scrolling to UIPageViewController

I am using a UIPageViewController (and was even thinking about starting to use Pageboy) and recently saw an app using parallax scrolling as shown here (AnimatedCollectionView). Since I really liked the way parallax scrolling felt but cannot use a UICollectionViewController (and simply use the last mentioned pod) for my purposes due to a variety of reasons, I was wondering whether there was a way to add interactive scrolling animations or rather parallax scrolling to a UIPageViewController as well. At the end of the day the UIPageViewController is still inherited from UIScrollView (just like: UITableViewController and UICollectionViewController), right? Please correct me if I'm wrong.
Nevertheless, the question remains: How can I add parallax scrolling to a UIPageViewController? Is it even possible? Unfortunately, I couldn't find anything that could help me.
I am not sure if it might be of any interest but the UIPageViewController I am using is horizontal.

iOS Multiple Scrolling Sections - Right way

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.

iOS (iPhone only): Horizontal page scroll, where the scrolling page doesn't take up the whole screen

I am trying to achieve horizontal page scrolling effect (partial view, not of the entire screen scrolling), like in the HGPageScrollView component.
I am a fairly novice iOS programmer, and I am having difficulty finding the parts of the code which provide just the horizontal scrolling with the swipe gesture. So I am looking for any help, either some sample code, or pointers to the code in the HGPageScrollView, which provide just the horizontal scrolling functionality (i.e. not even the UIPageControl dots at the bottom, just the vanilla scroll).
I am only looking for an implementation which works in iPhone landscape orientation, if that makes it any easier.
Why I am not using HGPageScrollView:
It is not ARC compliant.
It does way more than I need it to, I am just looking for the scrolling.
Consequently, it is proving quite difficult for me to find where to remove all the features I do not need, like clicking on page to change the scrolling mode to full screen (HGPageScrollViewModePage)
I would like to use this as an incentive to learn more about the components available in cocoa-touch, and roll my own implementation.
I think this question might be suggesting the solution, but I do not know how to implement it. I guess I don't fully understand it, as there aren't enough details for my novice skills to go on.
Use a UICollectionView and set the pagingEnabled property to YES.
If you want to do complex layouts of the items (like in your example above where items are split on both sides of the screen) you may want to provide your on UICollectionViewLayout: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionViewLayout_class/Reference/Reference.html#//apple_ref/occ/cl/UICollectionViewLayout

UITableView with floating cells

I am working on a specific type of list for an iOS app, where cells would simply have a specific width and height and then float left (think of something like CSS float:left), creating then a list that would scroll if more than 12 items (like the picture bellow).
I was thinking that perhaps this could be done by customizing UITableViewCell and setting the frame's width and height, so I could re-use the various benefits UITableViewController, delegate and dataSource offer. but unfortunately it seems that's not possible.
So, I'm now simply creating many UIViews and positioning them across its parent programatically.
I just would like to make sure this would be the right approach to achieve such kind of lists and if someone could let me know if it's indeed not possible to have this kind of functionality on UITableView and inherit all the goodness it offers.
Thanks guys
I know this question is already answered, but still...
I believe you can simply use UICollectionView since iOS 6.0.
Documentation
And this is how it looks like (image)
Maybe this will help somebody.
UITableView can only have cells that go in one direction. It's perfectly okay to create many UIViews (table view cells are also UIViews), if the number of them is reasonable. You can usually have a few hundred UIViews in a scrollview without seeing any performance issues, but that also depends on the complexity of what's inside the uiviews. Try it for yourself and if you find out, that you need too many uiviews, or that their complexity it too high, you can optimize further. You can set the .layer.shouldRasterize property to "cache" the content of the views. Or you can use CATiledLayer, which is something like a UITableView, but it supports tiles in all direction (and scrolling, zooming, ...).
Take a look at this project, I think may be helpful to for your problem
link

Resources