0

Im making a protocol but I only want it to be implementable by View Controllers. Im doing this to keep the code consistent and to try and avoid confusion for someone new to the project.

I was also wondering if by making a protocol only extendable by a UIViewController would I be able to access the UIViewControllers variables?

Ayrton CB
  • 454
  • 2
  • 9

1 Answers1

3
protocol P where Self: UIViewControlller {

}
Alexander
  • 59,041
  • 12
  • 98
  • 151