Implementing page views.

Apprentice
Posts: 17
Joined: 2010.01
Post: #1
Hello I am very new to iphone programming. I am making a sound board app with multiple views, and I need to know which is the better way to go. should I have one XIB file with several views or should I have an XIB file for each view. One more question, is there a way to switch from one XIB file to another with finger swipes.
I know how to switch them with a button, but I would prefer to do it with the swipe of a finger, like the native iphone weather app. Please show me some sample code. thank you.
Quote this message in a reply
⌘-R in Chief
Posts: 1,258
Joined: 2002.05
Post: #2
One xib per (major/main) view generally works out best, as each view should have its own view controller which handles any of the glue between your models and view. Also it can get pretty messy otherwise.

The only difference between using a button and a swipe is the event. Instead of using a button to trigger an action, you use handle the touch events and determine if it was a swipe and then call the right action.

The docs describe how to handle swipes in "Handling Swipe and Drag Gestures" in the events section of the iPhone Application Programming Guide.
Quote this message in a reply
Member
Posts: 144
Joined: 2009.11
Post: #3
MacSteve85 Wrote:I am making a sound board app with multiple views, and I need to know which is the better way to go. should I have one XIB file with several views or should I have an XIB file for each view.

I have found that, given the limited memory of the iPhone and iPod touch, the ability to split views up into different XIB files (and then dynamically load and unload them) proves a great help in managing memory. Most of the time I would not suspect that you would encounter any problem, but sometimes you can just run out of RAM - and that really sucks.

Most of the time it's a non-issue, but it's something to keep in mind nonetheless.

Everyone's favourite forum lurker!
https://github.com/NSError
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Turning Page Effect with OpenGl ReSuMa 3 5,673 May 12, 2007 05:57 AM
Last Post: ReSuMa
  Implementing a formula with quaternions akb825 12 6,784 Oct 16, 2006 09:36 AM
Last Post: akb825
  Implementing Portals Ingemar 0 2,517 Jun 29, 2005 04:42 PM
Last Post: Ingemar
  CGL , AGL and Custom Views. anonuser 2 2,803 Sep 24, 2004 08:18 AM
Last Post: anonuser