Template for Layer Distance in Objective-C