GLMapValue
Objective-C
@interface GLMapValue : NSObject
Swift
class GLMapValue : NSObject
GLMapValue holds a typed value and provides conversions to Objective‑C types.
-
Initialize value with string.
Declaration
Objective-C
- (instancetype _Nonnull)initWithString:(NSString *_Nonnull)string;Swift
init(string: String) -
Initialize value with color.
Declaration
Objective-C
- (instancetype _Nonnull)initWithColor:(GLMapColor)color;Swift
init(color: GLMapColor) -
Converts the value to a float, or
NANon failure.Declaration
Objective-C
- (CGFloat)asFloat;Swift
func asFloat() -> CGFloatReturn Value
Float value.
-
Converts the value to a string.
Declaration
Objective-C
- (NSString *_Nullable)asString;Swift
func asString() -> String?Return Value
String value.
-
Converts the value to a boolean.
Declaration
Objective-C
- (BOOL)asBool;Swift
func asBool() -> BoolReturn Value
Boolean value.
-
Converts the value to a platform color.
Declaration
Objective-C
- (PlatformColor *_Nullable)asColor;Swift
func asColor() -> NSColor?Return Value
Color value, or
nilon failure. -
Converts the value to
GLMapColor.Return Value
Color value, or a fully transparent color on failure.
-
Used for values returned by offline search. When part of the value is matched during search, this returns an
NSAttributedStringwith highlighted matches.Declaration
Objective-C
- (NSAttributedString *_Nullable) asAttributedString:(NSDictionary *_Nonnull)normalAttributes highlight:(NSDictionary *_Nonnull)highlightAttributes;Swift
func asAttributedString(_ normalAttributes: [AnyHashable : Any], highlight highlightAttributes: [AnyHashable : Any]) -> NSAttributedString?Parameters
normalAttributesNormal attributes.
highlightAttributesHighlight attributes.
Return Value
Value with highlighted matches, or
nilif formatting is not available. -
Calculates a stable hash for a string.
Declaration
Objective-C
+ (uint32_t)calcFastHash:(NSString *_Nonnull)string;Swift
class func calcFastHash(_ string: String) -> UInt32Parameters
stringInput string.
Return Value
Calculated hash.
Install in Dash