Here is my code using UserDefaults
twoDArray.append((NameofQuiz: topicDescrFile, dateCreated: Date().description(with: .current), lastQuestion: qIndex, totalComplete: totalAnswered, totalCorrect: totalCorrect, totalQuestions: totalQuestions, QuizResults: SavedQuizRecords))
UserDefaults.standard.set(NSKeyedArchiver.archivedData(withRootObject: twoDArray), forKey: "twoDArray")
The error is in App Delegate
2018-04-22 16:00:01.277625-0400 Surgical Education[24432:12932469] -[_SwiftValue encodeWithCoder:]: unrecognized selector sent to instance 0x1c42e9e00
2018-04-22 16:00:01.281932-0400 Surgical Education[24432:12932469] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue encodeWithCoder:]: unrecognized selector sent to instance 0x1c42e9e00'
*** First throw call stack:
(0x183e9f164 0x1830e8528 0x183eac628 0x183ea4b10 0x183d89ccc 0x1847f34dc 0x1847f4a48 0x1847f34dc 0x1847fa8d8 0x1048f5004 0x1048f515c 0x18d48e5cc 0x18de3fe44 0x18de3fd6c 0x18d48e5cc 0x18d48e54c 0x18d4790f4 0x18d48de40 0x18dae95e4 0x18dae4b94 0x183e46cdc 0x183e44694 0x183e44c50 0x183d64c58 0x185c10f84 0x18d4bd5c4 0x1048e7784 0x18388456c)
libc++abi.dylib: terminating with uncaught exception of type NSException