Understanding IEnumerator in Unity 3D
was among the less understandable classes (at least for me) in Unity3D. Actually does not seems being a class at all. It is used in conjunction with Coroutines, but the original intention behind this class is not that. As soon as I tried to use it for enumerating actually (for what the class originally designed for), […]
Brush up you code design skills
Once you decided to make extensible, reusable, more stable, maintainable codes in the future, simply read these books, and start thinking about you existing projects’ code design. Both were originally written for Java language, but patterns can be pretty easily applies for everyday Objective-C development just fine.
Refactoring, prefactoring, defactoring
I’m fond of Kent Beck books on refactoring issues (Refactoring: Improving the Design of Existing Code, Implementation Patterns). Reading these books makes me more critic when looking to my own code. Most of the time I can catch signs of need for factoring something into new structures. Refactoring A common tool of refactoring are the […]
Dead simple singleton implementation
Over the times I made plenty of exotic singleton implementations, but lately I started to use this lightweight structure. Simply a class holds a static pointer, and whenever you create an instance, it will be assigned to that pointer. You can access it via a single class method. In terms of code it needs a […]
5 approach to implement SpriteKit drag
Implementing SpriteKit drag could be tricky. On one hand you can find a running animation (I’m not sure that it is synced with UIKit touch events), on the other hand you (may) have a physics simulation to fit in.
Advanced yet simple way to save to NSUserDefaults
Storing user level application settings, UI states, generic counters in an iOS app is an everydayer. The usual – and told to be easiest – way is to store these values is save to . But it is not that fluent for everyday use as it should be. Normally you don’t want to declare each […]
The engine behind SpriteKit
I was just wondering what is the engine behind . Then I just wrecked up some instantiation, and realized that actually it is explicitly named in the body message of some exception it raised. Please find a definitive guide below to see it yourself. Anyway, you can see private iOS 7 framework – internal part […]
Simple Core Data sample managing an object queue
Core Data is overmistified, at least it was by me. But after all, it just maintains objects in memory, save them to disk, then load them back. The rest of the features can wait until you really need them. Oh, and almost forget, it has nothing to do with AppDelegate.
Why asynchronous reachability with IP address doesn’t work?
The story is short, I attempted to get asynchronous callback from a reachability with IP address, but callbacks were never called back. If you have not experienced this before, or just dying of curiosity, you should check the proof project I made to reproduce this bug. if (asynchronous) //The asynchronous way, NOT WORKS (!!!) with […]
Understanding premultiplied alpha
I was always curious about what is happening during an alpha compositing process, especially how does premultiplied alpha in particular work. Mainly to completly understand the good use of blend factors, and be able to make really economic OpenGL shaders/render pipelines. So I made a clarification of alpha blending, and have modelled the whole process […]