GPKGUtils

Objective-C

@interface GPKGUtils : NSObject

Swift

class GPKGUtils

GeoPackage utility methods

  • Add an object to an array, supports nil to NSNull translations

    Declaration

    Objective-C

    + (void)addObject:(id)object toArray:(NSMutableArray *)array;

    Swift

    class func add(_ object: Any!, toArray array: Any!)

    Parameters

    object

    object

    array

    array

  • Replace object at index in array with an object, supports nil to NSNull translations

    Declaration

    Objective-C

    + (void)replaceObjectAtIndex:(NSUInteger)index
                      withObject:(id)object
                         inArray:(NSMutableArray *)array;

    Swift

    class func replaceObject(atIndex index: Any!, with object: Any!, inArray array: Any!)

    Parameters

    index

    index

    object

    object

    array

    array

  • Insert object in an array, supports nil to NSNull translations

    Declaration

    Objective-C

    + (void)insertObject:(id)object
                 atIndex:(NSUInteger)index
                 inArray:(NSMutableArray *)array;

    Swift

    class func insert(_ object: Any!, atIndex index: Any!, inArray array: Any!)

    Parameters

    object

    object

    index

    index

    array

    array

  • Get the object at an index, supports NSNull to nil transations

    Declaration

    Objective-C

    + (id)objectAtIndex:(NSUInteger)index inArray:(NSArray *)array;

    Swift

    class func object(atIndex index: Any!, inArray array: Any!) -> Any!

    Parameters

    index

    index

    array

    array

    Return Value

    object

  • Add an object to a set, supports nil to NSNull translations

    Declaration

    Objective-C

    + (void)addObject:(id)object toSet:(NSMutableSet *)set;

    Swift

    class func add(_ object: Any!, toSet set: Any!)

    Parameters

    object

    object

    set

    set

  • Contains object in set, supports NSNull to nil transations

    Declaration

    Objective-C

    + (BOOL)containsObject:(id)object inSet:(NSMutableSet *)set;

    Swift

    class func contains(_ object: Any!, inSet set: Any!) -> Any!

    Parameters

    object

    object

    set

    set

    Return Value

    YES if contains

  • Set object in dictionary with key, supports nil to NSNull translations

    Declaration

    Objective-C

    + (void)setObject:(id)object
               forKey:(id<NSCopying>)key
         inDictionary:(NSMutableDictionary *)dictionary;

    Swift

    class func setObject(_ object: Any!, forKey key: Any!, inDictionary dictionary: Any!)

    Parameters

    object

    object

    key

    key

    dictionary

    dictionary

  • Get object in dictionary with key, supports NSNull to nil transations

    Declaration

    Objective-C

    + (id)objectForKey:(id)key inDictionary:(NSDictionary *)dictionary;

    Swift

    class func object(forKey key: Any!, inDictionary dictionary: Any!) -> Any!

    Parameters

    key

    key

    dictionary

    dictionary

    Return Value

    object

  • Get the color for the color dictionary. The dictionary should contain the keys for:

       red, green, blue, alpha     OR    white, alpha
    

    Each value should be a float between 0.0 and 1.0

    Declaration

    Objective-C

    + (id)color:(NSDictionary *)color;

    Swift

    class func color(_ color: Any!) -> Any!

    Parameters

    color

    color dictionary

    Return Value

    color

  • Get a decimal number from the number

    Declaration

    Objective-C

    + (NSDecimalNumber *)decimalNumberFromNumber:(NSNumber *)number;

    Swift

    class func decimalNumber(fromNumber number: Any!) -> Any!

    Parameters

    number

    number value

    Return Value

    decimal number

  • Compare two doubles

    Declaration

    Objective-C

    + (BOOL)compareDouble:(double)value withDouble:(double)value2;

    Swift

    class func compare(_ value: Double, with value2: Double) -> Any!

    Parameters

    value

    first double value

    value2

    second double value

    Return Value

    true if equal within epsilon

  • Compare two doubles

    Declaration

    Objective-C

    + (BOOL)compareDouble:(double)value
               withDouble:(double)value2
                 andDelta:(double)delta;

    Swift

    class func compare(_ value: Double, with value2: Double, andDelta delta: Double) -> Any!

    Parameters

    value

    first double value

    value2

    second double value

    delta

    delta comparison

    Return Value

    true if equal within epsilon

  • Compare two number doubles

    Declaration

    Objective-C

    + (BOOL)compareNumberDouble:(NSNumber *)value
               withNumberDouble:(NSNumber *)value2;

    Swift

    class func compareNumberDouble(_ value: Any!, withNumberDouble value2: Any!) -> Any!

    Parameters

    value

    first number double

    value2

    second number double

    Return Value

    true if equal within epsilon

  • Compare two number doubles

    Declaration

    Objective-C

    + (BOOL)compareNumberDouble:(NSNumber *)value
               withNumberDouble:(NSNumber *)value2
                       andDelta:(double)delta;

    Swift

    class func compareNumberDouble(_ value: Any!, withNumberDouble value2: Any!, andDelta delta: Double) -> Any!

    Parameters

    value

    first number double

    value2

    second number double

    delta

    delta comparison

    Return Value

    true if equal within epsilon