How to call an Objective C method in Swift that requires a runtime class as a parameter -
How to call an Objective C method in Swift that requires a runtime class as a parameter -
i started programming in swift 2 weeks , still have objective c classes utilize in app. 1 illustration calling method swift:
+ (void)transitionfromthisvcclass:(class<someprotocol>)afromvcclass tothisclassvcclass:(class<someprotocol>)atovcclass withnavigationcontroller:(uinavigationcontroller *)anav withduration:(nstimeinterval)aduration
my problem can't find way pass in class type have done in objective c [someclass class]. help much appreciated. thanks
update
if i'm trying utilize myclass.self so:
asfsharedviewtransition.addtransitionwithfromviewcontrollerclass( recommendationlistviewcontroller.self, toviewcontrollerclass: recommendationviewcontroller.self, withnavigationcontroller: self.window?.rootviewcontroller, withduration: 0.3)
asfsharedviewtransition objective c class i'm trying phone call swift
i error:
cannot convert expression's type '(recommendationlistviewcontroller.type, toviewcontrollerclass: recommendationviewcontroller.type, withnavigationcontroller: $t5??, withduration: floatliteralconvertible)' type 'floatliteralconvertible'
you can utilize foo.self
, foo
class name. example, myclass.self
objective-c swift objective-c-runtime
Comments
Post a Comment