4 ms·
This is great so far, you have an excellent taste in frameworks. It's also nice and light weight. I would suggest adding a singleton macro. Will try and put
by alexbell 15y ago
This is great so far, you have an excellent taste in frameworks. It's also nice and light weight. I would suggest adding a singleton macro. Will try and put some of the boilerplate stuff I use in as a pull request when I get the time.
- xinsight 15y agoI used to love the Singleton (anti-)pattern. It's a huge improvement from using your AppDelegate as a global storage area, but it still encourages sloppy code. I find it the code much cleaner when you pass in the objects a class needs instead of calling up the singleton from all over the place. There are some legitimate uses for singletons, but if you need a singleton macro, you're probably over using it.
- lukeredpath 15y agoI'm no fan of singletons either, but writing one with GCD dispatch_once is pretty simple. Nevertheless, I do have a macro for it: http://lukeredpath.co.uk/blog/a-note-on-objective-c-singletons.html http://lukeredpath.co.uk/blog/a-note-on-objective-c-singleto... It's really for creating "shared" instances rather than true singletons, but who honestly needs a real singleton?
- alexbell 15y agoThis is cool!