- Navigate to the
swift_captain_morgans_relationships_lab.xcdatamodeld
. - Create three entities with attributes and relationships: Pirate, Ship, Engine.
* Pirates have many ships, and a name.
* Ships have one Pirate, one Engine, and a name.
* Engines have an
String
attribute describing its propulsion type (i.e. sail, gas, or electric) and one ship. - In your dataStore, write the implementation for
generateTestData
andfetchData
. - Make sure everything shows up!
- Add two plus
UIBarButtonItems
. One onPiratesViewController
and one onShipsViewController
. When you click the plus it should modally present a new view controller that allows the user to add a either new pirate, or a new ship (which needs an engine and should be associated with a pirate!) to the database.
View Captain Morgans Relationships on Learn.co and start learning to code for free.