Show multiple autocomplete options from one function with default values

Viewed 30

I have a function that looks like this with some default values:

func showMyView(
  _ view: UIView,
  on viewController: UIViewController? = nil,
  backgroundColor: UIColor = .black,
  textColor: UIColor = .white
)

When someone types in showMyView I want it to autocomplete to show multiple options:

showMyView(_ view:)
showMyView(_:on)
showMyView(_:on:backgroundColor)
showMyView(_:on:backgroundColor:textColor)

It currently only shows:

showMyView(_ view:)
showMyView(_:on:backgroundColor:textColor)

How can I do this? Would I need to specifically define these individual methods and link them back to the main one that takes all params, or can I get swift to generate all of these automatically?

0 Answers
Related