Rect2i
Objective-C
@interface Rect2i : NSObject
Swift
class Rect : NSObject
Represents a rectange the coordinate and dimension values of which are of type int
-
Declaration
Objective-C
@property int xSwift
var x: Int32 { get set } -
Declaration
Objective-C
@property int ySwift
var y: Int32 { get set } -
Declaration
Objective-C
@property int widthSwift
var width: Int32 { get set } -
Declaration
Objective-C
@property int heightSwift
var height: Int32 { get set }
-
Declaration
Objective-C
- (instancetype)init;Swift
init() -
Declaration
Objective-C
- (instancetype)initWithX:(int)x y:(int)y width:(int)width height:(int)height;Swift
init(x: Int32, y: Int32, width: Int32, height: Int32) -
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 Rect2i *)clone;Swift
func clone() -> Rect -
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
Rect2i Class Reference