I'm writing a "blackbox" library. In this library I need to add a subView to any app which uses my library.
Therefore, I don't have any reference to the appDelegate nor to the UIWindow of the application.
The only thing the external app is doing now is the following :
myRec = [[Rec alloc] init];
myRec.delegate = self;
Getting the App Delegate:
id<UIApplicationDelegate> appDelegate = [[UIApplication sharedApplication] delegate];
Getting the UIWindow object:
UIWindow* window = [[UIApplication sharedApplication] keyWindow];