Functions
The following functions are available globally.
-
Undocumented
Declaration
Objective-C
FOUNDATION_EXPORT NSError *LCError(NSInteger code, NSString * _Nullable failureReason, NSDictionary * _Nullable userInfo)
Swift
func LCError(_ code: Int, _ failureReason: String?, _ userInfo: [AnyHashable : Any]?) -> Error
-
Undocumented
Declaration
Objective-C
FOUNDATION_EXPORT NSError *LCErrorInconsistency(NSString * _Nullable failureReason)
Swift
func LCErrorInconsistency(_ failureReason: String?) -> Error
-
Undocumented
Declaration
Objective-C
FOUNDATION_EXPORT NSError *LCErrorFromUnderlyingError(NSError *underlyingError)
Swift
func LCErrorFromUnderlyingError(_ underlyingError: Error) -> Error
-
Undocumented
Declaration
Objective-C
FOUNDATION_EXPORT NSError *LCErrorInternalServer(NSString * _Nullable failureReason)
Swift
func LCErrorInternalServer(_ failureReason: String?) -> Error
-
Returns a localized string representation of an
LCNetworkReachabilityStatus
value.Declaration
Objective-C
extern NSString *_Nonnull LCStringFromNetworkReachabilityStatus( LCNetworkReachabilityStatus status)
Swift
func LCStringFromNetworkReachabilityStatus(_ status: LCNetworkReachabilityStatus) -> String
-
Returns a percent-escaped string following RFC 3986 for a query string key or value. RFC 3986 states that the following characters are “reserved” characters.
- General Delimiters: “:”, “#”, “[”, “]”, “@”, “?”, “/”
- Sub-Delimiters: “!”, “$”, “&”, “‘”, “(”, “)”, “*”, “+”, “,”, “;”, “=”
In RFC 3986 - Section 3.4, it states that the “?” and “/” characters should not be escaped to allow query strings to include a URL. Therefore, all “reserved” characters with the exception of “?” and “/” should be percent-escaped in the query string.
Declaration
Objective-C
extern NSString *_Nonnull LCPercentEscapedStringFromString( NSString *_Nonnull string)
Swift
func LCPercentEscapedStringFromString(_ string: String) -> String
Parameters
string
The string to be percent-escaped.
Return Value
The percent-escaped string.
-
A helper method to generate encoded url query parameters for appending to the end of a URL.
Declaration
Objective-C
extern NSString *_Nonnull LCQueryStringFromParameters( NSDictionary *_Nonnull parameters)
Swift
func LCQueryStringFromParameters(_ parameters: [AnyHashable : Any]) -> String
Parameters
parameters
A dictionary of key/values to be encoded.
Return Value
A url encoded query string