Open RustamG opened 3 years ago
Hi @RustamG - You need to wrap the MGLIconAnchor enum value in an NSValue. e.g.
layer.iconAnchor = NSExpression(forConstantValue: NSValue(mglIconAnchor: .bottom))
The crash occurs because the value being sent to that expression is the wrong type so it isn't interpreted correctly at runtime.
Thanks @avi-c
The app crashes if I set
MGLSymbolStyleLayer.iconAnchor
property.Steps to reproduce
I can reproduce the issue using Multiple Images example with just adding the following line:
So the full code is:
Expected behavior
The app doesn't crash and iconAnchor is applied
Actual behavior
App crashes with error:
Stack trace:
Configuration
Mapbox SDK versions: 5.9.0, 6.3.0 iOS/macOS versions: iOS 13.7, iOS 14. Device/simulator models: iPad 7th gen, also crashes on iPad Air 4 Simulator Xcode version: 12