Using concept of protocols and delegate design pattern to execute actions in Swift