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)) 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo