All matters that matters.

Lazy Loading in Swift

In Objective C, to create a lazy-loaded property, we are used to the following code snippet. //in example.h @property (nonatomic, strong) NSString *bigText; //in example.m – (NSString *)bigText { if (!_bigText) { _bigText = [self makeLongText]; } return _bigText; } The combination of @property and a custom getter method are the main ingredients for objective C lazy loading. By calling the accessor method (i.e. self.bigText), the custom getter will check if the ivar is nil and initialise them during run time. In Swift, to create lazy loaded properties are much easier. By appending @lazy, the compiler would note that this variable…

Swift’s Operator Overloading

Aside from Swift, C++ is the only language I really know that allows operator overloading. Operator overloading, as define in wikipedia In programming, operator overloading—less commonly known as operator ad hoc polymorphism—is a specific case of polymorphism, where different operatorshave different implementations depending on their arguments. Operator overloading is generally defined by the language, the programmer, or both. Which basically means, developers can override the behaviours of operators such as / = – + * % < > ! & | ^ . ~ (dot) Why Operator Overloading Operator Overloading is syntactic sugar and provides clear concise expression. Since, Swift itself claims to be syntactic sugar,…

Swift’s concise closure syntax

When Swift was announced on WWDC 2014, Im pretty much sure that there was a lot of great applause from developers world wide. And when we had a look at the syntax of Swift, it was definitely a winner over Objective C. According to some of the people I talked to, the introduction of Swift would lower the barrier of development. Recall those days where all server-side developers were jumping in because of PHP. I personally don’t totally agree.  Newcomers would still have Be aware of retain cycles Adhere to iOS development patterns. Understand iOS behaviour life cycles. Still understand…

FBTweaks with multipeer connectivity

Facebook’s Tweaks library is handy toolkit for any designer and programmer. As the name suggest, Tweaks allow you to add configurational parameters into your code. During runtime, you could shake the device to present the configuration screen to tweak you parameters.             The cool part is that tweak remembers your settings will reload them when you rebuild your application. On my latest game development, code name : A new hope. I decided to use Tweak, since it is as close as I could get on the Unity editor/inspector behaviour. However, it felt a bit cumbersome to shake…

Sketchy Cam

  Camera Apps. I’ve always had a desire to make one. I’ve never used any other from the stock camera app that comes with iPhone. For the past few weeks, Ive decided to give a trial on creating my own camera app. After countless tinkering about, I finally settled with a camera with a default Sketch filter. Hence the name Sketchy Cam. It will be a free app with in-app purchase. Will be in the Appstore within this month ( March 2014). For now, here are some shoots.                

SPDYCocoa for iOS

SPDY (pronounced speedy) is an open networking protocol developed primarily at Google for transporting web content. The goal of SPDY is to speed up the web. This is achievable by reducing bandwidth by compressing request/response headers and reducing the round trip needed grab resources. SPDY boasts over a 23% reduction in page loading time, which is phenomenal for most websites. SPDY requires involvement from the server and client. Both platforms must be capable of communicating via the SPDY protocol in order to be successful. CocoaSPDY Thankfully the developers at Twitter has release an implementation of SPDY for Objective C called CocoaSPDY….

Obj C .travis.yml

Travis CI is recommended for those that commonly do unit/integration test without the hassle of setting up/maintaining a contiguous integration server like Jenkins. Travis CI is a hosted, distributed[2] continuous integration service used to build and test projects hosted at GitHub. Travis CI is free for public GitHub repositories and they do offer pricing plans for private GitHub repositories. .Travis.yml Setting up Travis CI is as simple as 3 steps. What spent most in the 5 minute setup was figuring out the .travis.yml. Heres how my .travis.yml file looks like for SpriteKit-Components. language: objective-c xcode_project: SpriteKit-Components.xcodeproj xcode_scheme: SpriteKit-Components xcode_sdk: iphonesimulator One detail I would…

Sprite-kit Components

Sprite-kit Components is a component model for iOS 7+ SpriteKit Framework. Add components that perform specific behaviors to your nodes. Benefits to using the component based model include: Lets you write reusable behaviors that you can apply to any node and reuse across projects Adds an update method with delta time called for every SKComponentNode and behavior Adds onEnter and onExit methods akin to Cocos2d’s model for every SKComponentNode which lets you perform set up and tear down when your nodes are added to and removed from the scene. Simplifies basic touch interaction to automatically support select, tap, drag, drop,…

MonsterWars8 Component Architecture Framework

MonsterWars8 Component Architecture Framework

Ive always enjoyed component architecture in game development. Which is probably the reason why I am more likely to use Unity over Cocos2d. Not to say cocos2d does not have a component architecture, but you have to put in more effort to build it. Ray Wenderlich back in January 2013, has came up with a great article about how to go about it. Heres the article  ( highly recommended to read ) http://www.raywenderlich.com/24878/introduction-to-component-based-architecture-in-games I figure it would be fun to turn this into a reusable framework. Which can be downloaded here https://github.com/xr1337/MonsterWars8-Composition-Framework The framwork is easy to use, but for more…

Symmetric Image optimzation

Symmetric Image optimzation

Ive been focusing some of new materials on EBuddy’s tech blog. Most likely, I will still maintain any materials that are not suitable for EBuddy here. My first article is related to cutting down redundant image size on Symmetric images. There are some accompany code and samples on git hub. The article goes through some of the benchmarking of making your own image cache. Please find the article at the below link. http://tech.ebuddy.com/2013/04/25/trim-the-fat-on-symmetric-images/ Or if your interested in the sample code, here is the github link https://github.com/xr1337/UIImage-Symmetric        

1 of 8
12345678