🗺️ Type once. Get what you want. The nearest ones. That's it. 🗺️
A simple app, written in Swift 4, which aims to show the nearest places around you, given a search term. Example: If you search for something like drug store, your should then see on the map the ten nearest drug stores.
Clone the repository.
git clone git@github.com:pogist/PlaceFinder.git
cd
into the directory.
cd PlaceFinder
Before you build and run the app for the first time, place this struct on any part of the project, but not on a test target, and provide your API key as follows:
struct DefaultKeyProvider: KeyProvider {
var googleMapsAPIKey: String {
return "Your api key goes here..."
}
}
In this small scenario – a quite simple app which's got almost no User Interaction or API calls –, adopting reactive bindings (e.g. RxSwift) could be considered overengineering. In a real world scenario, we could have asynchrony simplified by writing declarative code – which, on its turn, could lead us to a cleaner code and architecture. Last but no least, multithreading is then simplified by using reactive operators to react to changes on different threads.
Swift is such a great language which brings out-of-the-box a few features that allows us to do the functional programming 101 – besides a powerful and expressive type system. But maybe having third-party support for introducing new data structures, functions and other functional primitives would help the team achieving more powerful abstractions and, as consequence, cleaner code and architecture. One candidate to do so would be Swiftz.
Instead of using a simple Struct to handle sensitive data, we could store API keys and related stuff on environment variables via Xcode Schemes – which would be useful for building with these data on Continuous Integration services as well; which takes us to the next point:
Having something to automate build, testing and support cycles would be quite interesting. Theoretically, any good player on the CIs market would handle this – but maybe one that is mobile-focused would be an even better fit – e.g. Bitrise. Also, using a hosted static analysis server focused on best practices-compliance would be great to keep the team on our toes – something like Codebeat might be quite enough.
Again, on a small PoC like this app, it might sound a bit of overengineering. But the personal nature of coding style such a challenge in a team atmosphere. It turns out that using a linting tool – which is synchronized with a style guide provided by the team –, e.g. SwiftLint is probably the best way to handle this.
Besides the fact that Siri and Maps already do this and the app has almost no user interaction, the experience can still be largely improved using voice commands and eliminating the necessity to type anything – leading to a whole new hands-free using experience.
Many iOS users also own an Apple Watch and quite used to having the wearable as an extension of the experience they have on the mobile phone – so having a simple watchOS extension with maybe a reduced version of the map – or a SiriKit integration – would mean more for the final user.
Map by Aidan Cooke from the Noun Project.
PlaceFinder is available under the MIT license. See the LICENSE file for more info.