-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hey @eselkin, nice work on your Swift implementation of Open Location Code! As it happens, I had a similar idea around the same time. In my case I picked the existing Python code to port to Swift. Took me a while to go through my company's open source process, but you can now check it out (pod 'OpenLocationCodeFramework'). Pity about the duplicated work, when I started your port wasn't yet published, just how it goes I guess.
A few suggestions for your port:
1/ I don't think it works with Objective-C, as your classes don't descend from NSObject. Two options to do that (if you want to support ObjC): either modify your main classes, or provide new ones as a bridge. For my library, I did the latter, as objects that descend from NSObject can't be used in pure Swift on Linux – so the Objective-C stuff has to be separable to maintain Linux support. That approach also means you can continue to use pure swift constructs (like structs) in the swift API which is nice.
2/ I highly recommend implementing the core SDK tests driven by the CSV data. I know they caught a few bugs in my port when I ran them! You can probably take my implementation directly, and adapt it for your API.
3/ I also included ports of the recover nearest implementation. I like the short-code feature of OLC, it's useful to be able to give someone in the same city as you a shorter 6 digit code for locations within the city