iOS | Swift language code to interact with core data