[英]Instance Methods in Obj-C to Swift
friends, I have 2 Instance Methods in Obj-C and I need to convert it in Swift: 朋友,我在Obj-C中有2个实例方法,我需要在Swift中将其转换:
- (NSArray<GLMapVectorObject*> *_Nullable)createVectorObjectsFromGeoJSON:(NSString *)geoJSON
and converted in Swift as let tmpObj = mapView?.createVectorObjectsFromGeoJSON("{\\"type\\":\\"Point\\",\\"coordinates\\": [25.29131, 53.88995]}")!
并在Swift中转换为
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: -从字符串创建GLMapVectorObject数组-效果很好,但是我不知道如何转换该方法-创建样式对象:
- (GLMapVectorStyle *_Nullable)createStyle:(NSString *)style
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. 您看到的错误消息的一种可能原因是Swift不能通过桥接标头看到
GLMapVectorStyle
类的接口声明。 I'm also assuming that the createStyle
method is available to Swift through the bridging header. 我还假设
createStyle
方法可通过桥接头供Swift使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.