- Create a new class called
FISRSVP
. - We are going to use the
CLLocation
class which is in the Core Location framework. So we need to add the framework by clicking on the project (blue icon at the top of the file navigator). Then select Build Phases. Open the Link Binary with Libraries drop down. Hit the plus and add the Core Location Framework. Now, everywhere you useCLLocation
you'll need to import<CoreLocation/CoreLocation.h>
. - This class should be able to hold the following things as properties
* Beginning Date/Time
* Ending Date/Time
* Event Name
* Event Location (As a
CLLocation
) - For these properties though we have a few validations to make sure these properties make sense. These should be implemented in the setters for the respective properties.
* Start date must be before End Date.
* The location latitude must be between
-90.0
and90.0
* The location longitude must be between-180.0
and180.0
Comment out the tests and let's get this working in a different way. Instead of just setting things to nil
. Let's actually raise an NSError. The first question to ask is can we still use the standard property setters? Go ahead and implement a solution that raises an NSError
that includes a proper error message and some advice on how to fix the error.
View Word Play on Learn.co and start learning to code for free.