How do you implement swipe-able image stacks like the Photo app using the iPhone SDK? - iphone

I would like to take a stack of images (or potentially an array of URLs to download images) and display them in full screen, one at a time, using user swipes to smoothly animate the next image in the stack, using the iPhone SDK. Apple's Photo.app seems to do this. Additionally, if the image has not been retrieved yet, I'd like to display the progress indicator.
Can you point me to example code and explain how this technique would be implemented?

You need to use UIScrollview's page control mechanism. Apple has plenty of sample code, including one called, strangely enough, Page Control:
http://developer.apple.com/iphone/library/samplecode/PageControl/index.html
If you want any behavior beyond that, you'll have to roll it yourself.

Related

Swiping through a stack of images?

I recently came across this app, tinder, which has a really cool functionality.
You start off with X images. User can swipe left or right to go through each image to signal whether the user likes or dislikes something.
An image can be seen here:
I have been looking at UICollectionView to do this, but I am a little confused about the custom layout I should be using.
I have been thinking of generating a bunch of cells and then setting different z-index and stacking them on top of one another with the same frame.x.
Any tutorial/advise/help available?
This is simple UIImageviews. and tinder only showing two top images and set a background frame just like facebook image gallery.
When you swipe top image current thread fire next image and it replace current image with new image. And you can add like, comment views as you want.
This sounded like fun, so I built an open-source library that mimics the interface you described.
https://github.com/modocache/MDCSwipeToChoose
The sample app included in the project is nearly identical to the UI in your screenshot.

iOS - How to show hints for gestures for iOS app?

I have seen some apps where when you launch them for the first time after downloading (e.g. Chrome app on iPhone), it shows you a list of animated gestures on the screen, kind of giving you a tour of the app.
How do I build one something like that? And how does the app know to launch only for the first time after download and not since then? For the second question, I am guessing a "shown=TRUE" value can be saved inside a PList file and checking the value each time when the app finished launching. But I am more curious about the mechanism involved in creating a guided app tour.
You can use transparent and semi-transparent images with a UIImageView, so you can make up an image with arrows and notes and put over the whole screen. You could fade it out when the user taps.
To know if it's the first time running the app, you should use NSUserDefaults instead of a plist; it's much easier, and you should be app to find a quick tutorial on that fairly easily.
Also, you could check around on this site for controls like this one. I haven't used any of them myself, so I'm not sure how much they differ from a regular UIImageView. They look nice though.

Application walkthrough when opened for the first time

How do you setup in your application to show little bubbles with text and block the rest of the screen from being used and only allow a small section / button to be pressed. I am wanting to create a walkthrough to show users how to use the application and where to find things within the application when it is opened for the first time.
I would like to dim the rest of the application except for the part I want them to click on. Is there a framework already with these features?
There's no frameworks that provide this functionality, as far as I know.
One way you could do this though is to have a set of overlay images which you overlay over the whole screen the first time the user goes to that screen. To determine if the user has already been to a screen, I suggest you look at NSUserDefaults. To create the overlay images, I'd make the image the full size of the screen (i.e. 460x320 if you are showing the status bar) and then have transparent sections where you want to "see through" to the element below. Add a gesture recogniser to the overlaid image view to detect a tap and then hide the image and set the flag in NSUserDefaults to make it not happen the next time the user goes to that screen.
If you don't get a better answer, you could look at MAAttachedWindow on the page at this link. It's written for Cocoa, not Cocoa Touch, so you would have to convert it. I am considering doing this myself. You might find it to be worth the trouble, but I haven't looked at every detail, yet, so I couldn't say for sure. There are only tow files that are involved (.m and .h).

Callout within UITableView

I am looking for a iOS Music app style Callout functionality. What I mean with that is that I want to get the same kind of callout "bubble" you get when press-and-hold within the Music app on iOS5.
I have been searching for a good solution for this, but can't find it.
The closest to what I need is: Use UITableView bubble/callout like iPod app However, this user didn't share what solution he had.
The libs I have looked at are:
https://github.com/jayway/CWUIKit
https://github.com/edanuff/MonoTouchCalloutView
http://www.eidac.de/?p=183
All of these have one this in common: They are useless.
The problem with these are that they all use a static callout view using PNG images, not one with a pointer beneath. Also, they do not adapt to the size of the screen; thus the bubble gets outside of the screen.
Any suggestions on a good library which I can use to implements this within my app?
What about WEPopover?
It might be what you want.
WEPopover for iOS

Is there a View Controller to show thumbnails like the Photos app?

I am looking to replicate the image gallery view that shows thumbnails, like in the photos app on the iPhone.
Is there a view controller or any examples that anyone can provide to replicate this?
There isn't one provided by Apple. I would recommend looking at Three20. It has a few things with look a lot like the Photos app.
Another option is AQGridView.
Take a look at the video of Session 104 from the WWDC 2010. It's basically a 40 minute tutorial on how to do the photo app.
Bear in mind that allowing users to zoom will greatly increase the space required. If you use CATiledLayers, that is, which, depending on your desired zoom level, you should consider doing.
Oh, and there is source code ;)
What they don't tell you is how they did their tiling. I found that you can
a) download ready-made tiles from the server with the app or with a content update (you can use ImageMagick's crop tileWidthXtileHeight - e.g. crop 100x100 - to do the tiling). This has the disadvantage of large downloads.
b) download ready-made tiles from the server as needed (may lead to lags in your app, but then MKMapView does it quite nicely, doesn't it?)
c) tile on the phone as needed (here you can also consider caching the results, although that will likely mean you have to check space left on the device)
I've recently given enormego's PhotoViewer a try. It's easy to use, and it's much more focused than the Three20 project. (Which I also use and like a lot.)