I think for the second scenario, i will just have to add a new parameter to the function to pass the instance if there is no other possible way.
Topic:
Programming Languages
SubTopic:
Swift
Tags: