RBLocaleCenter Class Reference
Inherits from | NSObject |
---|---|
Declared in | RBLocaleCenter.h |
Overview
Provides locality-specific serialisations and conversions - e.g. dates, numbers, currencies, etc.
+ main
The main locale center.
+ (nonnull RBLocaleCenter *)main
Discussion
The main locale center.
Declared In
RBLocaleCenter.h
defaultNumberStyle
The default number formatting style.
@property (nonatomic) NSNumberFormatterStyle defaultNumberStyle
Discussion
The default number formatting style.
Declared In
RBLocaleCenter.h
defaultDateStyle
The default date formatting style.
@property (nonatomic) NSDateFormatterStyle defaultDateStyle
Discussion
The default date formatting style.
Declared In
RBLocaleCenter.h
defaultTimeStyle
The default time formatting style.
@property (nonatomic) NSDateFormatterStyle defaultTimeStyle
Discussion
The default time formatting style.
Declared In
RBLocaleCenter.h
– numberFromString:
Parses a string to retrieve a number.
- (nullable NSNumber *)numberFromString:(nonnull NSString *)numberString
Parameters
numberString |
The string that contains a number. |
---|
Return Value
The resulting NSNumber
object or nil
.
Discussion
Parses a string to retrieve a number.
Declared In
RBLocaleCenter.h
– numberFromString:usingStyle:
Parses a string to retrieve a number.
- (nullable NSNumber *)numberFromString:(nonnull NSString *)numberString usingStyle:(NSNumberFormatterStyle)numberStyle
Parameters
numberString |
The string that contains a number. |
---|---|
numberStyle |
The formatting style to expect in the string. |
Return Value
The resulting NSNumber
object or nil
.
Discussion
Parses a string to retrieve a number.
Declared In
RBLocaleCenter.h
– stringFromNumber:
Formats a number to a string.
- (nonnull NSString *)stringFromNumber:(nonnull NSNumber *)number
Parameters
number |
The number to format. |
---|
Return Value
The resulting formatted string.
Discussion
Formats a number to a string.
Declared In
RBLocaleCenter.h
– stringFromNumber:usingStyle:
Formats a number to a string.
- (nonnull NSString *)stringFromNumber:(nonnull NSNumber *)number usingStyle:(NSNumberFormatterStyle)numberStyle
Parameters
number |
The number to format. |
---|---|
numberStyle |
The formatting style to use. |
Return Value
The resulting formatted string.
Discussion
Formats a number to a string.
Declared In
RBLocaleCenter.h
– dateFromString:universalTime:
Parses a date from a string.
- (nonnull NSDate *)dateFromString:(nonnull NSString *)dateString universalTime:(BOOL)universalTime
Parameters
dateString |
The string to parse. |
---|---|
universalTime |
Whether the date is UTC. |
Return Value
The parsed NSDate
object.
Discussion
Parses a date from a string.
Declared In
RBLocaleCenter.h
– dateFromString:usingDateStyle:timeStyle:universalTime:
Parses a date from a string.
- (nullable NSDate *)dateFromString:(nonnull NSString *)dateString usingDateStyle:(NSDateFormatterStyle)dateStyle timeStyle:(NSDateFormatterStyle)timeStyle universalTime:(BOOL)universalTime
Parameters
dateString |
The string to parse. |
---|---|
dateStyle |
The formatting style to expect for the date component of the string. |
timeStyle |
The formatting style to expect for the time component of the string. |
universalTime |
Whether the date is UTC. |
Return Value
The parsed NSDate
object.
Discussion
Parses a date from a string.
Declared In
RBLocaleCenter.h
– stringFromDate:universalTime:
Formats an NSDate
into a string.
- (nonnull NSString *)stringFromDate:(nonnull NSDate *)date universalTime:(BOOL)universalTime
Parameters
date |
The |
---|---|
universalTime |
Whether the date is UTC. |
Return Value
The formatted string value.
Discussion
Formats an NSDate
into a string.
Declared In
RBLocaleCenter.h
– stringFromDate:usingDateStyle:timeStyle:universalTime:
Formats an NSDate
into a string.
- (nonnull NSString *)stringFromDate:(nonnull NSDate *)date usingDateStyle:(NSDateFormatterStyle)dateStyle timeStyle:(NSDateFormatterStyle)timeStyle universalTime:(BOOL)universalTime
Parameters
date |
The |
---|---|
dateStyle |
The formatting style to use for the date component. |
timeStyle |
The formatting style to use for the time component. |
universalTime |
Whether the date is UTC. |
Return Value
The formatted string value.
Discussion
Formats an NSDate
into a string.
Declared In
RBLocaleCenter.h