Rect2d
Objective-C
@interface Rect2d : NSObject
Swift
class Rect2d : NSObject
Represents a rectange the coordinate and dimension values of which are of type double
-
Declaration
Objective-C
@property double xSwift
var x: Double { get set } -
Declaration
Objective-C
@property double ySwift
var y: Double { get set } -
Declaration
Objective-C
@property double widthSwift
var width: Double { get set } -
Declaration
Objective-C
@property double heightSwift
var height: Double { get set }
-
Declaration
Objective-C
- (instancetype)init;Swift
init() -
Declaration
Objective-C
- (instancetype)initWithX:(double)x y:(double)y width:(double)width height:(double)height;Swift
init(x: Double, y: Double, width: Double, height: Double) -
Declaration
Objective-C
- (instancetype)initWithVals:(NSArray<NSNumber*>*)vals;Swift
init(vals: [NSNumber])
-
Returns the area of the rectangle
Declaration
Objective-C
- (double)area;Swift
func area() -> Double -
Determines if the rectangle is empty
Declaration
Objective-C
- (BOOL)empty;Swift
func empty() -> Bool -
Set the rectangle coordinates and dimensions from the values of an array
Declaration
Objective-C
- (void)set:(nonnull NSArray<NSNumber *> *)vals;Swift
func set(vals: [NSNumber])Parameters
valsThe array of values from which to set the rectangle coordinates and dimensions
-
Clone object
Declaration
Objective-C
- (nonnull Rect2d *)clone;Swift
func clone() -> Rect2d -
Compare for equality
Declaration
Objective-C
- (BOOL)isEqual:(nullable id)object;Swift
func isEqual(_ object: Any?) -> BoolParameters
otherObject to compare
-
Calculate hash value for this object
Declaration
Objective-C
- (NSUInteger)hash;Swift
func hash() -> UInt -
Returns a string that describes the contents of the object
Declaration
Objective-C
- (nonnull NSString *)description;Swift
func description() -> String
View on GitHub
Rect2d Class Reference