Contents

NSSizeFromString(_:)

Returns an NSSize from a text-based representation.

Declaration

func NSSizeFromString(_ aString: String) -> NSSize

Discussion

Scans aString for two numbers which are used as the width and height, in that order, to create an NSSize struct. If aString only contains a single number, it is used as the width. The aString argument should be formatted like the output of NSStringFromSize(_:), for example, @"{10,20}". If aString does not contain any numbers, this function returns an NSSize struct whose width and height are both 0.

See Also

Managing Sizes