Souhaieb Souhaieb - 8 months ago 40
Swift Question

ios - what is the meaning of greater mark ">" in swift?

can any one explain what is the meaning of ">" symbol in swift generally,
and in the sample code below:

node.hidden = remainder > slice / 2

and thanks for any help


An operator or symbol that tells the compiler to perform specific mathematical or logical manipulations. Takes two parameters first one is greater than second then will return true otherwise false In your case node.hidden = remainder > slice / 2 as it will return the boolean and decide weather the node will be hidden or visible.

Comparison Operators

Swift supports all standard C comparison operators:

  • Equal to (a == b)

  • Not equal to (a != b)

  • Greater than (a > b)
  • Less than (a < b)
  • Greater than or equal to (a >= b)
  • Less than or equal to (a <= b)

Source apple developer