Creating Graphics Code in iOS & OS X with PaintCode


Two years ago, I worked on a large iOS project with a very complex, dynamic shape that needed to be rendered on its main screen. The shape had to be drawn using hundreds of Bézier curves in a closed path, generated from real-world data.

Despite my background in computational geometry and OpenGL, I wasn’t sure how to best accomplish the shape in iOS using the drawing primitives and their rendering contexts. Fortunately, I found a helpful tool called PaintCode which cut the time to prototype the drawing code by an order of magnitude. In this post, I’ll describe how I used PaintCode and cover some of its more interesting features. Read more on Creating Graphics Code in iOS & OS X with PaintCode…

Creating Reusable Page Layouts in Ember

Creating components is a great way to remove redundancy in Ember.js apps. For example, you might have a custom button that is used over and over in many different views but is defined only once. This is great, but what if you want to reuse an entire nested page layout instead? It’s easy to do with yields and some Ember magic. Read more on Creating Reusable Page Layouts in Ember…

Testing with Swift – Approaches & Useful Libraries

I’ve been working on developing an iOS app in Swift. It’s my first experience developing in pure Swift, without any Objective-C. This project has taught me a lot about the current state of testing in Swift, including different testing approaches and best practices. In this post, I’ll share some of my experiences and discuss how we have approached testing different types of Swift code. I’ll also talk about some useful testing libraries. Read more on Testing with Swift – Approaches & Useful Libraries…

Managing AWS Route 53 Hosted Zones with AWS Lambda

On AWS, I use a Route 53 private hosted zone for Amazon VPC to allow me to conveniently address EC2 instances and other resources. While all EC2 instances are automatically assigned a private DNS entry, it is usually something fairly unintelligable such as “ip-172-31-51-229.us-west-2.compute.internal.” An entry like “website-production.atomic.aws” is much more helpful, especially when trying to configure communication between various EC2 instances that comprise a larger system.

I constructed an AWS Lambda function to automatically update the DNS records in my Route 53 private hosted zone whenever new instances are created. This ensures that the private hosted zone is up-to-date and can be relied upon for communication between EC2 instances.
Read more on Managing AWS Route 53 Hosted Zones with AWS Lambda…

Go Home Swift Compiler, You’re Drunk

Swift is approaching its two year anniversary. Thus far it has experienced high adoption and continues to grow as developers transition away from Objective-C. As a programming language, Swift is great. It feels productive to work in, and has a nice variety of modern language features.

Read more on Go Home Swift Compiler, You’re Drunk…

A Declarative Architecture for Swift Apps

I’ve long been interested in seeking ways to design software in a declarative way. That’s why I’ve lately been very interested in tools like Om Next that provide good patterns for managing the state of your entire application and rendering UI based off that state.

I was recently assigned to a new iOS project using Swift, which was a great opportunity to to learn Apple’s new language and see if I could leverage it to bring a greater level of declarativeness to iOS programming. Read more on A Declarative Architecture for Swift Apps…

CoreLocation in the Wild: Experiments in Monitoring More than 20 iBeacon Regions

On a recent project, we were using iBeacons and Core Location monitoring and ranging to track a user’s location in an indoor space. iBeacons are placed around the space and each iBeacon maps to a real world room or area like “conference room” and “entry area.”

We had a simplifying assumption that beacons, Core Location regions, and real-world regions have a one-to-one-to-one relationship. We were pretty happy with how well it was reporting locations with up to 20 beacon regions, but “Core Location limits to 20 the number of regions that may be simultaneously monitored by a single app.” So we needed to engineer a way around this limit in order to track more than 20 distinct locations in our system. Read more on CoreLocation in the Wild: Experiments in Monitoring More than 20 iBeacon Regions…

Espresso – Testing RecyclerViews at Specific Positions

My team recently added a RecyclerView to a screen in an Android app we’re working on. It’s a horizontal view that allows a user to scroll left and right to see content that’s offscreen. One of the challenges we’ve faced while working on this view has been testing it in our Espresso tests—specifically, testing the contents of items at certain positions. In this post, I’ll show you an Espresso matcher that can be used to aid in testing RecyclerViews.
Read more on Espresso – Testing RecyclerViews at Specific Positions…

Retrying Network Requests in Ember.js: Part 2

This is the second post in a series of two that cover capturing, storing, and retrying network requests using Ember and Ember Data. In the first post, I discussed how to intercept HTTP requests and store those requests in local storage. In this post, I will cover how to retrieve them from local storage and retry them.
Read more on Retrying Network Requests in Ember.js: Part 2…

Retrying Network Requests in Ember.js: Part 1

My team is currently working on an application to help students learn how to conduct experiments. The app is an Ember.js frontend supported by a Rails API backend. Since the application is used in schools where Internet connectivity is spotty at best, we needed a way to support dropping off the network periodically. I think we came up with a pretty cool solution that I’ll explain at a high level in a series of posts. This post will cover how we stored requests in local storage. Read more on Retrying Network Requests in Ember.js: Part 1…