by Cesare Rocchi

On Naming Macros in Objective-C

Right after my latest post on naming methods with blocks my friend Murray asked for some feedback on the names for his collection of macros. Without even blinking I suggested ALL_CAPS, having in mind mostly the following macro by Apple UI_USER_INTERFACE_IDIOM() I think it’s pretty ugly to read but I guess it’s meant call out the fact it’s a macro. If you check UIDevice.h though, you’ll find the following: #define UI_USER_INTERFACE_IDIOM() .

Continue reading →

On naming methods with blocks

Recently I have been very busy with the implementation of the BaasBox SDK for iOS and I had to come up with lots of method signatures. It’s 2014 and we all love blocks, so I used them quite extensively. When consolidating the upcoming version I noticed I wasn’t consistent with the naming. Some method was like this: -(void) loadCurrentUserWithCompletion:(BAAObjectResultBlock)completion; and some other was like this: - (void) updateUserWithCompletion:(BAAObjectResultBlock)completionBlock; Notice the different naming for the last part, the name of the parameter.

Continue reading →

Pages(1)