public protocol UploadDelegate: AnyObject {}
class NetworkManager: UploadDelegate {}
class A {
B().abc(uploadDelegate:NetworkManager() )
}
class B {
func abc (uploadDelegate: UploadDelegate) {
C().efg(uploadDelegate:uploadDelegate )
}
}
class C {
func efg (uploadDelegate: UploadDelegate) {
D().hij(uploadDelegate:uploadDelegate )
}
}
class D {
func hij (uploadDelegate: UploadDelegate) {
uploadDelegate.func()
}
}
Can we pass the protocol/delegate as a func parameter? If yes, I believe its a weak property.