Search code examples
iosswiftsegue

Transferring an array to an array in another view (Segue)


When i want to send data to other view i get this error :

Value of type 'SecondViewController' has no member 'passingData'

But it has !

image

image2

SecondViewController :

import UIKit
var passingData : [String] = []
class SecondViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    

}

Solution

  • import UIKit
    
    class SecondViewController: UIViewController {
        var passingData : [String] = []
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
            // Do any additional setup after loading the view.
        }
    }