zetao123
zetao123

Reputation: 19

IBAction sender type

what is the difference between (UIBarbuttonItem or other) and Any?

Thanks!

Upvotes: 0

Views: 468

Answers (1)

vadian
vadian

Reputation: 285082

The difference is specific vs. unspecific type.

  • Use the specific type if only this particular UI element is supposed to call the method and you need to process properties like title or tag of the passed sender.
  • Use the unspecific type if the method can be called from different places with different sender types or if the sender parameter is not used at all.

Upvotes: 3

Related Questions