0

I need a little help. I am new to programming and I am trying to create an app that shows photos, like they were a magazine.

I can say I am on the half path.

I am trying to create a NSArray with the name of the photos, so I can display them in a UIImageView.

But, how can I send this message to the UIImageView when the information comes from the NSArray?

Actually, let me explain it more. The user will be able to swipe between the photos. The effect is gonna be the curl one, like iBooks.

The problem is that I do not know how to change the UIImageView to display the photos.

Can I create a viewcontroller to each photo and then add the UIViewAnimationTransitionCurlDown to change between them? What's the easiest option?

Well, hope you guys can help me.

Thanks!

1 Answers1

0

You should look into UIPageViewController. Essentially, you would have a main view controller that contains the array of photos. This would have a child view controller that is a page view controller. The page view controller would refer back to the main view controller for view controllers to display, and the main view controller would provide it with view controllers that contain image views initialized however the main view controller wants it. Take a look at Apple's tutorial, as well as this tutorial, for more information.

Hope this helps!

architectpianist
  • 2,562
  • 1
  • 19
  • 27
  • Sorry man, actually I did not even know there was a "check" button AHAHAHAH sorry again! Ah, just for you to know, I followed the tutorial you suggested, and I successfully did what I wanted. Although, I have another question, how can I add custom button to each photos? Can I do that? – Fernando Augusto Marins Jul 23 '13 at 00:56
  • Sure. The nice thing about the page view controller is you have complete control over how each page is presented. You can add the custom button to the view when you provide the view controller, OR you can add it in a storyboard if you instantiate the view controller from there. I'm not sure I answered your question though...? – architectpianist Jul 23 '13 at 02:32
  • But do I have to add a storyboard for each photo or not? Thanks! :) – Fernando Augusto Marins Jul 23 '13 at 13:31
  • No, you shouldn't have to. Just make one view controller in the same storyboard that loads the main view. Set up the photo and the custom button, and give the view controller a string identifier in the Inspector. Then, when the page view controller asks for a view controller, the main view calls `[self.storyboard instantiateViewControllerWithIdentifi:stringIdentifier];` and uses that as a template. – architectpianist Jul 23 '13 at 14:58