Size2f
Objective-C
@interface Size2f : NSObject
Swift
class Size2f : NSObject
Represents the dimensions of a rectangle the values of which are of type float
-
Declaration
Objective-C
@property float widthSwift
var width: Float { get set } -
Declaration
Objective-C
@property float heightSwift
var height: Float { get set }
-
Declaration
Objective-C
- (instancetype)init;Swift
init() -
Declaration
Objective-C
- (instancetype)initWithWidth:(float)width height:(float)height;Swift
init(width: Float, height: Float) -
Declaration
Objective-C
- (instancetype)initWithVals:(NSArray<NSNumber*>*)vals;Swift
init(vals: [NSNumber]) -
Declaration
Objective-C
+ (instancetype)width:(float)width height:(float)height;Swift
class func width(_ width: Float, height: Float) -> Self
-
Returns the area of a rectangle with corresponding dimensions
Declaration
Objective-C
- (double)area;Swift
func area() -> Double -
Determines if a rectangle with corresponding dimensions has area of zero
Declaration
Objective-C
- (BOOL)empty;Swift
func empty() -> Bool -
Set the 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 dimensions
-
Clone object
Declaration
Objective-C
- (nonnull Size2f *)clone;Swift
func clone() -> Size2f -
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
Size2f Class Reference