Bug 26482 - UIApplicationDelegate should inherit from UIResponder
Summary: UIApplicationDelegate should inherit from UIResponder
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: XI 8.6.0
Hardware: PC Windows
: --- enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-27 19:18 UTC by Adam Kemp
Modified: 2015-03-05 11:19 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Adam Kemp 2015-01-27 19:18:15 UTC
As described [here](http://www.cocoanetics.com/2012/09/the-amazing-responder-chain/), the application delegate is part of the responder chain, just after the application itself. However, the delegate class does not inherit from UIResponder, which makes it very difficult to take advantage of this. In two separate forum discussions (http://forums.xamarin.com/discussion/comment/88778/#Comment_88778 and http://forums.xamarin.com/discussion/comment/99785#Comment_99785) the solution to the poster's problem should have been simply overriding a responder method in the app delegate, but instead was much harder. In the case of Xamarin.Forms there is no solution to implementing responder methods in the app delegate (so you have to put them somewhere else instead), and without Xamarin.Forms you end up having to inherit from UIResponder instead and implement your app delegate methods using Export attributes. It's a hassle.

It would just be much easier for some of these scenarios if UIApplicationDelegate inherited from UIResponder so you could just override its methods directly. UIApplication already does this.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-01-28 03:30:52 UTC
I'm not sure changing the base class of UIApplicationDelegate is a good idea, because it's technically a breaking change.

However we could introduce another class (say UIApplicationResponderDelegate), which does what you suggest here: http://forums.xamarin.com/discussion/comment/88778/#Comment_88778 (public class UIApplicationResponderDelegate : UIResponder, IUIApplicationDelegate) and then exposes those API to base classes.
Comment 2 Adam Kemp 2015-01-28 08:54:04 UTC
That would work for Xamarin.iOS users. Could you convince the Xamarin.Forms guys to add a new variant of FormsApplicationDelegate as well?
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-03-05 08:09:57 UTC
@Adam, for Xamarin.Forms please file it with that team (https://bugzilla.xamarin.com/enter_bug.cgi?product=Forms)
Comment 4 Adam Kemp 2015-03-05 11:19:44 UTC
Are you asking me to file a new separate bug? Is there a new base class I can ask them to use?

Note You need to log in before you can comment on or make changes to this bug.