Programming in Swift - Part 15: Part 2: Flow Control: | Ray Wenderlich

Learn how to use switch statements in Swift, including some of its more powerful features.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3535-programming-in-swift/lessons/15

there’s a problem with the video

What problem are you seeing? It seems to load OK for me. Please include your browser info and a screenshot if possible.

Hi. I almost understand everything but can you explain to met what is the meaning of this:

case let (x, y, _) where y == x * x:
print(“Along the y=x^2 line.”)

I don’t understand what represent x * x in coordinates.
I know the demonstration is not on coordinates, but I’d like to know.

Thanks!

This means the line y = x squared.

Example:

  • If x=1, then y = 1 * 1 (1)
  • If x=2, then y = 2 * 2 (4)
  • If x=3, then y = 3 * 3 (9)

This is just a common type of graph you end up drawing in math class :]

Does that answer your question?

This topic was automatically closed after 166 days. New replies are no longer allowed.