move coredata to swift