Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Subclassing Procedures/Documentation #36

Closed
larsacus opened this issue May 30, 2013 · 3 comments
Closed

Define Subclassing Procedures/Documentation #36

larsacus opened this issue May 30, 2013 · 3 comments

Comments

@larsacus
Copy link
Contributor

I've been seeing more and more issues and requests for features that may not be appropriate for MMDrawerController core, but are more suited toward specific applications. This would be best solved by subclassing MMDrawerController, but we currently don't have a formal set of rules and such for developers to subclass MMDrawerController.

A list of things off the top of my head we need for easy developer subclassing:

  1. Modified documentation relating to required methods for subclassing
  2. Method attributes for methods that require to callback to super using __attribute((objc_requires_super))
  3. A interface extension header that includes methods that are not defined in the public header, but that may be important for subclassing (MMDrawerController+Subclass.h, much like UIGestureRecognizerSubclass.h does). This would also contain more documentation on these methods and what they do.
@kcharwood
Copy link
Contributor

I don't want to throw water on this just yet, but we made need to rethink it...

The purpose of UIGestureRecognizerSubclass.h is:

...be sure to import the UIGestureRecognizerSubclass.h header file. This header declares all the methods and properties a subclass must either override, call, or reset.

If we follow that example, then methods included in that header should be methods that must be overridden by a subclass.

In our case, for methods that can be overridden in a subclass, maybe we just expose them in the normal header file like UIViewController does...

@larsacus
Copy link
Contributor Author

That's kind of what I was going for here were methods that were not at all relevant to the normal operation of MMDrawerController, but may be relevant to developers who would like to extend MMDrawerController by augmenting or replace existing implementations of some internal methods in MMDrawerController.

The example that UIGestureRecognizerSubclass.h uses is not implicit, but an explicit, fully documented action in the header that states that all of the methods declared in that header must be overridden. This keeps the header file clean for developers, while still providing additional functionality to those who want it in the subclass header.

@kcharwood
Copy link
Contributor

Closing this and moving discussion to #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants