A project (Xcode 9) demonstrating delegates/delegation in iOS with Swift 4. I use delegation to get notified and do whatever I want when a file has finished downloading.
http://iosbrain.com/blog/2018/02/05/tutorial-delegates-and-delegation-in-swift-4