Share your App Delegate as project constant
Define your AppDelegate as project constant in your Project-Prefix.pch file:
#ifdef __OBJC__
//...
#import "YourAppDelegate.h"
#define SharedAppDelegate ((YourAppDelegate *)[[UIApplication sharedApplication] delegate])
#endif
And now you can access to your AppDelegate methods from any project file this way:
[SharedAppDelegate myMethod];
Written by Sergi Gracia
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Xcode
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#