I have a quick method that gets the structure as a parameter. Since the structures are not bound to objective-c, this method is invisible in the bridge header.
I was forced to create a new "identical" method that gets " AnyObject" instead of the structure required by the original method.
Now I am tasked with creating quick structures from " AnyObject". Is it possible to "insert" " AnyObject" into the quick structure in this case?
Am I forced to write a boiler plate to build a quick structure out of AnyObject?
I can send NSDictionaryrepresenting key-value pairs of structs. Does it help anyway?
For instance:
Swift
struct Properties {
var color = UIColor.redColor()
var text = "Some text"
}
class SomeClass : UIViewController {
func configure(options : Properties) {
}
func wrapObjC_Configure(options : AnyObject) {
var convertedStruct = (options as Properties)
self.configure(convertedStruct)
}
}
Objective-c
SomeClass *obj = [SomeClass new]
[obj wrapObjC_Configure:@{@"color" : [UIColor redColor],@"text" : @"Some text"}]