-2

What does this line represent? Please any one explain about | symbol?

self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
peko
  • 11,267
  • 4
  • 33
  • 48
Maniganda saravanan
  • 2,188
  • 1
  • 19
  • 35

1 Answers1

1

| is bitwise OR operator.

You can find more on it here.

the values of both the constanst are as, it find bitwise on them.

UIViewAutoresizingFlexibleWidth  = 1 << 1 //2

UIViewAutoresizingFlexibleHeight = 1 << 4 //16

This will be :

UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight = 18
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140