Friday, September 11, 2015

Lyft Goes Swift

Harry McCracken:

A bit over a year after Apple’s announcement, it was ready with an all-Swift version of Lyft. The company believes that it’s the largest app to make the move, both in terms of lines of code and number of users.

[…]

By June, nearly every iOS developer was working in Swift; on average, it took two or three weeks for any given engineer to be up, running, and comfortable.

[…]

Swift code was also far more compact than Objective-C, which made it easier to understand and manage. Over the years, the original version of Lyft had ballooned to 75,000 lines of code. By the time the company was done recreating it in Swift, they had something that performed the same tasks in less than a third of that.

[…]

“One of the challenges of doing something like this is, you don’t really have a viable gradual rollout strategy for iOS,” says Lambert. “Android has a little bit of a leg up there, where you can do a 1%, a 5%, a 10% rollout. With iOS, basically, it’s live or it’s not, which puts a lot of the burden on the engineering team. Everyone who has auto-update turned on on their phone will have it within an hour.”

2 Comments RSS · Twitter

I'd be really interested to hear how much of the code was rewritten for Swift 1.2, and again for Swift 2.0.

Tom, I'm Keith, an iOS developer at Lyft. Our Swift 2.0 conversion ended up being about 2000 lines of changes, most of them were very minor syntax changes for the new OptionSetType etc. This definitely doesn't account for all the places where guard and other new Swift 2.0 features would improve the existing 1.2 code. We plan to clean cases like that up incrementally in the future.

Leave a Comment