RSSAmplifier

Blog

Thomas Visser

thomasvisser.meRSS feed ↗19 posts

Latest posts

Exceptional theming at scale

I wrote a post about some of the work I’ve been doing at NewStore: Our Shopping App platform is powering 40+ shopping apps across iOS & Android, trusted by brands and rated five stars by millions of users worldwide. […] When we started out, we did the logical thing and defined a list of colors and fonts that could be specified for each brand. Whenever a new brand would join, this list grew to…

Building multi-agent tools for engineering

I wrote a post about some of the work I’ve been doing at NewStore: “In this post we’ll discuss two multi-agent tools: A Slack-bot that helps us triage reported issues with our shopping apps A research agent that helps us respond to incidents […] Our first multi-agent tool builds upon the testing agent we introduced in a previous post . […] To unlock the agent for use in a multi-agent system, we…

Testing our Shopping Apps with AI

I wrote a post about some of the work I’ve been doing at NewStore: “Our platform is delivering 20+ shopping apps, trusted by brands in 40+ countries and rated five stars by millions of users worldwide. […] We have to be smart about what we test in the apps. Anything we want to test we’ll have to test 40+ times, which are the apps for 20+ brands on both iOS and Android. […] We recently started a…

Automated translation & dubbing of speech in video using AI

I wanted to watch a video about robots with my 5-year-old son. One problem: the video was in English, which he doesn’t understand (yet). I could have translated it on the fly as we watched, but since it was evening and he was already in bed, I had time to devise a technical solution. How hard can it be to automate this? This thought wouldn’t have come up if it wasn’t for the current AI boom.…

Can GPT-4 use my iPhone like I do? (Should I let it?)

With all the recent developments around large language models (LLMs) like GPT-4, discussions about artificial general intelligence have sparked again. Does GPT-4 approach human intelligence? The answer is no, because its limitations are clear: it has a fixed knowledge horizon (september 2021), there are things it’s quite bad at (such as math) and it cannot interact with the real world. For now.…

Combine's Future

As the author of BrightFutures , a somewhat popular implementation of Futures & Promises in Swift, I felt obliged to take a look at Combine’s Future type and see what first party support for these concepts is like. Futures and Publishers are both abstractions for asynchronous programming. There are a few key differences though: Futures represent the result of an asynchronous operation. Publishers…

Why Combine has so many Publisher types

A question on Twitter prompted me to think about why Combine has so many implementations of the Publisher protocol. There’s one for each operator, at least. The documentation of the Publishers enum lists a whopping 106 implementations. The map operator returns an instance of Publishers.Map , filter returns an instance of Publishers.Filter , and so on. All of these derived publisher types refer to…

A different kind of Set

Here’s a different way of implementing a Set in Swift: struct Set < Element : Equatable > { var contains : ( Element ) -> Bool } You can initialize an instance like this: let set = Set < Int > { $0 == 42 } And test for membership like so: set . contains ( 42 ) // returns true set . contains ( 43 ) // returns false And while it lacks some very useful features we expect from a typical Set, because…

Understanding the behavior of breakpoints in Xcode

I’ve long accepted that breakpoints in Xcode move in ‘mysterious ways’. Some won’t hit while they should and others seemingly hit multiple times before execution continues. Over the years I built a mental model that explained some of the unpredictable behavior, but I mainly relied on frequent Xcode restarts and pressing Continue a lot . I only recently learned that Xcode actually provides all…

Autoplaying video in WKWebView on iOS 10+

I was looking into why videos wouldn’t autoplay inside a WKWebView and couldn’t find a comprehensive up-to-date answer online. In an attempt to write such an answer I wrote this post, describing what I just learned and how I fixed the issue. Here’s how you define a HTML video element that starts playing as soon as it comes into view, without becoming fullscreen: <video width= "320" height= "240"…

Customizing the source location of failures reported by XCTest

If you’re writing unit tests and use helper methods to factor out common assertions, you might have encountered situations where test failures would not show up in the correct location in your Xcode editor. The failure would be reported in the helper method, instead of in the actual test. Especially if you call the helper method multiple times, perhaps even from multiple tests, it would become…

Compile-time dependency injection using code generation

Dependency injection is a design pattern where types explicitly declare their dependencies and allow them to be set from the outside. This can either be on creation, as parameters of the initializer, or later, through public setters. You can apply dependency injection in code yourself, or use a framework to reduce some boilerplate. In this post, we’ll have a look at an approach to dependency…

Reactive MVVM

The MVVM architecture and the Reactive Programming paradigm can be combined to form a very pleasing approach to iOS app development. However, there’s no clear-cut way of incorporating the two, and the details of the implementation determine how testable, flexible or concise your code is. That’s why it’s interesting to look at a specific implementation, as we’ll do in this post today. The presented…

Hand-crafted artisanal random identifiers

How do you make sure related code in different places is kept in sync? One solution would be to refactor your code so the related pieces are put together. But let’s not always try to solve our problems by improving our code base, shall we? 🙃 The other solution that I’ve been using is to group these places together by adding a shared unique identifier in a comment at each location. Whenever you…

Reactive programming from scratch

Let’s write a minimal Reactive program. From scratch. Let’s reinvent a very tiny wheel, for the purpose of really understanding. When there are so few lines of code, there’s not much to be explained. It’s all there, at a glance. If you understand the code from this post today, you’ll have an easier job understanding RxSwift tomorrow. So let’s get started. At the core of Reactive programming is a…

Presenting Asynchronous Content with RxSwift

The topic of this post is weirdly specific for a first post on RxSwift , but it’s a good a start as any. As of late, we’ve started writing new features for Highstreet in Swift. Coming back to the iOS side of things after spending 6 months on building the Android app with RxJava, I found it hard to write new code without the use of a form of Rx . We’re using MVVM, which works really well combined…

Open Source Swift: Asynchronous values revisited

Ten days ago, I wrote a post about asynchronous values as first-class citizens in Swift . Something happened between then and now. Something big, something great: Swift was Open Sourced! This obviously puts the contents of my previous post in a different light. There’s so much to see, read and learn now that everything is in the open. A lot of questions were answered, including the questions I…

Asynchronous values as first-class citizens in Swift

Update (December 6, 2015): Swift is now Open Source. I wrote a follow up post . Wouldn’t it be great if Swift made some common tasks in modern app development easier? Things like networking and other asynchronous operations, user interface and interaction definitions and working with JSON. Swift hasn’t necessarily made these things easier, compared to Objective-C. Luckily, Swift is powerful enough…

Deleted scenes from my Swift Summit talk

Last week, I gave a talk at Swift Summit in San Francisco wherein I live coded a minimalistic Futures implementation based on BrightFutures . It was my first conference talk, but I think it went well and it was a lot of fun to do. While preparing for the talk it became clear that the biggest challenge would be to fit my story in the assigned 18-minute slot. I ended up cutting half of the content.…