InDecks

Week 11 •

This week, I focused mainly on iOS development, going through a ton of tutorials along the way and culminating in the creation of a simple app called InDecks.

Learning SwiftUI

I tried learning iOS development many years ago, but found it difficult to stay motivated, since it didn't have anything to do with my job at the time. Luckily, with advances in SwiftUI and the ecosystem around it, it's become much easier to get started and build something useful.

I spend a good portion of the week going through any tutorials I could get my hands on. Specifically, I went through lots of tutorials on Hacking with Swift, which I really can't recommend enough. The tutorials are well-written, and the author, Paul Hudson, has both a plethora of articles and videos breaking down mini projects. I love the way that he introduces new concepts in short videos for the first half of a series, then starts to build a project with the concepts in the second half. I went through almost all of his recent videos and feel like I have a good grasp of Swift and SwiftUI now.

I also found that the Swift documentation was pretty good when I needed to look up something specific about how the language works. Swift is one of those languages where there are lots of ways to do the same thing, so can be a bit overwhelming at first. But I think I'm starting to get the hang of it.

The major sticking point for me was the how to manage state in SwiftUI. Again, this is left pretty open ended, with lots of articles and tutorials out there on how you should definitely use Model-View-ViewModel (MVVM), or how Model-View-Controller (MVC) is still the way to go. Similar to React, the state management seems like it should be added progressively, keeping state close to the view until you need to pull it out and share it with other views.

One last note on SwiftUI and XCode (Apple's IDE for development). Having the ability to preview your app in real-time plus a pinned window for displaying documentation was extremely helpful. Managing the preview can be a bit of a pain, depending how you manage state, but it's a great feature to have.

I did find that when I turned to ChatGPT for help, it was a bit lacking. It often doesn't have knowledge on more recent releases (i.e. the last couple of years) and would often fall back to deprecated methods. Apple's allegedly working on some generative AI stuff, so I'd expect to see their own version of ChatGPT or Co-Pilot integrated into XCode in the future.

InDecks

Drunk with the power of my new knowledge, I decided to take a crack at that idea from a couple weeks ago: a simple app for capturing "cards" with a photo and some notes. I called it InDecks, and it's still in the very early stages, but I'm happy with the progress I made this week.

As I said a couple weeks ago, the major sticking point for me was the camera. I'm still not fully comfortable with the camera integration, since it requires a bridge between the old way of doing things (with Apple's previous UIKit framework) and the new way (with SwiftUI). I found a tutorial that helped me get the camera working, but I'm still getting warnings and I know there's a better way to do it. I'll have to come back to this later.

For now, the app has two main screens: The capture view and the cards view. The capture view shows a camera preview and a button to take a photo. Once you take a photo. you can tap below the photo, which brings up an overlay with a text field to add notes. Once you're done, you can tap the save button and the photo and notes are saved as a "Card" in app-specific storage.

The cards view is just a horizontal scroll view with all the cards you've taken, with the most recent first. The most recent version of iOS added some nice-to-have features for the scroll view, which makes snapping cards to the center a breeze. You can tap and hold a card to bring up a context menu to delete it, but no editing is available yet.

ImageCapture View

ImageNotes Overlay

ImageCards Scroll View

It's certainly not App Store-ready (or even TestFlight-ready), but I'm happy that I got something working myself, without following a tutorial. I'm going to keep working on this app next week, so you may see some more updates soon.

Wrapping Up

There are still lots of things I need to learn about iOS development, including better state management, how to write shaders using Apple's Metal framework, and how to handle networking. I'll also need to learn more about testing and deployment if I want to get this app out to the public. But I'm happy with the progress I made this week; it feels good to get back to building my own stuff after a couple of weeks of more tutorial-heavy development.

See you next week!