Set Block in swift

Declare block in ViewController

 var editShared: ((_ isShared: Bool) -> Void)?

Call block in ViewController

self.editShared!(true)

Implement block when redirect view controller

let VC = ViewController(nibName: "ViewController", bundle: nil)
        VC.editShared = {(isShared) in
            self.callHomeFeedService()
 }
self.navigationController?.pushViewController(VC, animated: true)