SwiftLocation 4.0.0 is here
Maintaining opensource projects, even if smaller is an hard work and require commitment and focus.
Pushing them forward, fixing unavoidable bugs, reviewing issues, answer to questions is somewhat another job.
During the past years I had worked to several libraries; most of them were born from a personal requirement both for side project or at my full-time job. With this gym I learned tons of new stuff about programming, algorithms, best techniques & pattern… behind every line of code there was an entire world made of time and dedication to make my seniority always fresh and updated.
But before everything else it’s just a passion.
SwiftLocation is one of my oldest library and, I must confess, somewhat mistreat. With this update I’ve revisited the entire framework cleaning up the code, how the events are dispatched and requests managed. In few words I had better applied the principle of separation of concerns 🙂
With this major update SwiftLocation became compatible with Swift 5 by also using the new Result type, consolidate the APIs naming and provide a simple/robust request-based architecture which is ready to be expanded with more and more services.
If you’re an experienced user of the library you will found tons of fixes; if you are new user you will love how this library can make your code simple and readable without the necessity to implements tons of delegate and functions just to retrive a simple location.
SwiftLocation 4 sports the following features, all accessibile with simple, single line functions:
- Retrive GPS one shot, continuous or significant location with a single line of code. You can set constraint on accuracy, distance or time interval for each request.
- Support Location Tracking via IP address (without bother the user with user permission when you need just of an approximate position). Pluggable architecture to support multiple services!
- It updates the CLLocationManager’s hardware settings automatically by reading the current active requests in order to preserve device’s battery.
- Support Geocoding and Reverse Geocoding (Apple, Google or OpenStreet). Even this can be extended with multiple services.
- Support for Autocomplete and Place Detail discovery (Apple, Google)
This is how you can get a continuous user location:
And this how you can get geocoding getting the places at specified coordinates:
Autocomplete is simple as the previous; this is a search for partial address string:
As you have seen it’s pretty simple to retrive data using SwiftLocation. Are you curios to discover other features of the library? So com’n on SwiftLocation’s Official GitHub page here: https://github.com/malcommac/SwiftLocation.