Learn C blocks in 20 seconds

Guides | Tutorial By 3 years ago

Since the introduction of iOS4, blocks have become very prevalent in the Cocoa framework as a quick and non messy way of implementing a ‘callback’. Blocks can be passed around just like any other variable. They are most used in UIView animations.

Harnessing the power and simplicity of blocks is something that I have been doing a lot more since iOS4, turning old fashioned protocol delegates into blocks where it makes sense.

Bringing intellisense back from the dead (Xcode)

Guides | Tutorial By 3 years ago

So you’re coding away, everything is coloured nicely so you can distinguish between reserved words, datatypes and variables, but then the unthinkable happens; all your code turns black. Not to worry, you can live without the colours, but when you see the “symbol not found” message and Xcode is no longer autocompleting variables and functions for you, you start the panic. Your development time rolls to a halt and you can no longer quickly jump around from method to method. You realise Xcode has broken it’s intellisense index.

Tint Colours in iOS5

News By 3 years ago

If you have worked with some of the basic iOS controls previously you have probably pulled hair trying to figure out how to change the colours around. Most notably the UISwitch – currently developers only

Obtaining Luminosity from an iOS Camera

Tutorial By 3 years ago

Unfortunately Apple does not give developers access to the ambient light sensor on the top of it’s iOS devices (used to measure brightness and adjust the screens brightness accordingly), and when I say access I

Method Swizzling to override in a category

Guides | Tutorial By 3 years ago

Objective C categories are great for extending classes, however if you want to override methods then you’re going to have some problems as you can no longer call the method on your original class owns, usually breaking a lot of functionality the higher up the class food chain you travel (try this on NSObject‘s init, return nil). If you called the same method on self you would end up with an infinite loop, and calling super will skip the original class completely.

Faster iOS Apps

Guides | Tutorial By 3 years ago

Something you may have seen with apps from the App Store or even your own apps is how they take a very long time to open. The common reason behind this is that a lot

UIImageView Transforming Touch Coordinates to Pixel Coordinates

Tutorial By 3 years ago

I have recently had a project where I had to do some image processing on an image based on where a user touches an image (in a UIImageView). Getting the touch coordinates was easy enough,

Tesseract OCR and Cross Compiling on iOS

Tutorial By 3 years ago

Previously I wrote on using CGPDF to display PDF document pages like you would display images. Well now we are going to get into something that goes beyond what most PDF apps on iOS do,

The Mystery of disappearing subviews

Tutorial By 3 years ago

I was working on an app last week that had a strange problem, it would without warning lose some of its subviews during the course of using it. With little documentation of why this was