What is the line of code to draw axes (x and y) in a custom view?

290 Views Asked by At

I am trying to draw a plane on which can be graphed on by a calculator, and I know you can draw axis with one or a few lines of code but i do not know what they are.

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

I believe what you are looking for is NSBezierPath. It has methods like:

+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2

You may also want to take a look at NSColor which you will need to use to set what the stroke color is.

In iOS, the roughly equivalent class is UIBezierPath.