Software Dev

“Perhaps you could tell us what you personally have been doing for the last seven years.”

As MacBreak Weekly celebrated the 14th anniversary of the iPhone’s launch, I was reminded of Steve Jobs’ “redemptive arc.”

Here is Jobs addressing a somewhat hostile question at the 1997 WWDC. At the time, Apple was nearly out of money, and Jobs had just returned after previously being kicked out of the company.

George Bernard Shaw said that “your patience when you have nothing” is one of the two things that define you. It’s interesting to look at Steve Jobs when he is down and see the vision and patience that was brewing at the time.

As we have tried to come up with a strategy and a vision for Apple, it started with what incredible benefits can we give to the customer, where can we take the customer. Not starting with ‘let’s sit down with the engineers and figure out what awesome technology we have and then how are we going to market that’.

And I think that’s the right path to take.

It would be four more years until the iPod launched and ten years until the iPhone launched.

The end of Jobs’ answer also reminded me of Teddy Roosevelt.

Some mistakes will be made a long the way. That’s good, because at least some decisions will be made along the way.

Steve Jobs

Ah yes, patience and decisiveness. Like a good game, they are easy to learn and hard to master.

Software Dev

Why asynchronous programming is (was) hard

One of the most difficult things about mobile development is asynchronous programming, which means doing different things at the same time. This is not the normal flowchart-style sequence of traditional programming.

Weirdly enough, with Swift completion handlers, an asynchronous function exits before it finishes. Or if you’r not careful, it might never finish at all. 🀯

Oh no! This is entering annoying quantum mechanics territory. 😭

If none of this makes any sense to you, then you’re not alone.

All of this is why I love the following video from WWDC 2021. Nate spends the first eight minutes showing how downloading an image and generating a thumbnail quickly becomes “verbose, complex, and even incorrect” in traditional Swift programming. (Side note: I like how Nate apparently worked hard on his hand gestures as well.)

The payoff: Nate then explains how async/await will let you write asynchronous code basically like “regular code.” 🀩

Software Dev

Pulse: Network Inspector

If you want to debug your network traffic on iOS, Pulse looks like a great alternative to WiresharkProxyman, and Charles Proxy.

Pulse takes a different approach, embedding into your app rather than sniffing the network, which can be pretty invasive. (Proxyman “basically performs a MITM attack to see your encrypted traffic.” πŸ€”)

πŸ‘‰ Pulse: Network Inspector

What I wished iOS had is a simple analog of Safari Web Inspector. So I built just that.

Via iOS Dev Weekly.

Pulse Logo
Software Dev

Mobile Native Foundation: Developing Large-Scale Apps

Writing apps for a large organization has its own unique challenges.

Large teams require that you collaborate in complex ways while keeping quality and delivery speed high. It’s not straightforward, and it makes the days of knocking out an app on your own look fun and easy, if somewhat solitary.

@MobileNativeFoundation

It’s not just about “data structures and algorithms” or any of that Computer Science 101 stuff at this level.

The Mobile Native Foundation is a new organization that focuses on large-scale app development issues for iOS and Android.

It’s mostly just discussion groups right now, but they have contributions from people at large companies with apps you know and respect such as Lyft and Spotify.

The discussions cover relevant topics ranging from organizational (such as Encouraging and enforcing testing), to design (Building Modern UI), to technical (Splitting an app into modules).

πŸ‘‰ This site also reminds me of a book on large-scale app development that I’m currently working through: Building Mobile Apps at Scale.

Via iOS Dev Weekly.

Software Dev

The Singleton Pattern – When There Can Only Be One β˜οΈ

Like so many smart and courageous people, the Singleton design pattern is often misunderstood.

Whether it is attacked as an anti-pattern, maligned as untestable, or misused as a global convenience, singletons take a lot of πŸ’© for just being what they are: a way to enforce that there is only ever one of something. I think they should call this pattern “The One”.

A real life example of a singleton is The President of the United States. We only ever have one president at a time. That’s a key part of the concept. It’s not just a convenience.

In software terms, singletons make sense in many cases such as the one and only instance of the current app running on the current iPhone.

With all this in mind, this quick post provides some nice context about singletons (aka the President) versus just a shared instance (hey, let’s all share this one bike) in Swift.

πŸ‘‰ What’s the difference between a singleton and a shared instance in Swift?

Thanks to iOS Dev Weekly for calling out the ongoing confusion on this topic. πŸ™

Software Dev

Getting Started with Instruments

Has there ever been a more powerful, but under-utilised tool than Instruments?

Instruments is a tool included with Xcode that helps you analyze, profile, and debug your live iOS app. Solve memory leaks. Visualize memory. Monitor disk, network, memory, and battery usage. You can even find zombies. πŸ§Ÿβ€β™‚οΈ

It lets you do incredible things but is also overwhelming to new developers, in which case this Ray Wenderlich tutorial can come in pretty handy.

πŸ‘‰ Getting Started with Instruments

There’s also an Apple WWDC presentation with this same name. πŸ˜†

Visual Memory Debugger

Via iOS Dev Weekly.

Software Dev

Motion πŸ’“

This ο£Ώ-centric open-source animation library looks promising.

πŸ‘‰ Motion on GitHub

Motion

Motion is an animation engine for gesturally-driven user interfaces, animations, and interactions on iOS, macOS, and tvOS.

I’ve been a little skeptical of open-source animation platforms since I had to toss out one app and then another as cocos2d morphed into cocosd2x and broke everything. Damn that x! But still, this looks cool. πŸ‘†

Via iOS Dev Weekly.