After going through the upgrade to Swift3, the upgrade helper changed
private var myArray = [(String, NSDate, Float)]() //Swift 2.2
to
fileprivate var myArray = [(String, Foundation.Date, Float)] //Swift 3
The new code gives an error Expected member name or constructor call after type name
.
Does anyone understand the reason for the error or what the correct syntax approach should be? The proposed solutions from the compiler are to Add arguments after the type to construct a value of the type
or Use .self to reference the type object
. These don't fix the problem.
You simply need to initialize the array by adding the ()
at the end.
fileprivate var myArray = [(String, Date, Float)]()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With