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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 26482 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

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?