Apps · Practical · Software Dev

UX teardown: make your own guides in  Maps

I always found the “favorites” feature in Apple Maps to be too general and dissatisfying. I quit using that feature once I had 48 places saved all across the world. 🤷🏻‍♂️

Before that, I saved specific lists of places in Google Maps, but found their mobile app to be cluttered and confusing. 😖 So I gave up and started using Trello.

Trello is cool for some things like trip planning and small projects, but it did not scale well and didn’t handle lists of places well. So I gave up on that. 😢

 Maps guides

I’m happy to have just discovered that you can save your favorite places as “guides” in Apple Maps. Finally, this is genuinely useful!

I just set up my own guide for coffee places open early for when I’m looking to get our early. Quick and easy and right to the point! 🤩. I can immediately see all the places I saved and their hours. Check it out for yourself! (This is my own personal guide, so it’s focused on Austin, TX.)

Of course this guide automatically syncs to my iPad and Mac as well. ✅

Rechecking Goole Maps

Forgive me if I sound like an  fanboy, but out of genuine curiosity I went back and I did the same thing in the latest Google maps. It was a bit painful. 😢

Notice how the “main” screen is oddly not a map but more of a picture of a cup of coffee and therefore not useful to me.

And even when I drilled into an actual map view, the places I care about are unlabeled in favor of (1) a notification that HEB has an offer and (2) the Texas Capitol and Congress Ave. Bridge exist. Again, not useful.

I just want to know where a coffee shop is open at 7am! Now that would be useful. 👆

Software Dev

“Sketching” out an app prototype

I’ve learned a lot making apps for big companies, mostly about process: how a good continuous integration process works, how code reviews can be productive (or not productive), how to break a big app into smaller components so lots of people work on related things at the same time.

Still, it’s helpful to do something fresh and new 100% on your own from time to time. Doing something new all your own, you get to try any architecture you want, go all in on the latest asynchronous programming techniques, fully embrace the amazing new(ish) declarative/reactive view layer, and even try out a new CI framework to two.

But the most fun part of all is developing the idea of your app. What does your app do? How exactly does it work from a user perspective? And what do the screens look like in detail?

👉This time around, I’m prototyping my new app idea on my phone so that I can get a feel for how it works in my hands before writing all that code. ^

I tried out a few prototyping tools. After looking at some basic options and some pretty involved options (arguably too involved), I landed on a pretty “sketchy” Mac app that handles full-on detailed UI design and kind of does mobile prototypes through its “mirroring” iOS app. Perfect. 👌

👉 Sketch | mirroring app

I will say that Figma looks pretty promising as well. What nudged me over to Sketch was Apple’s Sketch-compatible design resources. There are some third-party iOS design resources for Figma, but I’d rather go with Apple’s official offering. Sorry, Figma. 🤷🏻‍♂️

So my new design process is this, now that I’ve finally learned Sketch:

Rough sketch on paper ➡ realistic visual design in Sketch ➡ prototype on a phone ➡ code

My instinct is to talk about the app itself while it’s in progress, but sorry… that’s top secret for now. 🕵️‍♀️

Software Dev

Everything you need to know about [weak self]

This is a post about the idea of “weak self” in the Swift programming language. It is not a post about self-doubt. You are strong. You are capable. You matter. 😉

But your Swift object might be weak, or at least @escaping and weakly held. 🤷🏻‍♂️ If this makes no sense, maybe it’s time to check out some pictures or quotes.

If you’re a Swift programmer, you probably know that if you need a reference to back to the calling self in a closure, and that closure might last longer than self, then you should send that closure yourself as [weak self] so you don’t end up with a retain cycle and a memory leak.

Still, it can get a bit confusing. What do you do if the weak self is actually gone when you execute the closure? Can the weak self disappear in the middle of the closure?

Fortunately, the Swift blogger Christian Tietze has all the answers. Or at least he has found some answers and summarized them nicely.

In the end, it all points to Chris Downie’s rules of thumb.

Only use a strong self for non-@escaping closures (ideally, omit it & trust the compiler)

Use weak self if you’re not sure

Upgrade self to a strongly-retained self at the top of your closure.

Via iOS Dev Weekly.

Software Dev

The what, why, and how of the RIBs mobile architecture

Continuing my mobile architecture kick, let’s look next at RIBs. In this case, RIBs is not a delicious, slow-cooked entrée but rather a software architecture that Uber developed a few years ago.

Why RIBs?

RIBs lets Uber’s 200+ mobile developers knock out features quickly without stomping all over each other.

The original design worked well for the first three developers. (via Uber)

Back in 2016, the Uber team had just expanded from three mobile developers several hundred developers. And the app’s design did not scale well to that large of a team. From both a UX/design perspective and a technical perspective, it became difficult to add features. Citing “quite a few examples of, you know, pretty bad UI”, the design team bravely demanded a rewrite.

The design team came in and said, you know, ‘We probity have to redesign the whole application.’… Everybody was super concerned.

Classic engineering understatement

The Uber engineering team resisted the rewrite (which can be nightmare for a large app) for a year, but eventually came around to its necessity. So they defined a few goals for the new design (99.99% reliability, scaling to ~1000 developers, …) and experimented with that they knew – MVC, MVVM, MVP, and VIPER.

But nothing worked. 🤦🏻‍♂️

The problem is that all these architectures are based around the view, and if you base everything around the view, everybody has to integrate at one point, and that becomes a mess at the scale that we have.

The state tree solution

So they came up with a fresh idea, which was to model the whole app as a state tree. Much to their surprise, it worked really well. 🤷🏻‍♂️

We haven’t found an application that you couldn’t model with this very nicely.

A special architecture subteam spent six months reworking some “super ugly looking” core use cases and then turned the rest of the team loose on the new architecture.

Now we have RIBs and the modern Uber app.

Whoa! That looks too easy! (via Uber)

But how does it work?

A RIB is a combination of Router/Interactor/Builder (plus Presenter/View, but I guess “RIBPV” doesn’t sound very good). Each RIB represents a state of the app, which can have sub-states as children.

For example, the root of the tree has two children: logged-out and logged-in. Every RIB under logged-in can safely assume that the user is logged in, and it has an authenticated user token 🔑 to prove it.

RIBs can present themselves hierarchically on top of each other on the screen. Some RIBs just do background support don’t show themselves at all.

No auth token for you, left side. (via Uber)

For more…

Pretty cool, eh?

Okay, I’ll stop here since this is a conceptual overview (aka a teaser) and not a tutorial. ✋ For more details, see the original Uber presentation below or try it yourself.

Up next in the architectural series, we’ll attack The Composable Architecture, which is responsible for at least one cool game and, like RIBS, has a concrete implementation rather than just a bunch of vague ideas. 🙏

Software Dev

Scaling up: how AirBnB ships a quality, gigantic app

AirBnB’s iPhone app has a gigantic code base (1.5 million lines of first-party code), a giant mobile team (75 iOS engineers), and a long history (first commit: 2010).

Over time, their app got so big and complex that the project began to take minutes to open (not build) in Xcode. Developers had to use the USB port on the right side of their MacBooks to avoid thermal throttling. 🤦🏻‍♂️

Given all this sheer complexity, the team there made some clever adjustments to develop, test, and ship their app pretty efficiently. Check it out.

👉 Designing for Productivity in a Large-Scale iOS Application

Among the highlights are independent modules called Dev Apps.

A Dev App allows a product developer to iterate on their feature’s UI and much of its business logic while building a fraction of the overall Airbnb application.

Dev App for an existing Airbnb module

For dependencies across modules, module types allow for “visibility rules” to minimize and document dependencies.

Also, AirBnB uses the Buck build system to keep Xcode projects out of source control (bye bye, Xcode project merge conflicts).

via iOS Dev Weekly.

Software Dev

“What you can see here is that I was learning…”

I love this post from swiftjectivec.com.

👉 Things I Made That Sucked

Not only does he detail the interesting stories of some old apps he made, but also the valuable lessons learned from each app that he shipped.

Highlights

Aim first, then shoot. “Ask yourself why you’re doing what you’re doing and channel your excitement into less action and more thinking before you fire away.”

Pace yourself and don’t complicate. “Take time to learn about design and holy moses don’t toss in an open source project just because it’s shiny.”

There is no overnight success. “Always remember that character is carved out rather than instantly created. Each of these misses can eventually add up to a win.”

My own lessons

Applying the same thought process to my own old sucky apps, here is what I come up with…

Where in the World is Santa Claus?

Ignorance is bliss. I genuinely thought it would be easy to make an augmented reality Santa tracker as my very first iPhone app. Who cared that built-in AR support on the iPhone was years in the future?

I understood that I’d have to learn Objective-C and Xcode as I went. However, I did not appreciate how much there was to learn about location APIs, motion APIs, audio APIs, audio editing, 2D animations, CoreData, the State Pattern, linear algebra 🤯, the terrors (at the time) of shipping in the App Store, plus legal/privacy matters. Also why not translate the app into six languages, starting with Spanish?

And all just to see Santa blink on your screen when you pointed your iPhone north. 😆

My blissful ignorance allowed me to jump in fearlessly and forced me to conquer a mountain of challenges as I went (or quit).

This app only ever sold a few hundred copies but was a goldmine of experience and made me a mobile developer.

Bedtime Balloons

Simpler is better. App #2 was more useful and less technically challenging than the AR Santa app. Bedtime Balloons let me get into some fun art and more interesting animations. Plus this app actually made a difference in at least a few people’s lives.

Third-party frameworks can kill your app. At the time, there was no standard 2D animation engine for iOS. SpriteKit was not a thing yet. 🤷🏻‍♂️ So just like the Santa app, I built the animations around the very nice Cocos2d engine, which would eventually morph and evolve and… break my app. 🤦🏻‍♂️ Yeah, I could have rewritten my app, but again only selling a few hundred copies, I chose to avoid all the sweat and tears and just move on.

Continuous Math Cards

Be practical. I never expected to sell many copies of my barebones but highly configurable math flashcards app for kids.

Written quickly in the new (at the time) Swift language, the app was alright. 🤷🏻‍♂️ But it worked for me professionally. My next step would be a full-time day job as an app developer, which had long been my dream.

Software Dev

The case for creating a merge commit

I’m always interested when someone has a strong opinion on how to merge code. I like this article because the author acknowledges that it’s just a matter of tradeoffs and then makes a case for a merge commit.

👉 The case for creating a merge commit

His basic argument is that a merge commit is the best of both worlds since it “maintains the small changes while allowing for 30,000 feet view of the history” with the --first-parent git log option.

But…

At the end of the day, what matters is to find a workflow that suits your team well and lets you deliver.

He also links to a couple of great articles on using small iterations (Kent Beck’s SB chages and GeePaw Hill’s MMMSS) that I need to blog later!

Software Dev

 Technotes

Looking for some tips on tricky Apple development issues like refactoring your storyboard, customizing the appearance of UINavigationBar, or an overview of the iOS Wi-Fi API?

Get it straight from the source on the new Apple Technotes.

Technotes are focused, timely documents from Apple Developer Technical Support. They explore a wide range of development topics and provide guidance for developers creating apps and accessories for all of Apple’s platforms.

Via iOS Dev Weekly.

Software Dev

Automatically resolve Xcode project file conflicts

Xcode project files are complex and not meant to be human-readable, so they can be scary to merge. When there’s a conflict, it’s never fun.

The tool Kintsugi intends to automatically solve these conflicts for you “99.9% of the time.”

👉Automatically merging conflicts in Xcode project files | github

The name Kintsugi (金継ぎ) is well-chosen, meaning “the art of repairing broken pottery by mending it with gold.” 🤯

Another interesting note: this project relies on a framework called Xcodeproj that lets you create and modify Xcode project files automatically. That sounds likes a better alternative than a homespun shell script. 👍

via iOS Dev Weekly