`Map` should be able to deal with having no access token or JSON even while it’s running. Most of `Map` accounts for this situation, but `reloadStyle()` incorrectly assumes that one or the other is set. This change corrects the assumption in `reloadStyle()`. Also expose the access token and style name to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable! Ref #1070, #1147
11 lines
160 B
Objective-C
11 lines
160 B
Objective-C
#import "NSString+MGLAdditions.h"
|
|
|
|
@implementation NSString (MGLAdditions)
|
|
|
|
- (NSString *)mgl_stringOrNilIfEmpty
|
|
{
|
|
return self.length ? self : nil;
|
|
}
|
|
|
|
@end
|