I found an example of a paging UIScrollView
in Apple's developer docs and it's just what I want for my application. I have a main view with a "Help" button that I want to present a view that users can page through to see all the help topics. The sample is at:
And it works as advertised, but, as with so many of Apple's examples, they do all kinds of code right in the AppDelegate
. I have my own AppDelegate
, but then I have a NavigationController
with a RootView
that has this "Help" button on it. I can't seem to get the example code integrated into my own and have it work. I'm pretty sure I can't put the code they have in their AppDelegate
in my own, but how to set it up eludes me.
Can someone point me to an example where they do what I'm talking about?
EDIT: I was able to create a new project and get it to work like Apple's by moving all the AppDelegate
methods into the UIViewController
that the template supplied and creating a new ContentPage
UIViewController
to hold the content. It can scroll from page to page, so I think I can insert this code into my other project ok.
I replaced the applicationDidFinishLaunching
with an equivalent viewDidLoad
and got rid of the AppDelegate
stuff dealing with window
and such. Then I changed Apple's initWithPageNumber:
method to refer to my help pages rather than just creating instances of their generic views.
- (id)initWithPageNumber:(int)page {
NSLog(@"--initWithPageNumber:ContentPage");
if (self = [super initWithNibName:[NSString stringWithFormat:@"HelpPage%d", page] bundle:nil]) {
pageNumber = page;
}
return self;
}
Thanks for the help - sometimes it's good just to have someone tell you it can be done to keep going!