UITableViewCell with a horizontal UITableView - ios5

I want to implement a vertical UITableView whose cells contain horizontally scrolling table views. It should behave pretty much like the table view in the Pulse app. That, as mentioned by the developers in their Stanford presentation, contains horizontal table views in each cell.
I've read Ray Wenderlich's blog post, but he mentioned that in iOS 5 it can be done a lot easier than his tutorial and that the procedure would be described when iOS 5 is released (which it has been for almost a year and no blog post about the matter has been posted).
Could someone please give me a hint how to go about it? I am adding a tableview to my cells and I'm rotating it by -M_PI_2. The width of the cells is set to be the height of the cells in the main table. The height of the horizontal table is set to be 320. However, it doesn't scroll when I start moving my finger on it and I don't really know why.
Sorin

I have found the answer (the Ray Wenderlich tutorial on the matter)
http://www.raywenderlich.com/4723/how-to-make-an-interface-with-horizontal-tables-like-the-pulse-news-app-part-2

Related

Creating a scrolling grid of different width cells on iOS

I am new to iOS/Mac and ObjectiveC development and need a bit of guidance if someone could be so kind, so please excuse my ignorance.
The issue I have is I need to create a Grid view for a TV Guide where you have a vertical list of channel logos on the left that scrolls up and down, and to its right we have a horizontally and vertically scrolling grid. Horizontal scrolling doesnt move the channel logos which is fixed on screen, but vertically scrolling grid also scrolls the logos as you would expect.
Now being new to ObjC and iOS Frameworks, I was wondering which methods I should go down to implement this, Quartz2D perhaps? Or are their alternative simpler methods?
Whatever method is used, it needs to be quick with thousands of 'cells' across up to 600 rows; it also has to be memory efficient with out of view cells being disposed/reused as needed.
I am not necessarily asking for specific code (although that would be nice lol), just some advice on what methods to use so i can concentrate my education on those areas; if that is possible
Thanks.
It seems you do not really need two different scroll views / table views left and right, as the two sides should always scroll with each other.
Thus, just use a UITableView with a custom cell (subclass UITableViewCell) that has the logo on the left, and another scroll view (for horizontal scrolling) on the right.
Read Apple's Table View Programming Guide, and you will be on your way.

Vertical and horizontal scoll at a time in gridview with infinite scrolling IOS

How can one enable horizontal and vertical scrolling at same time in a grid view?
If I have a 4x4 grid of thumbnail images, I want to implement swiping in both directions, left/right and top/bottom. Currently I am done with left and right swipe, but if I select the second cell and swipe towards the top, the 2nd row should be scrolled like a Rubik's cube.
Please share if any one have any idea.
It's been quite a while since your question but as I've been struggling with the same thing I'm gonna answer it for future reference...
Sadly I could not find a good solution anywhere so after a lot of hours of experimenting I came up with this: https://github.com/AlvinNutbeij/DWGridController
It's still a work in progress but very usable for your purpose I'd say!
How have you currently implemented what you have? Your mention of 'cell' makes it sound like you are using a UITableView. You won't manage to make one of those scroll in both directions, you'll need to work with a UIScrollView.
I suggest you watch "Designing apps with Scroll Views" from WWDC 2010, then "Advanced Scrollview Techniques" from WWDC 2011. That'll teach you about how you implement tiling and infinite scrolling.
Essentially what you want to do is implement some kind of view recycling yourself, that works like the way UITableView recycles its cells. When things are scrolled off one side of the scroll view, you remove the views for the things that just scrolled off screen and put them in a queue. When things scroll onto the screen, you pull views out of the queue (or create new ones if the queue is empty) and lay those views out in the correct place.
To do the infinite scrolling, you fake it: when your scroll view gets near its edge, you reposition everything inside it, you move the scroll view's content offset to where you've repositioned the views, and then you continue from there: it's all done at once so the user never notices.
The videos will explain these techniques better than I can sum up here: watch those as your first point of call.

Best Practices: Fast UITableView Scrolling?

I know there has been a lot of discussion around fast scrolling. Apple provides excellent examples:
http://developer.apple.com/library/ios/#samplecode/TableViewSuite/Introduction/Intro.html
I will have a custom UITableViewCell that has 2 UIImageView's and 3 UILabels as subviews. If I just add them as subviews to the content view will my scrolling be slow?
Would it be best to just draw these?
The answer I got from the UIKit guys at WWDC this year was "it kinda depends on what you're doing". If everything in the cell is opaque and simple, adding subviews directly to the content view is very performant. If you need some views to have varying opacity or changes, rendering it manually can be faster.
The videos for WWDC were just posted, I recommend you watch session 105 (second half specifically), it addresses analyzing and improving performance in UITableView, in a real world app.

How to recreate a Pulse-like UI?

I was wondering how to make image display through a table like the application Pulse on iPhone. I used UIScrollView but it did not help much. It only displayed images in a nice array-like manner but you could not produce an event or click on the image.
What's the best way to produce a Pulse like application for displaying images and heading information in an array-like style?
use Ray Wenderlich tutorial about THIS topic
tutorial
The Ray Wenderlich pulse tutorial does have an issue where if the horizontal table view has not been scrolled (or its first element is aligned with the left of the screen) you can't drag right and have the content pull that way and then bounce back. This makes the scrolling experience feel pretty bad.
The simple solution though is to put the horizontal table view inside a scroll view and then everything just works.
It looks like a UITableView with rows that are composed of UIImageViews. Its got a nice touch where you can scroll horizontally within a row, like with Twitter's app. That's most likely done with a UIScrollView (scroll bars removed, with end bounce). Peter Boctor wrote a web blog post on how to do something similar, if I recall.
It's a UITableView with each row containing a UITableView that is rotated by 90°. The cells for the UITableView in each row are custom views that are likely either subclasses of UIImageView or just plain UIView.

How to control scrolling sound of uipicker?

How to control scrolling sound of uipicker? Any available sample code?
There is no documented way. That being said:
[myPickerView setSoundsEnabled:NO];
Like Peter said, there's no public way to do this. However, if it's really critical you could implement your own picker-type object. Basically, all you need to do is create a UITableView and customize the cells as you like. Then create an image to add as a UIImageView subview that's the same size as the table. At its simplest, all you need is a little bit of gradient fade-to-black at the top and bottom so the cells of the table appear to fade in/out. You could also add a bit of a frame around the table, or anything else really, as you like.
If you take a look at a picker and think of the wheels as just UITableViews with a gradient at the top and bottom, you'll see that the curved effect is just that simple. If you look closely as you scroll the cells offscreen, you can see that they never change shape; they just fade out.
As for the sounds, you could then use any of the UIScrollViewDelegate and UITableViewDelegate methods to monitor when the "wheel" moves and check to see where the table cells are on-screen. Perhaps when a cell passes the mid-way point, you play your custom sound.
It would definitely take a little bit of work to implement this, but is certainly possible if it's critical for your app.