2

In order to be able to limit the positions to a list of available positions I tried the following declaration:

typedef enum
{
    feedbackPositionMiddle = {20.f,80.f},
    feedBackPositionTop    = {20.f,40.f},
    feedBackPositionBottom = {20.f,120.f}

} feedBackPosition;

However this code does not seems to be accepted. Does it misses something or is it just impossible?

Nicolas Manzini
  • 8,379
  • 6
  • 63
  • 81

1 Answers1

3

You can declare enum only of integral type, so struct or any other composite type is not allowed here. In your case const CGPoint is probably the best option:

const CGPoint kFeedbackPositionMiddle = {20.f,80.f};
...
Vladimir
  • 170,431
  • 36
  • 387
  • 313
  • 1
    Indeed my question was more something like can we create enum of something else than integral type. thanks, I wanted to avoid the const... – Nicolas Manzini Jun 11 '14 at 10:13