MBStringConversions Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | MBStringConversions.h |
Overview
This class provides an interface for converting between strings, expression results, and values of other types, such as:
CGFloatCGPointCGRectCGSizeNSDateFormatterStyleNSLineBreakModeNSTextAlignmentUIActivityIndicatorViewStyleUIBarButtonItemStyleUIBarButtonSystemItemUIBarStyleUIButtonTypeUIColorUIControlStateUIEdgeInsetsUIModalTransitionStyleUIOffsetUIPopoverArrowDirectionUIScrollViewIndicatorStyleUIStatusBarStyleUIStatusBarAnimationUITableViewCellAccessoryTypeUITableViewCellSelectionStyleUITableViewCellStyleUITableViewRowAnimationUITableViewStyleUITextBorderStyleUIViewAnimationOptionsUIViewContentMode
NSArray conversions
+ arrayFromCommaSeparatedString:
Splits a comma-separated string into its individual, whitespace-trimmed components.
+ (nonnull NSArray *)arrayFromCommaSeparatedString:(nonnull NSString *)strParameters
str |
The string to split. |
|---|
Return Value
An NSArray containing one or more elements. If str does not
contain any commas, the returned array will contain one element:
str itself.
Declared In
MBStringConversions.h
+ arrayFromCommaSeparatedExpressionResult:
Evaluates an expression and splits the resulting comma-separated string into its individual, whitespace-trimmed components.
+ (nonnull NSArray *)arrayFromCommaSeparatedExpressionResult:(nonnull NSString *)exprParameters
expr |
The expression. |
|---|
Return Value
An NSArray containing zero or more elements. If expr evaluates
to nil, a zero-element array is returned.
Declared In
MBStringConversions.h
+ arrayFromString:withSeparator:trimResult:
Splits a string at the given separator, returning the individual components.
+ (nonnull NSArray *)arrayFromString:(nonnull NSString *)str withSeparator:(nonnull NSString *)separator trimResult:(BOOL)trimParameters
str |
The string to split. |
|---|---|
separator |
The separator, indicating where |
trim |
If |
Return Value
An NSArray containing one or more elements.
Declared In
MBStringConversions.h
CGPoint conversions
+ pointFromString:
Attempts to interpret a string as a CGPoint value.
+ (CGPoint)pointFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The CGPoint value that corresponds with str.
Returns CGPointZero and logs an error to the
console if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“x,y” where x and y are interpreted as
floating-point numbers and used to populate the respective fields of the
returned CGPoint.
Declared In
MBStringConversions.h
+ pointFromString:error:
Attempts to interpret a string as a CGPoint value.
+ (CGPoint)pointFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The CGPoint value that corresponds with str.
Returns CGPointZero if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“x,y” where x and y are interpreted as
floating-point numbers and used to populate the respective fields of the
returned CGPoint.
Declared In
MBStringConversions.h
+ pointFromObject:error:
Attempts to interpret an arbitrary object value as a CGPoint.
+ (CGPoint)pointFromObject:(nonnull id)obj error:(NSErrorPtrPtr)errPtrParameters
obj |
The object to be interpreted. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The CGPoint value that corresponds with obj. Returns
CGPointZero if obj couldn’t be interpreted.
Discussion
The input object is interpreted as follows:
- If it is an
NSString, handling will be passed topointFromString:error: - If it is an
NSValuecontaining aCGPoint, the underlying value is returned - All other cases are considered errors
Declared In
MBStringConversions.h
+ pointFromExpression:
Evaluates an object expression and attempts to interpret the result as a
CGPoint value using the pointFromObject:error: method.
+ (CGPoint)pointFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The CGPoint value that corresponds with the
result of evaluating expr as a string. Returns
CGPointZero and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
+ stringFromPoint:
Converts a CGPoint value into a string that can be parsed by
pointFromString:.
+ (nonnull NSString *)stringFromPoint:(CGPoint)valParameters
val |
The value to convert into a string. |
|---|
Return Value
A string representation of val; never nil.
Declared In
MBStringConversions.h
CGSize conversions
+ sizeFromString:
Attempts to interpret a string as a CGSize value.
+ (CGSize)sizeFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The CGSize value that corresponds with str.
Returns CGPointZero and logs an error to the
console if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“width,height” where width and height are interpreted as
floating-point numbers and used to populate the respective fields of the
returned CGSize.
Declared In
MBStringConversions.h
+ sizeFromString:error:
Attempts to interpret a string as a CGSize value.
+ (CGSize)sizeFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The CGSize value that corresponds with str.
Returns CGPointZero if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“width,height” where width and height are interpreted as
floating-point numbers and used to populate the respective fields of the
returned CGSize.
Declared In
MBStringConversions.h
+ sizeFromObject:error:
Attempts to interpret an arbitrary object value as a CGSize.
+ (CGSize)sizeFromObject:(nonnull id)obj error:(NSErrorPtrPtr)errPtrParameters
obj |
The object to be interpreted. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The CGSize value that corresponds with obj. Returns
CGSizeZero if obj couldn’t be interpreted.
Discussion
The input object is interpreted as follows:
- If it is an
NSString, handling will be passed tosizeFromString:error: - If it is an
NSValuecontaining aCGSize, the underlying value is returned - All other cases are considered errors
Declared In
MBStringConversions.h
+ sizeFromExpression:
Evaluates an object expression and attempts to interpret the result as a
CGSize value using the sizeFromObject:error: method.
+ (CGSize)sizeFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The CGSize value that corresponds with the
result of evaluating expr as a string. Returns
CGSizeZero and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
+ stringFromSize:
Converts a CGSize value into a string that can be parsed by
sizeFromString:.
+ (nonnull NSString *)stringFromSize:(CGSize)valParameters
val |
The value to convert into a string. |
|---|
Return Value
A string representation of val; never nil.
Declared In
MBStringConversions.h
CGRect conversions
+ rectFromString:
Attempts to interpret a string as a CGRect value.
+ (CGRect)rectFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The CGRect value that corresponds with str.
Returns CGRectZero and logs an error to the
console if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“x,y,width,height” where x, y, width and
height are interpreted as floating-point numbers and used to populate
the respective fields of the returned CGRect.
Declared In
MBStringConversions.h
+ rectFromString:error:
Attempts to interpret a string as a CGRect value.
+ (CGRect)rectFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The CGRect value that corresponds with str.
Returns CGRectZero if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“x,y,width,height” where x, y, width and
height are interpreted as floating-point numbers and used to populate
the respective fields of the returned CGRect.
Declared In
MBStringConversions.h
+ rectFromObject:error:
Attempts to interpret an arbitrary object value as a CGRect.
+ (CGRect)rectFromObject:(nonnull id)obj error:(NSErrorPtrPtr)errPtrParameters
obj |
The object to be interpreted. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The CGRect value that corresponds with obj. Returns
CGRectZero if obj couldn’t be interpreted.
Discussion
The input object is interpreted as follows:
- If it is an
NSString, handling will be passed torectFromString:error: - If it is an
NSValuecontaining aCGRect, the underlying value is returned - All other cases are considered errors
Declared In
MBStringConversions.h
+ rectFromExpression:
Evaluates an object expression and attempts to interpret the result as a
CGRect value using the rectFromObject:error: method.
+ (CGRect)rectFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The CGRect value that corresponds with the
result of evaluating expr as a string. Returns
CGRectZero and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
+ stringFromRect:
Converts a CGRect value into a string that can be parsed by
rectFromString:.
+ (nonnull NSString *)stringFromRect:(CGRect)valParameters
val |
The value to convert into a string. |
|---|
Return Value
A string representation of val; never nil.
Declared In
MBStringConversions.h
Parsing strings containing UIViewNoIntrinsicMetric wildcards
+ sizeDimensionFromExpression:
Evaluates an expression as a size dimension value.
+ (CGFloat)sizeDimensionFromExpression:(nonnull NSString *)exprParameters
expr |
The size dimension expression. This expression is expected to yield either a numeric value or a string containing only the wildcard character. |
|---|
Return Value
The value of the size dimension yielded by the expression expr.
Discussion
Used to convert expressions into values for width and height dimensions.
The wildcard character (‘*’) can be used to specify the value
UIViewNoIntrinsicMetric.
Declared In
MBStringConversions.h
+ sizeDimensionFromString:
Parses a string into a size dimension value.
+ (CGFloat)sizeDimensionFromString:(nonnull NSString *)strParameters
str |
The size dimension, as a string. This string is expected to contain either a numeric value or the wildcard character. |
|---|
Return Value
The value of the size dimension specified by str.
Discussion
Used to convert strings into values for the width and height dimensions.
The wildcard character (‘*’) can be used to specify the value
UIViewNoIntrinsicMetric.
Declared In
MBStringConversions.h
+ parseString:asSize:
Parses a CGSize from a comma-separated string containing two components:
a width and a height.
+ (BOOL)parseString:(nonnull NSString *)sizeStr asSize:(nonnull out CGSize *)sizePtrParameters
sizeStr |
A string following the format “ |
|---|---|
sizePtr |
If the string to be parsed is in the expected format,
on exit, the |
Return Value
YES on success; NO if the input string is not in the expected
format.
Discussion
Either dimension may be specified as a wildcard (meaning that its value
is derived programmatically during layout). When a wildcard character (‘*’)
is specified as the value for a given dimension, that dimension is set to
UIViewNoIntrinsicMetric.
Declared In
MBStringConversions.h
+ parseString:asRect:
Parses a CGRect from a comma-separated string containing four components:
the x and y coordinates of the rectangle’s origin, followed by the width
and height dimensions of the rectangle.
+ (BOOL)parseString:(nonnull NSString *)rectStr asRect:(nonnull out CGRect *)rectPtrParameters
rectStr |
A string following the format
“ |
|---|---|
rectPtr |
If the string to be parsed is in the expected format,
on exit, the |
Return Value
YES on success; NO if the input string is not in the expected
format.
Discussion
The width and height dimensions may be specified as wildcards (meaning that
their values are derived programmatically during layout). When a wildcard
character (‘*’) is specified as the value for the width or height, that
dimension is set to UIViewNoIntrinsicMetric.
Declared In
MBStringConversions.h
NSLineBreakMode conversions
+ lineBreakModeFromString:
Attempts to interpret a string as an NSLineBreakMode value.
+ (NSLineBreakMode)lineBreakModeFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The NSLineBreakMode value that corresponds with str.
Returns NSLineBreakByWordWrapping and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLLineBreakByWordWrapping(“wordWrap”) →NSLineBreakByWordWrappingkMBMLLineBreakByCharWrapping(“charWrap”) →NSLineBreakByCharWrappingkMBMLLineBreakByClipping(“clip”) →NSLineBreakByClippingkMBMLLineBreakByTruncatingHead(“headTruncation”) →NSLineBreakByTruncatingHeadkMBMLLineBreakByTruncatingTail(“tailTruncation”) →NSLineBreakByTruncatingTailkMBMLLineBreakByTruncatingMiddle(“middleTruncation”) →NSLineBreakByTruncatingMiddle
Declared In
MBStringConversions.h
+ lineBreakModeFromString:error:
Attempts to interpret a string as an NSLineBreakMode value.
+ (NSLineBreakMode)lineBreakModeFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The NSLineBreakMode value that corresponds with str.
Returns NSLineBreakByWordWrapping if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLLineBreakByWordWrapping(“wordWrap”) →NSLineBreakByWordWrappingkMBMLLineBreakByCharWrapping(“charWrap”) →NSLineBreakByCharWrappingkMBMLLineBreakByClipping(“clip”) →NSLineBreakByClippingkMBMLLineBreakByTruncatingHead(“headTruncation”) →NSLineBreakByTruncatingHeadkMBMLLineBreakByTruncatingTail(“tailTruncation”) →NSLineBreakByTruncatingTailkMBMLLineBreakByTruncatingMiddle(“middleTruncation”) →NSLineBreakByTruncatingMiddle
Declared In
MBStringConversions.h
+ lineBreakModeFromExpression:
Evaluates a string expression and attempts to interpret the result as an
NSLineBreakMode value using the lineBreakModeFromString: method.
+ (NSLineBreakMode)lineBreakModeFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The NSLineBreakMode value that corresponds with the
result of evaluating expr as a string. Returns
NSLineBreakByWordWrapping and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
NSTextAlignment conversions
+ textAlignmentFromString:
Attempts to interpret a string as an NSTextAlignment value.
+ (NSTextAlignment)textAlignmentFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The NSTextAlignment value that corresponds with str.
Returns NSTextAlignmentLeft and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTextAlignmentLeft(“left”) →NSTextAlignmentLeftkMBMLTextAlignmentCenter(“center”) →NSTextAlignmentCenterkMBMLTextAlignmentRight(“right”) →NSTextAlignmentRight
Declared In
MBStringConversions.h
+ textAlignmentFromString:error:
Attempts to interpret a string as an NSTextAlignment value.
+ (NSTextAlignment)textAlignmentFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The NSTextAlignment value that corresponds with str.
Returns NSTextAlignmentLeft if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTextAlignmentLeft(“left”) →NSTextAlignmentLeftkMBMLTextAlignmentCenter(“center”) →NSTextAlignmentCenterkMBMLTextAlignmentRight(“right”) →NSTextAlignmentRight
Declared In
MBStringConversions.h
+ textAlignmentFromExpression:
Evaluates a string expression and attempts to interpret the result as an
NSTextAlignment value using the textAlignmentFromString: method.
+ (NSTextAlignment)textAlignmentFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The NSTextAlignment value that corresponds with the
result of evaluating expr as a string. Returns
NSTextAlignmentLeft and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
NSDateFormatterStyle conversions
+ dateFormatterStyleFromString:
Attempts to interpret a string as an NSDateFormatterStyle value.
+ (NSDateFormatterStyle)dateFormatterStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The NSDateFormatterStyle value that corresponds with str.
Returns NSDateFormatterNoStyle and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLDateFormatterNoStyle(“none”) →NSDateFormatterNoStylekMBMLDateFormatterShortStyle(“short”) →NSDateFormatterShortStylekMBMLDateFormatterMediumStyle(“medium”) →NSDateFormatterMediumStylekMBMLDateFormatterLongStyle(“long”) →NSDateFormatterLongStylekMBMLDateFormatterFullStyle(“full”) →NSDateFormatterFullStyle
Declared In
MBStringConversions.h
+ dateFormatterStyleFromString:error:
Attempts to interpret a string as an NSDateFormatterStyle value.
+ (NSDateFormatterStyle)dateFormatterStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The NSDateFormatterStyle value that corresponds with str.
Returns NSDateFormatterNoStyle if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLDateFormatterNoStyle(“none”) →NSDateFormatterNoStylekMBMLDateFormatterShortStyle(“short”) →NSDateFormatterShortStylekMBMLDateFormatterMediumStyle(“medium”) →NSDateFormatterMediumStylekMBMLDateFormatterLongStyle(“long”) →NSDateFormatterLongStylekMBMLDateFormatterFullStyle(“full”) →NSDateFormatterFullStyle
Declared In
MBStringConversions.h
+ dateFormatterStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as an
NSDateFormatterStyle value using the dateFormatterStyleFromString:
method.
+ (NSDateFormatterStyle)dateFormatterStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The NSDateFormatterStyle value that corresponds with the
result of evaluating expr as a string. Returns
NSDateFormatterNoStyle and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIOffset conversions
+ offsetFromString:
Attempts to interpret a string as a UIOffset value.
+ (UIOffset)offsetFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIOffset value that corresponds with str.
Returns UIOffsetZero and logs an error to the
console if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“horizontal,vertical” where horizontal and vertical are
interpreted as floating-point numbers and used to populate the respective
fields of the returned UIOffset.
Declared In
MBStringConversions.h
+ offsetFromString:error:
Attempts to interpret a string as a UIOffset value.
+ (UIOffset)offsetFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIOffset value that corresponds with str.
Returns UIOffsetZero if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“horizontal,vertical” where horizontal and vertical are
interpreted as floating-point numbers and used to populate the respective
fields of the returned UIOffset.
Declared In
MBStringConversions.h
+ offsetFromObject:error:
Attempts to interpret an arbitrary object value as a UIOffset.
+ (UIOffset)offsetFromObject:(nonnull id)obj error:(NSErrorPtrPtr)errPtrParameters
obj |
The object to be interpreted. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIOffset value that corresponds with obj. Returns
UIOffsetZero if obj couldn’t be interpreted.
Discussion
The input object is interpreted as follows:
- If it is an
NSString, handling will be passed tooffsetFromString:error: - If it is an
NSValuecontaining aUIOffset, the underlying value is returned - All other cases are considered errors
Declared In
MBStringConversions.h
+ offsetFromExpression:
Evaluates an object expression and attempts to interpret the result as a
UIOffset value using the offsetFromObject:error: method.
+ (UIOffset)offsetFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIOffset value that corresponds with the
result of evaluating expr as a string. Returns
UIOffsetZero and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIEdgeInsets conversions
+ edgeInsetsFromString:
Attempts to interpret a string as a UIEdgeInsets value.
+ (UIEdgeInsets)edgeInsetsFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIEdgeInsets value that corresponds with str.
Returns UIEdgeInsetsZero and logs an error to the
console if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“top,left,bottom,right” where
top, left, bottom and right are interpreted as floating-point
numbers and used to populate the respective fields of the returned
UIEdgeInsets.
Declared In
MBStringConversions.h
+ edgeInsetsFromString:error:
Attempts to interpret a string as a UIEdgeInsets value.
+ (UIEdgeInsets)edgeInsetsFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIEdgeInsets value that corresponds with str.
Returns UIEdgeInsetsZero if str couldn’t be interpreted.
Discussion
The input will be parsed as a comma-separating string in the format
“top,left,bottom,right” where
top, left, bottom and right are interpreted as floating-point
numbers and used to populate the respective fields of the returned
UIEdgeInsets.
Declared In
MBStringConversions.h
+ edgeInsetsFromObject:error:
Attempts to interpret an arbitrary object value as a UIEdgeInsets.
+ (UIEdgeInsets)edgeInsetsFromObject:(nonnull id)obj error:(NSErrorPtrPtr)errPtrParameters
obj |
The object to be interpreted. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIEdgeInsets value that corresponds with obj. Returns
UIEdgeInsetsZero if obj couldn’t be interpreted.
Discussion
The input object is interpreted as follows:
- If it is an
NSString, handling will be passed toedgeInsetsFromString:error: - If it is an
NSValuecontaining aUIEdgeInsets, the underlying value is returned - All other cases are considered errors
Declared In
MBStringConversions.h
+ edgeInsetsFromExpression:
Evaluates an object expression and attempts to interpret the result as a
UIEdgeInsets value using the edgeInsetsFromObject:error: method.
+ (UIEdgeInsets)edgeInsetsFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIEdgeInsets value that corresponds with the
result of evaluating expr as a string. Returns
UIEdgeInsetsZero and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIColor conversions
+ colorFromString:
Attempts to interpret a string as a UIColor value.
+ (nonnull UIColor *)colorFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIColor value that corresponds with the
result of evaluating expr as a string. Returns
[UIColor yellowColor] and logs an error to the
console if the expression result couldn’t be interpreted.
Discussion
This method can accept named colors as well as color values specified in hexadecimal notation, commonly referred to as web colors.
Named colors
Named colors utilize the UIColor convention of providing a class method
with a selector following the format: nameColor. The value returned by
any UIColor class method named in this way can be referenced simply as
name.
In other words, passing the input string “white” will return
[UIColor whiteColor], “clear” will return
[UIColor clearColor], and “darkGray” will return
[UIColor darkGrayColor].
This applies to all UIColor class methods following that naming convention,
including ones added through class categories. This means you can introduce
your own custom named colors simply by creating a UIColor category that
adds an implementation to return the appropriate UIColor.
Web colors
Web colors are specified with a leading hash sign (#) followed by
6 or 8 hexadecimal digits specifying 3 or 4 color channels, respectively.
Each color channel is specified with a two-digit case-insensitive
hexadecimal value between 00 and FF in the format #RRGGBB or
#RRGGBBAA where:
RRspecifies the red component of the colorGGspecifies the green component of the colorBBspecifies the blue component of the color- The optional
AAspecifies the color’s alpha channel, which determines its opacity
Declared In
MBStringConversions.h
+ colorFromString:error:
Attempts to interpret a string as a UIColor value.
+ (nonnull UIColor *)colorFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIColor value that corresponds with the
result of evaluating expr as a string. Returns
[UIColor yellowColor] if the expression result
couldn’t be interpreted.
Discussion
This method can accept named colors as well as color values specified in hexadecimal notation, commonly referred to as web colors.
Named colors
Named colors utilize the UIColor convention of providing a class method
with a selector following the format: nameColor. The value returned by
any UIColor class method named in this way can be referenced simply as
name.
In other words, passing the input string “white” will return
[UIColor whiteColor], “clear” will return
[UIColor clearColor], and “darkGray” will return
[UIColor darkGrayColor].
This applies to all UIColor class methods following that naming convention,
including ones added through class categories. This means you can introduce
your own custom named colors simply by creating a UIColor category that
adds an implementation to return the appropriate UIColor.
Web colors
Web colors are specified with a leading hash sign (#) followed by
6 or 8 hexadecimal digits specifying 3 or 4 color channels, respectively.
Each color channel is specified with a two-digit case-insensitive
hexadecimal value between 00 and FF in the format #RRGGBB or
#RRGGBBAA where:
RRspecifies the red component of the colorGGspecifies the green component of the colorBBspecifies the blue component of the color- The optional
AAspecifies the color’s alpha channel, which determines its opacity
Declared In
MBStringConversions.h
+ colorFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIColor value using the colorFromString: method.
+ (nonnull UIColor *)colorFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIColor value that corresponds with the
result of evaluating expr as a string. Returns
[UIColor yellowColor] and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIScrollViewIndicatorStyle conversions
+ scrollViewIndicatorStyleFromString:
Attempts to interpret a string as a UIScrollViewIndicatorStyle value.
+ (UIScrollViewIndicatorStyle)scrollViewIndicatorStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIScrollViewIndicatorStyle value that corresponds with str.
Returns UIScrollViewIndicatorStyleDefault and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLScrollViewIndicatorStyleDefault(“default”) →UIScrollViewIndicatorStyleDefaultkMBMLScrollViewIndicatorStyleBlack(“black”) →UIScrollViewIndicatorStyleBlackkMBMLScrollViewIndicatorStyleWhite(“white”) →UIScrollViewIndicatorStyleWhite
Declared In
MBStringConversions.h
+ scrollViewIndicatorStyleFromString:error:
Attempts to interpret a string as a UIScrollViewIndicatorStyle value.
+ (UIScrollViewIndicatorStyle)scrollViewIndicatorStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIScrollViewIndicatorStyle value that corresponds with str.
Returns UIScrollViewIndicatorStyleDefault if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLScrollViewIndicatorStyleDefault(“default”) →UIScrollViewIndicatorStyleDefaultkMBMLScrollViewIndicatorStyleBlack(“black”) →UIScrollViewIndicatorStyleBlackkMBMLScrollViewIndicatorStyleWhite(“white”) →UIScrollViewIndicatorStyleWhite
Declared In
MBStringConversions.h
+ scrollViewIndicatorStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIScrollViewIndicatorStyle value using the
scrollViewIndicatorStyleFromString: method.
+ (UIScrollViewIndicatorStyle)scrollViewIndicatorStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIScrollViewIndicatorStyle value that corresponds with the
result of evaluating expr as a string. Returns
UIScrollViewIndicatorStyleDefault and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIActivityIndicatorViewStyle conversions
+ activityIndicatorViewStyleFromString:
Attempts to interpret a string as a UIActivityIndicatorViewStyle value.
+ (UIActivityIndicatorViewStyle)activityIndicatorViewStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIActivityIndicatorViewStyle value that corresponds with
str. Returns UIActivityIndicatorViewStyleWhite and logs an error
to the console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLActivityIndicatorViewStyleWhiteLarge(“whiteLarge”) →UIActivityIndicatorViewStyleWhiteLargekMBMLActivityIndicatorViewStyleWhite(“white”) →UIActivityIndicatorViewStyleWhitekMBMLActivityIndicatorViewStyleGray(“gray”) →UIActivityIndicatorViewStyleGray
Declared In
MBStringConversions.h
+ activityIndicatorViewStyleFromString:error:
Attempts to interpret a string as a UIActivityIndicatorViewStyle value.
+ (UIActivityIndicatorViewStyle)activityIndicatorViewStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIActivityIndicatorViewStyle value that corresponds with
str. Returns UIActivityIndicatorViewStyleWhite if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLActivityIndicatorViewStyleWhiteLarge(“whiteLarge”) →UIActivityIndicatorViewStyleWhiteLargekMBMLActivityIndicatorViewStyleWhite(“white”) →UIActivityIndicatorViewStyleWhitekMBMLActivityIndicatorViewStyleGray(“gray”) →UIActivityIndicatorViewStyleGray
Declared In
MBStringConversions.h
+ activityIndicatorViewStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIActivityIndicatorViewStyle value using the
activityIndicatorViewStyleFromString: method.
+ (UIActivityIndicatorViewStyle)activityIndicatorViewStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIActivityIndicatorViewStyle value that corresponds with the
result of evaluating expr as a string. Returns
UIActivityIndicatorViewStyleWhite and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIButtonType conversions
+ buttonTypeFromString:
Attempts to interpret a string as a UIButtonType value.
+ (UIButtonType)buttonTypeFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIButtonType value that corresponds with str.
Returns UIButtonTypeCustom and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLButtonTypeCustom(“custom”) →UIButtonTypeCustomkMBMLButtonTypeRoundedRect(“rounded”) →UIButtonTypeRoundedRectkMBMLButtonTypeDetailDisclosure(“detailDisclosure”) →UIButtonTypeDetailDisclosurekMBMLButtonTypeInfoLight(“infoLight”) →UIButtonTypeInfoLightkMBMLButtonTypeInfoDark(“infoDark”) →UIButtonTypeInfoDarkkMBMLButtonTypeContactAdd(“contactAdd”) →UIButtonTypeContactAdd
Declared In
MBStringConversions.h
+ buttonTypeFromString:error:
Attempts to interpret a string as a UIButtonType value.
+ (UIButtonType)buttonTypeFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIButtonType value that corresponds with str.
Returns UIButtonTypeCustom if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLButtonTypeCustom(“custom”) →UIButtonTypeCustomkMBMLButtonTypeRoundedRect(“rounded”) →UIButtonTypeRoundedRectkMBMLButtonTypeDetailDisclosure(“detailDisclosure”) →UIButtonTypeDetailDisclosurekMBMLButtonTypeInfoLight(“infoLight”) →UIButtonTypeInfoLightkMBMLButtonTypeInfoDark(“infoDark”) →UIButtonTypeInfoDarkkMBMLButtonTypeContactAdd(“contactAdd”) →UIButtonTypeContactAdd
Declared In
MBStringConversions.h
+ buttonTypeFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIButtonType value using the buttonTypeFromString:
method.
+ (UIButtonType)buttonTypeFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIButtonType value that corresponds with the
result of evaluating expr as a string. Returns
UIButtonTypeCustom and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UITextBorderStyle conversions
+ textBorderStyleFromString:
Attempts to interpret a string as a UITextBorderStyle value.
+ (UITextBorderStyle)textBorderStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UITextBorderStyle value that corresponds with str.
Returns UITextBorderStyleNone and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTextBorderStyleNone(“none”) →UITextBorderStyleNonekMBMLTextBorderStyleLine(“line”) →UITextBorderStyleNonekMBMLTextBorderStyleBezel(“bezel”) →UITextBorderStyleBezelkMBMLTextBorderStyleRoundedRect(“rounded”) →UITextBorderStyleRoundedRect
Declared In
MBStringConversions.h
+ textBorderStyleFromString:error:
Attempts to interpret a string as a UITextBorderStyle value.
+ (UITextBorderStyle)textBorderStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UITextBorderStyle value that corresponds with str.
Returns UITextBorderStyleNone if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTextBorderStyleNone(“none”) →UITextBorderStyleNonekMBMLTextBorderStyleLine(“line”) →UITextBorderStyleNonekMBMLTextBorderStyleBezel(“bezel”) →UITextBorderStyleBezelkMBMLTextBorderStyleRoundedRect(“rounded”) →UITextBorderStyleRoundedRect
Declared In
MBStringConversions.h
+ textBorderStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UITextBorderStyle value using the textBorderStyleFromString:
method.
+ (UITextBorderStyle)textBorderStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UITextBorderStyle value that corresponds with the
result of evaluating expr as a string. Returns
UITextBorderStyleNone and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UITableViewStyle conversions
+ tableViewStyleFromString:
Attempts to interpret a string as a UITableViewStyle value.
+ (UITableViewStyle)tableViewStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UITableViewStyle value that corresponds with str.
Returns UITableViewStylePlain and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewStylePlain(“plain”) →UITableViewStylePlainkMBMLTableViewStyleGrouped(“grouped”) →UITableViewStyleGrouped
Declared In
MBStringConversions.h
+ tableViewStyleFromString:error:
Attempts to interpret a string as a UITableViewStyle value.
+ (UITableViewStyle)tableViewStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UITableViewStyle value that corresponds with str.
Returns UITableViewStylePlain if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewStylePlain(“plain”) →UITableViewStylePlainkMBMLTableViewStyleGrouped(“grouped”) →UITableViewStyleGrouped
Declared In
MBStringConversions.h
+ tableViewStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UITableViewStyle value using the tableViewStyleFromString:
method.
+ (UITableViewStyle)tableViewStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UITableViewStyle value that corresponds with the
result of evaluating expr as a string. Returns
UITableViewStylePlain and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UITableViewCell-related conversions
+ tableViewCellStyleFromString:
Attempts to interpret a string as a UITableViewCellStyle value.
+ (UITableViewCellStyle)tableViewCellStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UITableViewCellStyle value that corresponds with str.
Returns UITableViewCellStyleDefault and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewCellStyleDefault(“default”) →UITableViewCellStyleDefaultkMBMLTableViewCellStyleValue1(“value1”) →UITableViewCellStyleValue1kMBMLTableViewCellStyleValue2(“value2”) →UITableViewCellStyleValue2kMBMLTableViewCellStyleSubtitle(“subtitle”) →UITableViewCellStyleSubtitle
Declared In
MBStringConversions.h
+ tableViewCellStyleFromString:error:
Attempts to interpret a string as a UITableViewCellStyle value.
+ (UITableViewCellStyle)tableViewCellStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UITableViewCellStyle value that corresponds with str.
Returns UITableViewCellStyleDefault if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewCellStyleDefault(“default”) →UITableViewCellStyleDefaultkMBMLTableViewCellStyleValue1(“value1”) →UITableViewCellStyleValue1kMBMLTableViewCellStyleValue2(“value2”) →UITableViewCellStyleValue2kMBMLTableViewCellStyleSubtitle(“subtitle”) →UITableViewCellStyleSubtitle
Declared In
MBStringConversions.h
+ tableViewCellStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UITableViewCellStyle value using the tableViewCellStyleFromString:
method.
+ (UITableViewCellStyle)tableViewCellStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UITableViewCellStyle value that corresponds with the
result of evaluating expr as a string. Returns
UITableViewCellStyleDefault and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
+ tableViewCellSelectionStyleFromString:
Attempts to interpret a string as an MBTableViewCellSelectionStyle value,
a special type that is cast-compatible with UITableViewCellSelectionStyle
but adds the value MBTableViewCellSelectionStyleGradient to represent a
custom cell selection style using a gradient.
+ (MBTableViewCellSelectionStyle)tableViewCellSelectionStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The MBTableViewCellSelectionStyle value that corresponds with the
result of evaluating expr as a string. Returns
UITableViewCellSelectionStyleBlue and logs an error to the
console if the expression result couldn’t be interpreted.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewCellSelectionStyleNone(“none”) →UITableViewCellSelectionStyleNonekMBMLTableViewCellSelectionStyleBlue(“blue”) →UITableViewCellSelectionStyleBluekMBMLTableViewCellSelectionStyleGray(“gray”) →UITableViewCellSelectionStyleGraykMBMLTableViewCellSelectionStyleGradient(“gradient”) →MBTableViewCellSelectionStyleGradient
Declared In
MBStringConversions.h
+ tableViewCellSelectionStyleFromString:error:
Attempts to interpret a string as an MBTableViewCellSelectionStyle value,
a special type that is cast-compatible with UITableViewCellSelectionStyle
but adds the value MBTableViewCellSelectionStyleGradient to represent a
custom cell selection style using a gradient.
+ (MBTableViewCellSelectionStyle)tableViewCellSelectionStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The MBTableViewCellSelectionStyle value that corresponds with
str. Returns UITableViewCellSelectionStyleBlue if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewCellSelectionStyleNone(“none”) →UITableViewCellSelectionStyleNonekMBMLTableViewCellSelectionStyleBlue(“blue”) →UITableViewCellSelectionStyleBluekMBMLTableViewCellSelectionStyleGray(“gray”) →UITableViewCellSelectionStyleGraykMBMLTableViewCellSelectionStyleGradient(“gradient”) →MBTableViewCellSelectionStyleGradient
Declared In
MBStringConversions.h
+ tableViewCellSelectionStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as an
MBTableViewCellSelectionStyle value using the
tableViewCellSelectionStyleFromString: method.
+ (MBTableViewCellSelectionStyle)tableViewCellSelectionStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The MBTableViewCellSelectionStyle value that corresponds with the
result of evaluating expr as a string. Returns
UITableViewCellSelectionStyleBlue and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
+ tableViewCellAccessoryTypeFromString:
Attempts to interpret a string as a UITableViewCellAccessoryType value.
+ (UITableViewCellAccessoryType)tableViewCellAccessoryTypeFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UITableViewCellAccessoryType value that corresponds with
str. Returns UITableViewCellAccessoryNone and logs an error to
the console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewCellAccessoryNone(“none”) →UITableViewCellAccessoryNonekMBMLTableViewCellAccessoryDisclosureIndicator(“disclosureIndicator”) →UITableViewCellAccessoryDisclosureIndicatorkMBMLTableViewCellAccessoryDetailDisclosureButton(“detailDisclosureButton”) →UITableViewCellAccessoryDetailDisclosureButtonkMBMLTableViewCellAccessoryCheckmark(“checkmark”) →UITableViewCellAccessoryCheckmark
Declared In
MBStringConversions.h
+ tableViewCellAccessoryTypeFromString:error:
Attempts to interpret a string as a UITableViewCellAccessoryType value.
+ (UITableViewCellAccessoryType)tableViewCellAccessoryTypeFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UITableViewCellAccessoryType value that corresponds with
str. Returns UITableViewCellAccessoryNone if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewCellAccessoryNone(“none”) →UITableViewCellAccessoryNonekMBMLTableViewCellAccessoryDisclosureIndicator(“disclosureIndicator”) →UITableViewCellAccessoryDisclosureIndicatorkMBMLTableViewCellAccessoryDetailDisclosureButton(“detailDisclosureButton”) →UITableViewCellAccessoryDetailDisclosureButtonkMBMLTableViewCellAccessoryCheckmark(“checkmark”) →UITableViewCellAccessoryCheckmark
Declared In
MBStringConversions.h
+ tableViewCellAccessoryTypeFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UITableViewCellAccessoryType value using the
tableViewCellAccessoryTypeFromString: method.
+ (UITableViewCellAccessoryType)tableViewCellAccessoryTypeFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UITableViewCellAccessoryType value that corresponds with the
result of evaluating expr as a string. Returns
UITableViewCellAccessoryNone and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UITableViewRowAnimation conversions
+ tableViewRowAnimationFromString:
Attempts to interpret a string as a UITableViewRowAnimation value.
+ (UITableViewRowAnimation)tableViewRowAnimationFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UITableViewRowAnimation value that corresponds with str.
Returns UITableViewRowAnimationNone and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewRowAnimationNone(“none”) →UITableViewRowAnimationNonekMBMLTableViewRowAnimationFade(“fade”) →UITableViewRowAnimationFadekMBMLTableViewRowAnimationRight(“right”) →UITableViewRowAnimationRightkMBMLTableViewRowAnimationLeft(“left”) →UITableViewRowAnimationLeftkMBMLTableViewRowAnimationTop(“top”) →UITableViewRowAnimationTopkMBMLTableViewRowAnimationBottom(“bottom”) →UITableViewRowAnimationBottomkMBMLTableViewRowAnimationMiddle(“middle”) →UITableViewRowAnimationMiddle
Declared In
MBStringConversions.h
+ tableViewRowAnimationFromString:error:
Attempts to interpret a string as a UITableViewRowAnimation value.
+ (UITableViewRowAnimation)tableViewRowAnimationFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UITableViewRowAnimation value that corresponds with str.
Returns UITableViewRowAnimationNone if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLTableViewRowAnimationNone(“none”) →UITableViewRowAnimationNonekMBMLTableViewRowAnimationFade(“fade”) →UITableViewRowAnimationFadekMBMLTableViewRowAnimationRight(“right”) →UITableViewRowAnimationRightkMBMLTableViewRowAnimationLeft(“left”) →UITableViewRowAnimationLeftkMBMLTableViewRowAnimationTop(“top”) →UITableViewRowAnimationTopkMBMLTableViewRowAnimationBottom(“bottom”) →UITableViewRowAnimationBottomkMBMLTableViewRowAnimationMiddle(“middle”) →UITableViewRowAnimationMiddle
Declared In
MBStringConversions.h
+ tableViewRowAnimationFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UITableViewRowAnimation value using the tableViewRowAnimationFromString:
method.
+ (UITableViewRowAnimation)tableViewRowAnimationFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UITableViewRowAnimation value that corresponds with the
result of evaluating expr as a string. Returns
UITableViewRowAnimationNone and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIControlState conversions
+ controlStateFromString:
Attempts to interpret a string as a UIControlState value.
+ (UIControlState)controlStateFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIControlState value that corresponds with str.
Returns UIControlStateNormal and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLControlStateNormal(“normal”) →UIControlStateNormalkMBMLControlStateHighlighted(“highlighted”) →UIControlStateHighlightedkMBMLControlStateDisabled(“disabled”) →UIControlStateDisabledkMBMLControlStateSelected(“selected”) →UIControlStateSelected
Declared In
MBStringConversions.h
+ controlStateFromString:error:
Attempts to interpret a string as a UIControlState value.
+ (UIControlState)controlStateFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIControlState value that corresponds with str.
Returns UIControlStateNormal if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLControlStateNormal(“normal”) →UIControlStateNormalkMBMLControlStateHighlighted(“highlighted”) →UIControlStateHighlightedkMBMLControlStateDisabled(“disabled”) →UIControlStateDisabledkMBMLControlStateSelected(“selected”) →UIControlStateSelected
Declared In
MBStringConversions.h
+ controlStateFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIControlState value using the controlStateFromString:
method.
+ (UIControlState)controlStateFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIControlState value that corresponds with the
result of evaluating expr as a string. Returns
UIControlStateNormal and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIViewAnimationOptions conversions
+ viewAnimationOptionsFromString:
Attempts to interpret a string as a UIViewAnimationOptions value.
+ (UIViewAnimationOptions)viewAnimationOptionsFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIViewAnimationOptions value that corresponds with str.
Returns 0 and logs an error to the console if str isn’t
recognized.
Discussion
UIViewAnimationOptions is constructed as a bit flag, which means each
individual value can be combined to indicate the selection of multiple options.
The input string expects a comma-separated list containing zero or more flags. Whitespace between commas and flags is permitted but not required.
The following string constants show the accepted flags, along with their corresponding values:
kMBMLViewAnimationOptionLayoutSubviews(“layoutSubviews”) →UIViewAnimationOptionLayoutSubviewskMBMLViewAnimationOptionAllowUserInteraction(“allowUserInteraction”) →UIViewAnimationOptionAllowUserInteractionkMBMLViewAnimationOptionBeginFromCurrentState(“beginFromCurrentState”) →UIViewAnimationOptionBeginFromCurrentStatekMBMLViewAnimationOptionRepeat(“repeat”) →UIViewAnimationOptionRepeatkMBMLViewAnimationOptionAutoreverse(“autoreverse”) →UIViewAnimationOptionAutoreversekMBMLViewAnimationOptionOverrideInheritedDuration(“overrideInheritedDuration”) →UIViewAnimationOptionOverrideInheritedDurationkMBMLViewAnimationOptionOverrideInheritedCurve(“overrideInheritedCurve”) →UIViewAnimationOptionOverrideInheritedCurvekMBMLViewAnimationOptionAllowAnimatedContent(“allowAnimatedContent”) →UIViewAnimationOptionAllowAnimatedContentkMBMLViewAnimationOptionShowHideTransitionViews(“showHideTransitionViews”) →UIViewAnimationOptionShowHideTransitionViewskMBMLViewAnimationOptionCurveEaseInOut(“curveEaseInOut”) →UIViewAnimationOptionCurveEaseInOutkMBMLViewAnimationOptionCurveEaseIn(“curveEaseIn”) →UIViewAnimationOptionCurveEaseInkMBMLViewAnimationOptionCurveEaseOut(“curveEaseOut”) →UIViewAnimationOptionCurveEaseOutkMBMLViewAnimationOptionCurveLinear(“curveLinear”) →UIViewAnimationOptionCurveLinearkMBMLViewAnimationOptionTransitionNone(“transitionNone”) →UIViewAnimationOptionTransitionNonekMBMLViewAnimationOptionTransitionFlipFromLeft(“transitionFlipFromLeft”) →UIViewAnimationOptionTransitionFlipFromLeftkMBMLViewAnimationOptionTransitionFlipFromRight(“transitionFlipFromRight”) →UIViewAnimationOptionTransitionFlipFromRightkMBMLViewAnimationOptionTransitionCurlUp(“transitionCurlUp”) →UIViewAnimationOptionTransitionCurlUpkMBMLViewAnimationOptionTransitionCurlDown(“transitionCurlDown”) →UIViewAnimationOptionTransitionCurlDownkMBMLViewAnimationOptionTransitionCrossDissolve(“transitionCrossDissolve”) →UIViewAnimationOptionTransitionCrossDissolvekMBMLViewAnimationOptionTransitionFlipFromTop(“transitionFlipFromTop”) →UIViewAnimationOptionTransitionFlipFromTopkMBMLViewAnimationOptionTransitionFlipFromBottom(“transitionFlipFromBottom”) →UIViewAnimationOptionTransitionFlipFromBottom
Declared In
MBStringConversions.h
+ viewAnimationOptionsFromString:error:
Attempts to interpret a string as a UIViewAnimationOptions value.
+ (UIViewAnimationOptions)viewAnimationOptionsFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIViewAnimationOptions value that corresponds with str.
Returns 0 if str isn’t recognized.
Discussion
UIViewAnimationOptions is constructed as a bit flag, which means each
individual value can be combined to indicate the selection of multiple options.
The input string expects a comma-separated list containing zero or more flags. Whitespace between commas and flags is permitted but not required.
The following string constants show the accepted flags, along with their corresponding values:
kMBMLViewAnimationOptionLayoutSubviews(“layoutSubviews”) →UIViewAnimationOptionLayoutSubviewskMBMLViewAnimationOptionAllowUserInteraction(“allowUserInteraction”) →UIViewAnimationOptionAllowUserInteractionkMBMLViewAnimationOptionBeginFromCurrentState(“beginFromCurrentState”) →UIViewAnimationOptionBeginFromCurrentStatekMBMLViewAnimationOptionRepeat(“repeat”) →UIViewAnimationOptionRepeatkMBMLViewAnimationOptionAutoreverse(“autoreverse”) →UIViewAnimationOptionAutoreversekMBMLViewAnimationOptionOverrideInheritedDuration(“overrideInheritedDuration”) →UIViewAnimationOptionOverrideInheritedDurationkMBMLViewAnimationOptionOverrideInheritedCurve(“overrideInheritedCurve”) →UIViewAnimationOptionOverrideInheritedCurvekMBMLViewAnimationOptionAllowAnimatedContent(“allowAnimatedContent”) →UIViewAnimationOptionAllowAnimatedContentkMBMLViewAnimationOptionShowHideTransitionViews(“showHideTransitionViews”) →UIViewAnimationOptionShowHideTransitionViewskMBMLViewAnimationOptionCurveEaseInOut(“curveEaseInOut”) →UIViewAnimationOptionCurveEaseInOutkMBMLViewAnimationOptionCurveEaseIn(“curveEaseIn”) →UIViewAnimationOptionCurveEaseInkMBMLViewAnimationOptionCurveEaseOut(“curveEaseOut”) →UIViewAnimationOptionCurveEaseOutkMBMLViewAnimationOptionCurveLinear(“curveLinear”) →UIViewAnimationOptionCurveLinearkMBMLViewAnimationOptionTransitionNone(“transitionNone”) →UIViewAnimationOptionTransitionNonekMBMLViewAnimationOptionTransitionFlipFromLeft(“transitionFlipFromLeft”) →UIViewAnimationOptionTransitionFlipFromLeftkMBMLViewAnimationOptionTransitionFlipFromRight(“transitionFlipFromRight”) →UIViewAnimationOptionTransitionFlipFromRightkMBMLViewAnimationOptionTransitionCurlUp(“transitionCurlUp”) →UIViewAnimationOptionTransitionCurlUpkMBMLViewAnimationOptionTransitionCurlDown(“transitionCurlDown”) →UIViewAnimationOptionTransitionCurlDownkMBMLViewAnimationOptionTransitionCrossDissolve(“transitionCrossDissolve”) →UIViewAnimationOptionTransitionCrossDissolvekMBMLViewAnimationOptionTransitionFlipFromTop(“transitionFlipFromTop”) →UIViewAnimationOptionTransitionFlipFromTopkMBMLViewAnimationOptionTransitionFlipFromBottom(“transitionFlipFromBottom”) →UIViewAnimationOptionTransitionFlipFromBottom
Declared In
MBStringConversions.h
+ viewAnimationOptionsFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIViewAnimationOptions value using the viewAnimationOptionsFromString:
method.
+ (UIViewAnimationOptions)viewAnimationOptionsFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIViewAnimationOptions value that corresponds with the
result of evaluating expr as a string. Returns
0 and logs an error to the console if the expression result
couldn’t be interpreted.
Declared In
MBStringConversions.h
UIModalTransitionStyle conversions
+ modalTransitionStyleFromString:
Attempts to interpret a string as a UIModalTransitionStyle value.
+ (UIModalTransitionStyle)modalTransitionStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIModalTransitionStyle value that corresponds with str.
Returns UIModalTransitionStyleCoverVertical and logs an error to
the console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLModalTransitionStyleCoverVertical(“coverVertical”) →UIModalTransitionStyleCoverVerticalkMBMLModalTransitionStyleFlipHorizontal(“flipHorizontal”) →UIModalTransitionStyleFlipHorizontalkMBMLModalTransitionStyleCrossDissolve(“crossDissolve”) →UIModalTransitionStyleCrossDissolvekMBMLModalTransitionStylePartialCurl(“partialCurl”) →UIModalTransitionStylePartialCurl
Declared In
MBStringConversions.h
+ modalTransitionStyleFromString:error:
Attempts to interpret a string as a UIModalTransitionStyle value.
+ (UIModalTransitionStyle)modalTransitionStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIModalTransitionStyle value that corresponds with str.
Returns UIModalTransitionStyleCoverVertical if str isn’t
recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLModalTransitionStyleCoverVertical(“coverVertical”) →UIModalTransitionStyleCoverVerticalkMBMLModalTransitionStyleFlipHorizontal(“flipHorizontal”) →UIModalTransitionStyleFlipHorizontalkMBMLModalTransitionStyleCrossDissolve(“crossDissolve”) →UIModalTransitionStyleCrossDissolvekMBMLModalTransitionStylePartialCurl(“partialCurl”) →UIModalTransitionStylePartialCurl
Declared In
MBStringConversions.h
+ modalTransitionStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIModalTransitionStyle value using the modalTransitionStyleFromString:
method.
+ (UIModalTransitionStyle)modalTransitionStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIModalTransitionStyle value that corresponds with the
result of evaluating expr as a string. Returns
UIModalTransitionStyleCoverVertical and logs an error to the
console if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIViewContentMode conversions
+ viewContentModeFromString:
Attempts to interpret a string as a UIViewContentMode value.
+ (UIViewContentMode)viewContentModeFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIViewContentMode value that corresponds with str.
Returns UIViewContentModeScaleToFill and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLViewContentModeScaleToFill(“scaleToFill”) →UIViewContentModeScaleToFillkMBMLViewContentModeScaleAspectFit(“aspectFit”) →UIViewContentModeScaleAspectFitkMBMLViewContentModeScaleAspectFill(“aspectFill”) →UIViewContentModeScaleAspectFillkMBMLViewContentModeRedraw(“redraw”) →UIViewContentModeRedrawkMBMLViewContentModeCenter(“center”) →UIViewContentModeCenterkMBMLViewContentModeTop(“top”) →UIViewContentModeTopkMBMLViewContentModeBottom(“bottom”) →UIViewContentModeBottomkMBMLViewContentModeLeft(“left”) →UIViewContentModeLeftkMBMLViewContentModeRight(“right”) →UIViewContentModeRightkMBMLViewContentModeTopLeft(“topLeft”) →UIViewContentModeTopLeftkMBMLViewContentModeTopRight(“topRight”) →UIViewContentModeTopRightkMBMLViewContentModeBottomLeft(“bottomLeft”) →UIViewContentModeBottomLeftkMBMLViewContentModeBottomRight(“bottomRight”) →UIViewContentModeBottomRight
Declared In
MBStringConversions.h
+ viewContentModeFromString:error:
Attempts to interpret a string as a UIViewContentMode value.
+ (UIViewContentMode)viewContentModeFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIViewContentMode value that corresponds with str.
Returns UIViewContentModeScaleToFill if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLViewContentModeScaleToFill(“scaleToFill”) →UIViewContentModeScaleToFillkMBMLViewContentModeScaleAspectFit(“aspectFit”) →UIViewContentModeScaleAspectFitkMBMLViewContentModeScaleAspectFill(“aspectFill”) →UIViewContentModeScaleAspectFillkMBMLViewContentModeRedraw(“redraw”) →UIViewContentModeRedrawkMBMLViewContentModeCenter(“center”) →UIViewContentModeCenterkMBMLViewContentModeTop(“top”) →UIViewContentModeTopkMBMLViewContentModeBottom(“bottom”) →UIViewContentModeBottomkMBMLViewContentModeLeft(“left”) →UIViewContentModeLeftkMBMLViewContentModeRight(“right”) →UIViewContentModeRightkMBMLViewContentModeTopLeft(“topLeft”) →UIViewContentModeTopLeftkMBMLViewContentModeTopRight(“topRight”) →UIViewContentModeTopRightkMBMLViewContentModeBottomLeft(“bottomLeft”) →UIViewContentModeBottomLeftkMBMLViewContentModeBottomRight(“bottomRight”) →UIViewContentModeBottomRight
Declared In
MBStringConversions.h
+ viewContentModeFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIViewContentMode value using the viewContentModeFromString:
method.
+ (UIViewContentMode)viewContentModeFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIViewContentMode value that corresponds with the
result of evaluating expr as a string. Returns
UIViewContentModeScaleToFill and logs an error to the console
if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIBarStyle conversions
+ barStyleFromString:
Attempts to interpret a string as a UIBarStyle value.
+ (UIBarStyle)barStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIBarStyle value that corresponds with str.
Returns UIBarStyleDefault and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLBarStyleDefault(“default”) →UIBarStyleDefaultkMBMLBarStyleBlack(“black”) →UIBarStyleBlackkMBMLBarStyleBlackOpaque(“blackOpaque”) →UIBarStyleBlackOpaquekMBMLBarStyleBlackTranslucent(“blackTranslucent”) →UIBarStyleBlackTranslucent
Declared In
MBStringConversions.h
+ barStyleFromString:error:
Attempts to interpret a string as a UIBarStyle value.
+ (UIBarStyle)barStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIBarStyle value that corresponds with str.
Returns UIBarStyleDefault if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLBarStyleDefault(“default”) →UIBarStyleDefaultkMBMLBarStyleBlack(“black”) →UIBarStyleBlackkMBMLBarStyleBlackOpaque(“blackOpaque”) →UIBarStyleBlackOpaquekMBMLBarStyleBlackTranslucent(“blackTranslucent”) →UIBarStyleBlackTranslucent
Declared In
MBStringConversions.h
+ barStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIBarStyle value using the barStyleFromString:
method.
+ (UIBarStyle)barStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIBarStyle value that corresponds with the
result of evaluating expr as a string. Returns
UIBarStyleDefault and logs an error to the console
if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIBarButtonSystemItem conversions
+ barButtonSystemItemFromString:
Attempts to interpret a string as a UIBarButtonSystemItem value.
+ (UIBarButtonSystemItem)barButtonSystemItemFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIBarButtonSystemItem value that corresponds with str.
Returns UIBarButtonSystemItemDone and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLBarButtonSystemItemDone(“done”) →UIBarButtonSystemItemDonekMBMLBarButtonSystemItemCancel(“cancel”) →UIBarButtonSystemItemCancelkMBMLBarButtonSystemItemEdit(“edit”) →UIBarButtonSystemItemEditkMBMLBarButtonSystemItemSave(“save”) →UIBarButtonSystemItemSavekMBMLBarButtonSystemItemAdd(“add”) →UIBarButtonSystemItemAddkMBMLBarButtonSystemItemFlexibleSpace(“flexibleSpace”) →UIBarButtonSystemItemFlexibleSpacekMBMLBarButtonSystemItemFixedSpace(“fixedSpace”) →UIBarButtonSystemItemFixedSpacekMBMLBarButtonSystemItemCompose(“compose”) →UIBarButtonSystemItemComposekMBMLBarButtonSystemItemReply(“reply”) →UIBarButtonSystemItemReplykMBMLBarButtonSystemItemAction(“action”) →UIBarButtonSystemItemActionkMBMLBarButtonSystemItemOrganize(“organize”) →UIBarButtonSystemItemOrganizekMBMLBarButtonSystemItemBookmarks(“bookmarks”) →UIBarButtonSystemItemBookmarkskMBMLBarButtonSystemItemSearch(“search”) →UIBarButtonSystemItemSearchkMBMLBarButtonSystemItemRefresh(“refresh”) →UIBarButtonSystemItemRefreshkMBMLBarButtonSystemItemStop(“stop”) →UIBarButtonSystemItemStopkMBMLBarButtonSystemItemCamera(“camera”) →UIBarButtonSystemItemCamerakMBMLBarButtonSystemItemTrash(“trash”) →UIBarButtonSystemItemTrashkMBMLBarButtonSystemItemPlay(“play”) →UIBarButtonSystemItemPlaykMBMLBarButtonSystemItemPause(“pause”) →UIBarButtonSystemItemPausekMBMLBarButtonSystemItemRewind(“rewind”) →UIBarButtonSystemItemRewindkMBMLBarButtonSystemItemFastForward(“fastForward”) →UIBarButtonSystemItemFastForwardkMBMLBarButtonSystemItemUndo(“undo”) →UIBarButtonSystemItemUndokMBMLBarButtonSystemItemRedo(“redo”) →UIBarButtonSystemItemRedokMBMLBarButtonSystemItemPageCurl(“pageCurl”) →UIBarButtonSystemItemPageCurl
Declared In
MBStringConversions.h
+ barButtonSystemItemFromString:error:
Attempts to interpret a string as a UIBarButtonSystemItem value.
+ (UIBarButtonSystemItem)barButtonSystemItemFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIBarButtonSystemItem value that corresponds with str.
Returns UIBarButtonSystemItemDone if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLBarButtonSystemItemDone(“done”) →UIBarButtonSystemItemDonekMBMLBarButtonSystemItemCancel(“cancel”) →UIBarButtonSystemItemCancelkMBMLBarButtonSystemItemEdit(“edit”) →UIBarButtonSystemItemEditkMBMLBarButtonSystemItemSave(“save”) →UIBarButtonSystemItemSavekMBMLBarButtonSystemItemAdd(“add”) →UIBarButtonSystemItemAddkMBMLBarButtonSystemItemFlexibleSpace(“flexibleSpace”) →UIBarButtonSystemItemFlexibleSpacekMBMLBarButtonSystemItemFixedSpace(“fixedSpace”) →UIBarButtonSystemItemFixedSpacekMBMLBarButtonSystemItemCompose(“compose”) →UIBarButtonSystemItemComposekMBMLBarButtonSystemItemReply(“reply”) →UIBarButtonSystemItemReplykMBMLBarButtonSystemItemAction(“action”) →UIBarButtonSystemItemActionkMBMLBarButtonSystemItemOrganize(“organize”) →UIBarButtonSystemItemOrganizekMBMLBarButtonSystemItemBookmarks(“bookmarks”) →UIBarButtonSystemItemBookmarkskMBMLBarButtonSystemItemSearch(“search”) →UIBarButtonSystemItemSearchkMBMLBarButtonSystemItemRefresh(“refresh”) →UIBarButtonSystemItemRefreshkMBMLBarButtonSystemItemStop(“stop”) →UIBarButtonSystemItemStopkMBMLBarButtonSystemItemCamera(“camera”) →UIBarButtonSystemItemCamerakMBMLBarButtonSystemItemTrash(“trash”) →UIBarButtonSystemItemTrashkMBMLBarButtonSystemItemPlay(“play”) →UIBarButtonSystemItemPlaykMBMLBarButtonSystemItemPause(“pause”) →UIBarButtonSystemItemPausekMBMLBarButtonSystemItemRewind(“rewind”) →UIBarButtonSystemItemRewindkMBMLBarButtonSystemItemFastForward(“fastForward”) →UIBarButtonSystemItemFastForwardkMBMLBarButtonSystemItemUndo(“undo”) →UIBarButtonSystemItemUndokMBMLBarButtonSystemItemRedo(“redo”) →UIBarButtonSystemItemRedokMBMLBarButtonSystemItemPageCurl(“pageCurl”) →UIBarButtonSystemItemPageCurl
Declared In
MBStringConversions.h
+ barButtonSystemItemFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIBarButtonSystemItem value using the barButtonSystemItemFromString:
method.
+ (UIBarButtonSystemItem)barButtonSystemItemFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIBarButtonSystemItem value that corresponds with the
result of evaluating expr as a string. Returns
UIBarButtonSystemItemDone and logs an error to the console
if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIBarButtonItemStyle conversions
+ barButtonItemStyleFromString:
Attempts to interpret a string as a UIBarButtonItemStyle value.
+ (UIBarButtonItemStyle)barButtonItemStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIBarButtonItemStyle value that corresponds with str.
Returns UIBarButtonItemStylePlain and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLBarButtonItemStylePlain(“plain”) →UIBarButtonItemStylePlain- Deprecated:
kMBMLBarButtonItemStyleBordered(“bordered”) →UIBarButtonItemStyleBordered kMBMLBarButtonItemStyleDone(“done”) →UIBarButtonItemStyleDone
Declared In
MBStringConversions.h
+ barButtonItemStyleFromString:error:
Attempts to interpret a string as a UIBarButtonItemStyle value.
+ (UIBarButtonItemStyle)barButtonItemStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIBarButtonItemStyle value that corresponds with str.
Returns UIBarButtonItemStylePlain if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLBarButtonItemStylePlain(“plain”) →UIBarButtonItemStylePlain- Deprecated:
kMBMLBarButtonItemStyleBordered(“bordered”) →UIBarButtonItemStyleBordered kMBMLBarButtonItemStyleDone(“done”) →UIBarButtonItemStyleDone
Declared In
MBStringConversions.h
+ barButtonItemStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIBarButtonItemStyle value using the barButtonItemStyleFromString:
method.
+ (UIBarButtonItemStyle)barButtonItemStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIBarButtonItemStyle value that corresponds with the
result of evaluating expr as a string. Returns
UIBarButtonItemStylePlain and logs an error to the console
if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIStatusBarStyle conversions
+ statusBarStyleFromString:
Attempts to interpret a string as a UIStatusBarStyle value.
+ (UIStatusBarStyle)statusBarStyleFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIStatusBarStyle value that corresponds with str.
Returns UIStatusBarStyleDefault and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLStatusBarStyleDarkText(“darkText”) →UIStatusBarStyleDefaultkMBMLStatusBarStyleLightText(“lightText”) →UIStatusBarStyleLightContent
Declared In
MBStringConversions.h
+ statusBarStyleFromString:error:
Attempts to interpret a string as a UIStatusBarStyle value.
+ (UIStatusBarStyle)statusBarStyleFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIStatusBarStyle value that corresponds with str.
Returns UIStatusBarStyleDefault if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLStatusBarStyleDarkText(“darkText”) →UIStatusBarStyleDefaultkMBMLStatusBarStyleLightText(“lightText”) →UIStatusBarStyleLightContent
Declared In
MBStringConversions.h
+ statusBarStyleFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIStatusBarStyle value using the statusBarStyleFromString:
method.
+ (UIStatusBarStyle)statusBarStyleFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIStatusBarStyle value that corresponds with the
result of evaluating expr as a string. Returns
UIStatusBarStyleDefault and logs an error to the console
if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIStatusBarAnimation conversions
+ statusBarAnimationFromString:
Attempts to interpret a string as a UIStatusBarAnimation value.
+ (UIStatusBarAnimation)statusBarAnimationFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIStatusBarAnimation value that corresponds with str.
Returns UIStatusBarAnimationNone and logs an error to the
console if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLStatusBarAnimationNone(“none”) →UIStatusBarAnimationNonekMBMLStatusBarAnimationFade(“fade”) →UIStatusBarAnimationFadekMBMLStatusBarAnimationSlide(“slide”) →UIStatusBarAnimationSlide
Declared In
MBStringConversions.h
+ statusBarAnimationFromString:error:
Attempts to interpret a string as a UIStatusBarAnimation value.
+ (UIStatusBarAnimation)statusBarAnimationFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIStatusBarAnimation value that corresponds with str.
Returns UIStatusBarAnimationNone if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLStatusBarAnimationNone(“none”) →UIStatusBarAnimationNonekMBMLStatusBarAnimationFade(“fade”) →UIStatusBarAnimationFadekMBMLStatusBarAnimationSlide(“slide”) →UIStatusBarAnimationSlide
Declared In
MBStringConversions.h
+ statusBarAnimationFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIStatusBarAnimation value using the statusBarAnimationFromString:
method.
+ (UIStatusBarAnimation)statusBarAnimationFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIStatusBarAnimation value that corresponds with the
result of evaluating expr as a string. Returns
UIStatusBarAnimationNone and logs an error to the console
if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h
UIPopoverArrowDirection conversions
+ popoverArrowDirectionFromString:
Attempts to interpret a string as a UIPopoverArrowDirection value.
+ (UIPopoverArrowDirection)popoverArrowDirectionFromString:(nonnull NSString *)strParameters
str |
The string to interpret. |
|---|
Return Value
The UIPopoverArrowDirection value that corresponds with str.
Returns UIPopoverArrowDirectionAny logs an error to the console
if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLPopoverArrowDirectionUp(“up”) →UIPopoverArrowDirectionUpkMBMLPopoverArrowDirectionDown(“down”) →UIPopoverArrowDirectionDownkMBMLPopoverArrowDirectionLeft(“left”) →UIPopoverArrowDirectionLeftkMBMLPopoverArrowDirectionRight(“right”) →UIPopoverArrowDirectionRightkMBMLPopoverArrowDirectionAny(“any”) →UIPopoverArrowDirectionAny
Declared In
MBStringConversions.h
+ popoverArrowDirectionFromString:error:
Attempts to interpret a string as a UIPopoverArrowDirection value.
+ (UIPopoverArrowDirection)popoverArrowDirectionFromString:(nonnull NSString *)str error:(NSErrorPtrPtr)errPtrParameters
str |
The string to interpret. |
|---|---|
errPtr |
An optional pointer to a memory location for storing an
|
Return Value
The UIPopoverArrowDirection value that corresponds with str.
Returns UIPopoverArrowDirectionAny if str isn’t recognized.
Discussion
The following string constants show the accepted inputs, along with their corresponding values:
kMBMLPopoverArrowDirectionUp(“up”) →UIPopoverArrowDirectionUpkMBMLPopoverArrowDirectionDown(“down”) →UIPopoverArrowDirectionDownkMBMLPopoverArrowDirectionLeft(“left”) →UIPopoverArrowDirectionLeftkMBMLPopoverArrowDirectionRight(“right”) →UIPopoverArrowDirectionRightkMBMLPopoverArrowDirectionAny(“any”) →UIPopoverArrowDirectionAny
Declared In
MBStringConversions.h
+ popoverArrowDirectionFromExpression:
Evaluates a string expression and attempts to interpret the result as a
UIPopoverArrowDirection value using the popoverArrowDirectionFromString:
method.
+ (UIPopoverArrowDirection)popoverArrowDirectionFromExpression:(nonnull NSString *)exprParameters
expr |
The expression whose result will be interpreted. |
|---|
Return Value
The UIPopoverArrowDirection value that corresponds with the
result of evaluating expr as a string. Returns
UIPopoverArrowDirectionAny and logs an error to the console
if the expression result couldn’t be interpreted.
Declared In
MBStringConversions.h