Task: We have some customer records in a text file (customers.txt) -- one customer per line, JSON lines formatted. We want to invite any customer within 100km of venue for some food and drinks on us. Write a program that will read the full list of customers and output the names and user ids of matching customers (within 100km), sorted by User ID (ascending).
- The GPS coordinates for the venue are 53.339428, -6.257664.
Solution:
This App loads user locations from a text file and displays the list of people in close vicinity.
For example finding all the people with a 100 km radius results in:
| User ID | Name |
|---|---|
| 4 | Ian Kehoe |
| 5 | Nora Dempsey |
| 6 | Theresa Enright |
| 8 | Eoin Ahearn |
| 11 | Richard Finnegan |
| 12 | Christina McArdle |
| 13 | Olive Ahearn |
| 15 | Michael Ahearn |
| 17 | Patricia Cahill |
| 23 | Eoin Gallagher |
| 24 | Rose Enright |
| 26 | Stephen McArdle |
| 29 | Oliver Ahearn |
| 30 | Nick Enright |
| 31 | Alan Behan |
| 39 | Lisa Ahearn |
- Xcode 10.1*
- Swift 4.2
- Clone the project
- Navigate to the project directory
- Open
DistanceCalculator.xcworkspaceusing Xcode - Run the App either on a simulator or an actual device
| Load Data | Show Guests |
|---|---|
![]() |
![]() |
| Problem Reading from file | No Guests Found |
|---|---|
![]() |
![]() |
| Guest List 1 | Guest List 2 |
|---|---|
![]() |
![]() |





