objective c - Swift: overriding method with selector has incompatible type -
objective c - Swift: overriding method with selector has incompatible type -
i have declared class method in objective-c:
+ (id) somefunction:(nsdictionary *)param; when subclass class , override method in swift this:
override class func somefunction(param : nsdictionary) -> anyobject? i error:
overriding method selector 'somefunction:' has incompatible type '(nsdictionary) -> anyobject?'
how override method correctly?
when seek autocomplete class function somewhere else in swift, xcode tells me param [nsobject: anyobject]!, makes method declaration work:
override class func somefunction(param: [nsobject: anyobject]!) -> anyobject? { homecoming "foo" } this might compiler bug, since i'm pretty sure that's supposed bridge nsdictionary! (it seems bridging 1 way, not other, or something).
objective-c swift
Comments
Post a Comment