Senior Software Engineer | Scrum Master | Writer | Reader | Husband/Father

Demonstrating How by Porting Our Portrait Mode Example to SwiftUI

Image for post
Image for post

SwiftUI is a young, yet powerful, UI framework by Apple that is both declarative and reactive by design. Its appeal to so many developers is that it is simple, modern, and NOT Interface Builder/Storyboard driven.

That being said, not everything about SwiftUI is polished and matured just yet, meaning that your features may still require a reliance on UIKit.

Take, for example, our very own Fritz Pre-Trained Image Segmentation Model. In our demo code on how to build Portrait Mode (which can be found here along with this tutorial), you’ll see we rely on a ViewController. Within this ViewController, we are able to get the live camera feed, use AVKit components, run our model, and manipulate the UI accordingly. …


Taking back the control you thought SwiftUI sacrificed for simplicity’s sake

Image for post
Image for post

SwiftUI streamlines many of the common functionalities, capabilities, and controls common in apps. It is quite apparent that a focus during development was to consider how devs could incorporate common UI elements simply and with a lot of the overhead powerfully automated. The framework even takes into consideration usability and design perspectives.

This is extremely welcomed by the iOS community, which has had experience working with Interface Builder, Storyboards, and ViewControllers. Anyone who has dealt with the complexity that even the most simplistic features demanded could understand SwiftUI’s benefits.

The Catch?

As devs begin to build out more and more complex apps with SwiftUI, there are times when it feels like features (such as Navigation) are almost too simplistic. As I scroll through Stack Overflow Q&A’s, I see an increasing number of tagged issues that ask for more dev control. Likewise, I see a number of solutions that involve wrapping older UIKit solutions to cover the gaps. …


A high-level overview of the latest additions to the now fully-formed UI framework—and what it all means

Image for post
Image for post

Apple’s SwiftUI announcement during last year’s WWDC (2019) was a welcomed surprise for Apple devs. The framework embraces a more declarative and reactive approach to building user interfaces—a complete paradigm shift from interface builder and storyboards. In a way, SwiftUI brings the joys of Swift to UI-building, signaling a coming departure of Objective-C inspired systems.

SwiftUI 1.0 (unofficial versioning), though, proved to still be somewhat a prototype framework, showing signs of its infancy. There were:

  • Bugs with the new Previews feature
  • Lackluster and/or imprecise compilation errors
  • Random compilation mismatches
  • Lacking documentation
  • Missing components that kept it from being robust enough to fully replace…


Continuously improve your models without rogue on-device training—or updating your app entirely

Image for post
Image for post

WWDC20 has dropped a ton of great updates for developers and users. Noticeable throughout the Keynote and Platforms State of the Union addresses were mentions of Core ML models powering some incredible first-party features, such as the sleep training capabilities. ML continues to play a key role in Apple’s vision for the future.

Core ML has been the framework that lets developers take their ideas to the next level. First, it allows developers to either create models (primarily through Create ML, if working within Apple’s ecosystem) or convert models from third-party frameworks into Core ML format.

Second, it provides an API that allows developers to easily access their models in their code to create some amazing experiences. And, lastly, it provides (some) models access to the Neural Engine inside the A-Series chips, which are optimally-engineered to run ML models. …


Focusing on SwiftUI, Core/Create ML, Swift, WidgetKit, App Clips, and…. SwiftUI

Image for post
Image for post

WWDC 2020 is officially underway! While it doesn’t have the same look and feel, Apple has dropped a massive amount of new stuff. And while there’s massive news about the platforms, themselves, and Apple Silicon, the sessions will provide the nitty gritty info on some of the biggest framework and tooling changes.

Therefore, I decided to make a session watchlist of all the sessions I plan to watch (at the very least). Anyone who knows me and my writings know that SwiftUI is my JAM. With SwiftUI being such a big focus this year (the entire macOS re-design is definitely done in SwiftUI), this it’s the primary focus of my list. …


Take advantage of reactive coding with bindable data in SwiftUI

Image for post
Image for post

As we’ve been working through this series introducing SwiftUI, we’ve so far made an app that allows us to view our team from a list and dive into specific members’ detailed profiles.

However, all our users can do with the app is view dynamic data in a very static UI. The only interaction we’ve provided is the navigation into a team member’s detailed profile.

Our UI could become much more interesting if we added some interactivity to enhance its user experience (UX). …


Taking a peek at the power of ReactiveUI design using custom observable classes

Image for post
Image for post

SwiftUI is defined as being declarative and reactive. The former is what allows us to write out our UI, which we can do in a very clean and organized fashion. The latter is what brings our UI and data closer together than ever.

We’ve been working on an app that allows us to view our team and dive into the profile pages of each member (You can check out how we got to this point by catching up on the series here).

The last features we implemented were the ability to expand/collapse profile details, as well as toggle whether or not the team member is a superstar. …


Decoding JSON files into objects for our UI

Image for post
Image for post

When building an app, sometimes we find ourselves creating data just so we can see our UI start to come to life. Whether we’re adding a new feature, making a POC (proof of concept), or starting from scratch, it’s very easy to just put data together for the sake of it.

For instance, we’ve been building a Team Profiles app to learn SwiftUI (you can find the other parts of the series here). And, so far, we’ve managed to make a class for our Profiles, but even with just three instances, our UI code looks bulky. …


Making lists and navigating them to detailed views with minor code changes

Image for post
Image for post

Thus far in our series on SwiftUI, our demo project consists of a dynamic profile page that’s ready to take in any Person and display their attributes. In this tutorial, we’ll get to actually make a list of folks that we can scroll through using a List and, when we select one, navigate to their detailed profile page!

If you’re just joining us, here are links to the steps we’ve worked through so far. To get the most out of this tutorial series, I’d suggest checking those out first:

Tidying Up

Before we jump into Lists, let’s clean some thing sup. Though we’ve been confining our UI code to ContentView.swift, this doesn’t mean we need to keep ALL of our Vvews in there. …


How to use parameters and bindings to make views more dynamic, reusable, and testable

Image for post
Image for post

In this series, we’re learning about SwiftUI by making a profile page. And so far, we’ve accomplished a very simple—yet stylish—profile for ourselves in just a few paragraphs of code!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store