Vadim Nikolaev Vadim Nikolaev - 6 months ago 31
Swift Question

Instance Methods in Obj-C to Swift

friends, I have 2 Instance Methods in Obj-C and I need to convert it in Swift:

- (NSArray<GLMapVectorObject*> *_Nullable)createVectorObjectsFromGeoJSON:(NSString *)geoJSON


and converted in Swift as
let tmpObj = mapView?.createVectorObjectsFromGeoJSON("{\"type\":\"Point\",\"coordinates\": [25.29131, 53.88995]}")!
- Create an array of GLMapVectorObject from string - and it's working good, but I don't know how to convert that method - creates style object:

- (GLMapVectorStyle *_Nullable)createStyle:(NSString *)style

Answer

One possible reason for the error message you are seeing is that the interface declaration of class GLMapVectorStyle is not visible to Swift via the bridging header. I'm also assuming that the createStyle method is available to Swift through the bridging header.

Comments