Files
MapLibreParticleLab/platform/ios/NSString+MGLAdditions.m
Minh Nguyễn 6a1e7d5707 Fixed race condition after setting access token
`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
2015-04-03 12:07:53 -07:00

11 lines
160 B
Objective-C

#import "NSString+MGLAdditions.h"
@implementation NSString (MGLAdditions)
- (NSString *)mgl_stringOrNilIfEmpty
{
return self.length ? self : nil;
}
@end