Returns whether a rectangle has zero width or height, or is a null rectangle.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
var isEmpty: Bool { get }
Parameters
rect
The rectangle to examine.
Return Value
true
if the specified rectangle is empty; otherwise, false
.
Discussion
An empty rectangle is either a null rectangle or a valid rectangle with zero height or width.