I found this in some example code I downloaded
#import "PreferencesViewController.h"
@class MetronomeView;
@interface MetronomeViewController : UIViewController <PreferencesViewControllerDelegate> {
MetronomeView *metronomeView;
}
@property (nonatomic, assign) IBOutlet MetronomeView *metronomeView;
- (IBAction)showInfo;
@end
I tried to find information on PreferencesViewControllerDelegate, but didn’t find much. What is this delegate?
It’s a custom view controller delegate protocol that is created by Apple, for use in the Metronome sample project (and I imagine others). The protocol declaration can be found here, and how it’s implemented can be seen here.
All it does is act as a delegate that monitors what happens to
PreferencesViewController, the controller that manages the preferences view.The protocol contains one method called
preferencesViewControllerDidFinish:, which is implemented byMetronomeViewControllerlike this. When the delegate receives a signal that the preferences view has been dismissed with the Done button, this is called to hide the view:A similar delegate called
FlipsideViewControllerDelegatecan be found in the Xcode iOS project template for a Utility Application.