1

how I can add restriction of types to var like this

var contentController: <UIViewController, MyProtocol> // wrong
var contentController: UIViewController where Self: MyProtocol // wrong

but it is wrong declarations for swift. For example what I want - true declarations for func

func setContentController<Controller:UIViewController>(_ controller: Controller) where Controller: MyProtocol

its fine work to func, but I do not add restriction for var or typealias

EvGeniy Ilyin
  • 1,817
  • 1
  • 21
  • 38

0 Answers0