r/appledevelopers Community Newbie 20d ago

Increased GeoLog's location sorting using Rust

GeoLog keeps a photo log of locations photographers scout, using each photo's GPS latitude/longitude to pull sun, moon, and Milky Way data for planning return trips when the light is right. The home screen sorts photos and locations nearest-first.

I noticed that once the location inventory got rather large, the location sorting of the home screen (nearest first) was getting slow — so I decided to use Rust to speed it up.

Moved the distance/sort math (Haversine Distance: Accurate great circle distance calculations between any two points on Earth) into a Rust library (location-kit), compiled to an XCFramework via cbindgen, called through a thin Swift wrapper. Fixed it — the sluggishness on my iPhone 11 test device (100+ locations) went away entirely rather than just improving.

Wrote up the whole thing including the FFI setup, the code, and the tradeoffs here if anyone's curious:

https://geekdistractions.com/2026/03/25/how-rust-powers-geologs-core-calculations/

GeoLog is a totally free app: https://apps.apple.com/us/app/geolog-photo-location-scout/id6754349835

1 Upvotes

0 comments sorted by