Files
MapLibreParticleLab/platform/darwin/src/NSString+MGLAdditions.h
Jason Wray c067865e7b [ios, macos] Update minimum deployment versions to iOS 9, macOS 10.11 (#11776)
* [ios] Remove iOS 8 conditionals

* [ios, macos] Bump pod deployment targets

* [ios, macos] Add changelog entries

* [ios, macos] Update docs

* Remove unnecessary selector-based version checks

* Update SQLite note

* [ios, macos] Replace lightweight generics macros with direct use
   Lightweight generics for Foundation collections are available everywhere with the bump to iOS 9 and macOS 10.11.

* Update deprecated macOS method
2018-04-27 12:25:49 -04:00

47 lines
1.3 KiB
Objective-C

#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSString (MGLAdditions)
/** Returns the range spanning the entire receiver. */
- (NSRange)mgl_wholeRange;
/** Returns the receiver if non-empty or nil if empty. */
- (nullable NSString *)mgl_stringOrNilIfEmpty;
/**
Returns a title-cased representation of the receiver using the specified
locale.
@param locale The locale. For strings presented to users, pass in the current
locale (`+[NSLocale currentLocale]`). To use the system locale, pass in
`nil`.
*/
- (NSString *)mgl_titleCasedStringWithLocale:(NSLocale *)locale;
/**
Returns a transliterated representation of the receiver using the specified
script. If transliteration fails, the receiver will be returned.
Only supports scripts for languages used by Mapbox Streets.
@param script The four-letter code representing the name of the script, as
specified by ISO 15924.
*/
- (NSString *)mgl_stringByTransliteratingIntoScript:(NSString *)script;
@end
@interface NSAttributedString (MGLAdditions)
/** Returns the range spanning the entire receiver. */
- (NSRange)mgl_wholeRange;
/** Returns a copy of the receiver with leading and trailing members of the given set removed. */
- (NSAttributedString *)mgl_attributedStringByTrimmingCharactersInSet:(NSCharacterSet *)set;
@end
NS_ASSUME_NONNULL_END