protocol, UIViewController, . , , .
protocol UIViewControllerInteractions {
var title: String? { get set }
}
.
protocol MyProtocol: UIViewControllerInteractions { }
, UIViewControllerInteractions MyProtocol.
protocol MyProtocolViewController: UIViewControllerInteractions, MyProtocol { }
, SubclassUIViewController, myData, UIViewControllerInteractions UIViewController ( )
class SubclassUIViewController: MyProtocol {
var myData ...
}
array MyProtocol MyProtocolViewController, , UIViewControllerInteractions, UIViewController.
var viewController: [MyProtocol] = [...]
viewController.forEach { (vc) in
print(vc.myData)
print(vc.title)
}