Skip to content

Instantly share code, notes, and snippets.

@nicklockwood
nicklockwood / gist:9605636
Last active December 11, 2019 15:17
Singleton Category implementation
Singleton.h
-------------
@protocol Singleton
@optional
+ (instancetype)sharedInstance;
@end
@ElDragonRojo
ElDragonRojo / RulesFor3rdPartyFrameworks.md
Last active December 6, 2016 07:14
My rules for creating and using 3rd party frameworks (i.e. those not part of the platform's standard toolkit).

Rule 0: Do not make a framework.

Ask yourself if you should be making a framework given that you are not in the business of making frameworks. Believe it or not, most of us have the urge to solve problems completely and in the general case as our first inclination, but getting things done requires not doing so almost all of the time.

Rule 1: Do not have dependencies on other 3rd party frameworks.

Frameworks should be modular and standalone. They should require nothing but the standard system libraries in order to run. If the framework relies on other functionality, it should encompass it entirely. If it cannot, it probably violates Rule 3.

Rule 2: Use a non-viral open-source license like MIT or Apache, NOT GPL.