Example of reading from/writing to coredata in Swift