main.swift569 chars16 lines
This function takes a coordinate as a CGPoint
, an upper left point as a CGPoint
, and a lower right point as a CGPoint
and returns a Bool
indicating whether the coordinate
is within the bounds defined by the upperLeft
and lowerRight
points.
It does this by checking each component of the coordinate
against each component of the upperLeft
and lowerRight
points using the >=
and <=
operators to determine if the coordinate
is within the bounds.
The usage section shows an example of how to use this function, passing in the relevant points and printing a message indicating whether the coordinate
is within the bounds or not.
gistlibby LogSnag