Have you tried to simply pass the value when you push or present the VC2 view controller?
For example in you VC2 declare a variable like this:
class VC2: UIViewController {
...
var numberOfObjects: Int = 0
...
}
Then in you VC1, when you present or push the VC2 you should pass the value:
let vc2 = <get your VC2 instance here>
vc2.numberOfObjects = <your value here>
<present or push your vc2 here>
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: