Eli Perkins

Craft beer aficionado, esports evangelist, yak shaver and iOS engineer at Venmo.

Read this first

SE-0117, API Design, and You

A lot of conversation has been going around about SE-0117 this week, as the proposal has entered its Active Review stage.

The tl;dr on this proposal is that all classes that are marked as public will not be able to be subclassed unless also marked open. Additionally, it’s functions, variables, and subscripts would also not be overridden unless explicitly marked as open. This means that classes will end up having behavior that some have dubbed “final by default” for any publicly available class. This behavior would eliminate the need for the compiler to generate dynamic dispatching for methods and properties since their implementation cannot be changed after compiletime. While the elimination of dynamic dispatch is a performance boost, this means extra care and attention will be required to turn dynamic dispatch back on for those who want consumers to override the functionality of of

Continue reading →

Mocks in Swift via Protocols

Testing the nitty gritty dirty innards of a lot of iOS apps has been difficult in the past. A variety of tools and methodologies have been developed over time, including a couple mocking frameworks like OCMock or OCMockito. With the advent of Swift, these frameworks have seen their implementations rendered useless, since they depend heavily on the Objective-C runtime.

But with Swift, there might be a better way to setup our programs that don’t require Objective-C funtimeruntime hacks and swizzles.

 Mocking UIApplication

Let’s take a look at an example which mocks out our favorite hard-to-test class, UIApplication.

In our example, let’s work on a type that handles push notifications.

struct PushNotificationController {

The goal of this type will be to have some function which we can call to ask the user for the permission to send push notifications, via UIApplication’s registerUs

Continue reading →

WWDC 2014 Predictions

I figured I’d put my hat in the ring here.


  • iOS 8
    • Lots of performance polish, a la Snow Leopard
    • UIMotionEffect improvements (full under-the-hood rewrite?)
    • Touch ID APIs
    • Some unifying API to talk with BLE-, WiFi-, etc based devices
    • Tint color becomes über important and defining, even more so than iOS 7
    • Fast, fast, fast and fast
  • OS X.10 aka Huntington (shot in the dark here)
    • New UI similar to this
    • UIKit for OS X
    • Siri integration
  • iOS ↔ OS X AirDrop
  • Xcode 6
    • Overhaul of Instruments
  • Some sort of new platform for iOS and OS X development with JavaScript roots
  • Apple Beta Program
    • Beta testing of iOS and OS X apps a la Testflight
    • No limit to beta testers (won’t count against developer’s 100 devices)
    • Better crash reporting
  • App Store app and music gifiting
  • MacBook spec bumps across the line, end-of-line for non-Retina MacBooks
  • A very average game demo from some

Continue reading →

Get Off My Lawn

There’s been a lot of drama among the iOS community these days relating to a variety of topics. From how Xcode can’t handle my scale, to Objective-C needing a replacement, to usage of Cocoapods.

Almost every tweet, every blog post, every Quora answer I would read really only showed me one thing: the entitlement that many of these opinions carried, as if their opinion was not just an opinion, but rather fact.

Everyone is entitled to their opinion, sure. But to bash others for their opinion is just wrong.

The way I’ve noticed a lot of iOS dev’s acting lately has been a lot like an old man telling everyone to get off his lawn. Different things work for different people. There’s no need to force your own opinions upon others. Listen to others

Continue reading →

How We Learn

He said people who were right a lot of the time were people who often changed their minds.

Jason Fried on Jeff Bezos

Tonight, Bill Nye and Ken Ham put on a bit of a show in Kentucky and on YouTube. Those who know me may know that I’m in no way religious, but I don’t shun those who are. I do, however, believe religion is a necessary piece to a functioning society, but that’s a piece for a whole ‘nother blog post.

The part that struck me most about the debate, however, was listening to Ken Ham discuss the difference between “observational science” and “historical science”. Recalling my grade school days (fuck, I’m old now that I’ve said that), I can only ever really remember being taught that some smart guy named Darwin did some studies on finches and this other guy named Mendel did some study on peas and in the end, it’s survival of the fittest… or something like that.

But this

Continue reading →