My first pass was a simple list view showing each tree. This downloads data from an open API provided by the city of Portland.
I experimented with Combine and URLSession's dataTaskPublisher to get this working in MVVM fashion. portlandmaps.com/metadata/index…
Next up was a bare-bones detail screen. I mapped some of the important properties in a new screen via NavigationLink.
iOS 14 added a SwiftUI Map, which I took advantage of next.
I then played around with a bit of design on the dimensions of the trees. The gray is definitely a little dark here, but it's Color.gray, so it was easy and fast!
Tapping the tree name opens up a Wikipedia query in SFSafariViewController. This was fun/annoying to wrap in SwiftUI, but now that it's working I can use the code in other projects.
Most of today was spent working with the Map and MapAnnotations. Turns out you can't use a MapPin and also make it tappable. So I resorted to custom icons.
I think they're pretty cute!
To close out the day I set up fastlane and uploaded to TestFlight. If you're in Portland, OR and want to give it a spin send me a DM! Or you can download and run it on your device from GitHub.
• • •
Missing some Tweet in this thread? You can try to
force a refresh