Complete the code to declare a variable to hold data to pass.
var message[1] String?In Swift, to declare a variable with a type, use a colon : after the variable name.
Complete the code to override the prepare method for passing data.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showDetail" { let destination = segue.[1] as! DetailViewController } }
The correct property to get the destination view controller from a segue is destination.
Fix the error in passing data to the destination view controller.
destination.message = [1]You assign the variable message directly without self. or parentheses.
Fill both blanks to safely unwrap and pass data in prepare method.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let destination = segue.[1] as? DetailViewController, let data = [2] { destination.message = data } }
Use destination to get the destination safely and unwrap the message variable.
Fill all three blanks to create a dictionary and pass filtered data to destination.
let filteredData = data.filter { $0.[1] [2] [3] }
destination.filteredItems = filteredDataUse count to get the length of each item, filter those with count greater than 5.
