I am the author of the Layers application mentioned in OP. Unfortunately, coneybeare is right - I pretty much wrote an objective-c implementation from scratch. The trick turned out to be based on a very old version of the PSD specification, before it was insanely dirty with crap. Layers actually write Photoshop 3 files.
UPDATE: I posted a PSDWriter from Layers on github. You can use it to write PSD files from the UIImages suite on iOS or Mac OS X: https://github.com/bengotow/PSDWriter
Enjoy it!
source share