[ios, macos] Fixed getting enum functions

Fixes #6161.
This commit is contained in:
Minh Nguyễn
2016-08-26 00:39:28 -07:00
parent 5d06a4370d
commit 72bee845b6

View File

@@ -33,7 +33,15 @@
if (property.isConstant()) { \
return [NSValue value:&property.asConstant() withObjCType:type]; \
} else if (property.isFunction()) { \
return nil; \
MGLStyleAttributeFunction *function = [[MGLStyleAttributeFunction alloc] init]; \
auto stops = property.asFunction().getStops(); \
NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()]; \
for (auto stop : stops) { \
convertedStops[@(stop.first)] = [NSValue value:&stop.second withObjCType:type]; \
} \
function.base = @(property.asFunction().getBase()); \
function.stops = convertedStops; \
return function; \
} else { \
return nil; \
}