Swift for Library. No, Unless ABI Stability

Bram Yeh
2 min readJan 9, 2019

--

Not doubt that the trend is coding Swift. In my corporation, some colleagues said they’ve phone screened several decent candidates who indicated they weren’t particularly interested in starting a new job that was ObjC.

In our corporation, we give green lights on coding Swift for apps without restrictions. However, Swift for SDKs is not a good idea by default now, as long as Swift 5.x isn’t available and ABI stability isn’t available.

Our reasons are

  1. Currently the SDK written by Swift 4 can’t be distributed as binary SDK due to lack of “ABI Stability”. Moreover, this mean these SDKs of Swift shouldn’t be distributed to 3rd party that we don’t trust with source code.
  2. For those SDK owners, they have to maintain multi versions of their SDKs for each clients, even internal ones, in order to deal with varying versions of Xcode, of Swift, and of other parameters. It’s actually harder if the apps that integrate the SDK also use Swift.

For us, using Swift for SDKs requires to have a strong reason, and to be willing to deal with some constraints.

Maybe we write SDKs in swift today, make them work in our all apps right now. But it also means we’d expose ourselves to a risk in June, where some app teams want to use iOS 13 features, where those features require Xcode 11, where Xcode 11 doesn’t compile existing swift code, and the SDKs written in swift don’t have resources to update to Xcode 11. Without ABI compatibility, we’re out of luck.

Apple has announced that Swift 5.0 will have “ABI Stability”, coming in “early 2019”, but Apple has also failed to deliver on ABI Stability after making promises before. With swift 5.x coming up, we expect that we’ll be able to use swift in SDKs.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Bram Yeh
Bram Yeh

Written by Bram Yeh

Lead Android & iOS Mobile Engineer at Yahoo (Verizon Media) Taiwan https://www.linkedin.com/in/hanruyeh/

No responses yet

Write a response