Trying to store an array of dictionaries with NSUserDefaults.
NSUserDefaults
var theTasks: [[String:Any]] = [[\"num\":1,\"title\":\"example\",\"colour\":\"red\"]]
Just call the .setObject() method directly from NSUserDefaults()and it should work fine.
.setObject()
NSUserDefaults()
NSUserDefaults().setObject(theTasks, forKey: "myTasks")