There are a couple of ways to achieve this. Passing data between classes or more specifically between two view controllers is the most common problem faced by many developers when they start out.
The easiest way to achieve this is to have a reference to the second class from the first class, that way you can access all of the publicly available methods and properties.
The other way is to save it to a text file or UserDefaults and retrieve it. However, look at the lifecycle of the ViewControllers to ensure that you have saved the data before the next view controller retrieves the data.
Another way is to have a common Object, like the UserDefaults, a kind of a Clipboard/Object that can hold arbitrary data and ensure that this object is available on some global object/scope so you can access it easily.
If you google the term “pass data between two view controllers iOS” you should get plenty of resources. Hence I am not posting any code here to avoid duplicating that.