Initializing CGPoint with {} Notation

After CGPointMakeletting me down, I found out that we can use static const instead CGPoint:

static const CGPoint p = { 0.f, 0.f };

This works, but what is a curly curly brace?

+5
source share
1 answer

CGPoint is a structure:

struct CGPoint {
    CGFloat x;
    CGFloat y;
};

Is this a valid method for initializing a structure in C. See Initializing the Structure of the C / C ++ Programming Language? .

+9
source

All Articles