ios - Swift 2.2 Selector with multiple arguments - actually passing in -
i want use selector, need pass in arguments understand syntax follows:
#selector(class.method(_:paramname:))
but need pass in parameters. how do this?
here's attempt:
exploretap = uitapgesturerecognizer(target: self, action: #selector(mainviewcontroller.showviewwithidentifier(_:exploreview,id:"explore")))
you cannot pass parameters selectors, selector method name, nothing else. not calling method cannot pass parameters. call necessary code inside tap handler.
func ontap() { mainviewcontroller.showviewwithidentifier(exploreview, id:"explore") }
and then
uitapgesturerecognizer(target: self, action: #selector(ontap))