Returns a Core Graphics point structure corresponding to the data in a given string.
SDKs
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- UIKit
Declaration
Parameters
string
A string whose contents are of the form “{x,y}”, where x is the x coordinate and y is the y coordinate. The x and y values can represent integer or float values. An example of a valid string is @”{3.0,2.5}”. The string is not localized, so items are always separated with a comma.
Return Value
A Core Graphics structure that represents a point. If the string is not well-formed, the function returns CGPoint
.
Discussion
In general, you should use this function only to convert strings that were previously created using the string(for:)
function.