Search code examples
ioscore-data

How can I save radio button options in core data?


I have created 2 custom radio buttons and created labels with each of them, male and female. I want to save whichever option the user selects in core data.

In core data I have already created on entity and have added an attribute of gender, but what "type" should I select? A string, boolean, number etc.?

Also how can I add the selected radio button type in core data?


Solution

  • You should simply add Boolean in your core data schema; and add your radio button's state into it.