CGPoint Pass By Reference

The following example shows how to pass CGPoint by reference in Objective-C.

Class Interface

@interface
  -(void)multiplyX:(CGPoint *)point by:(float)a
@end

Class Implementation

@implementation
-(void)multiplyX:(CGPoint *)point by:(float)a {
   (*point).x = (*point).x * a;
}
@end

Read full article here >>

CGRect, CGSize, CGPoint

If you have used any C structs in Objective-C programming for screen alignment or sizing then you have used either CGPoint, CGRect and CGSize.

The Objective-C programming language can appear a little intimidating due to it’s unique syntax. However, once your gain the syntax knowledge it is much less intimidating.

Read full article here >>