From the course: Advanced iOS App Development: MapKit & Core Location
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Solution 3: Selective circles - iOS Tutorial
From the course: Advanced iOS App Development: MapKit & Core Location
Solution 3: Selective circles
- [Instructor] And we're back. How did your solution work? Once again, there are plenty of solutions for this. Here is my solution for this. I'm going to go ahead and stop the app and I'm going to start in the pizza annotation class. I'm going to add another property, a variable deliveryRadius, and I'll make that a CLLocationDistance. I'm going to make this optional, equals nil. I'll start as a nil value for each one. Once I do that, I can go into the pizza history annotations, go over to Naples, and in here, add the delivery radius. This is the same as New York's. I'm going to go ahead and copy this and I'm just going to stick it in New York. Zoom down to Chatham, stick it in Chatham. Change it to 60. I'm going to leave Chicago and Beverly Hills alone, as they're going to have nil values, and then I'll check for the nil value. With the nil value, I'll do nothing. If it's there, I'll set the radius. I'm going to set that code up in the add delivery overlay in the view controller. I'm…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.