How to handle multiple delegates
Posted
by mac_55
on Stack Overflow
See other posts from Stack Overflow
or by mac_55
Published on 2010-03-19T01:52:27Z
Indexed on
2010/03/19
2:11 UTC
Read the original article
Hit count: 317
I've got a view in my app that does pretty much everything, and I like it that way. The problem however is that it's implementing 5 or 6 different delegates, which seems a little bit messy.
My question is, does the view controller have to implement all of the delegates? or is there some way I can separate the code out into different files (without having to do a major restructure or rewrite)?
Here's all the delegates I'm implementing:
@interface MyView : UIViewController <UIScrollViewDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIActionSheetDelegate, MFMailComposeViewControllerDelegate>
© Stack Overflow or respective owner