views:

296

answers:

1

I have: - an AppDelegate class - two viewController classes - three nib files (MainWindow.xib, firstView.xib, secondView.xib)

I want: The secondView.xib should have an UIScrollView inside, so that I can add a lot of stuff to the view and it can be scrolled down.

Where would I have to conform to the UIScrollViewDelegate protocol now? I feel the AppDelegate class is the wrong place, because its far away from that secondView and not all my views want to use a UIScrollView.

+1  A: 

Hello, since UIScrollView is located in the secondView.xib I assume its functionality is limited to that view. If you have an instance of UIViewController that serves as the controller for the secondView.xib then the best place to implement UIScrollViewDelegate would be on that UIViewController directly. You are correct that implementing it on the AppDelegate doesn't make sense if you have a more specific derived controller where it should belong. Hope this helps!

Adam Alexander