Convert UIBezierPath to String

| | August 7, 2015

when I NSLog an UIBezierPath object it shows the MoveTo and CurveTo details… so I wonder is there anyway I could convert UIBezierPath object to a string?

2 Responses to “Convert UIBezierPath to String”

  1. Amin Negm-Awad on November 30, -0001 @ 12:00 AM

    If you want a human-readable string, you can do what @rmaddy said. But take care: It is for humans, not for processing.

    If you want to have the bezier path in a processable format, you can think about serializing it. NSBezierPath conforms to NSCoding.

  2. If you want a string as you see in the NSLog then simply do:

    UIBezierPath *path = ... // your bezier path
    NSString *pathString = [NSString stringWithFormat:@"%@", path];
    

Leave a Reply