How to Upload / Sell a Swift Package on the Code Store

Eric Solberg
Stackademic
Published in
4 min readMay 7, 2024

--

Uploading a package on the Code Store is super easy — it only takes a couple minutes.

There’s three easy steps:

  1. Add some basic package info (e.g. title, subtitle, keywords, etc.)
  2. Pick your pricing model (How will you charge developers that use your package?)
  3. Integrate our super simple iOS SDK into your project.
  4. …oh wait, there’s a step 4… Click “Launch”!

Let’s discuss each of these steps a bit more.

1. Add Package Info

To list your package on the Code Store, add some basic details to help others find it.

  • Title: Choose a title that accurately and concisely describes what your package is (e.g. “Alamofire — Elegant Networking”). Keep in mind, you only get a limited number of characters.
  • Subtitle: This is a great place to answer the question about what your package does (e.g. “An HTTP networking library”).
  • URL: This is your Swift Package Repository URL which points to the location where your Swift package is hosted (typically in a Git repository). This is the URL used in Xcode to add and integrate the package into a project via SPM.
  • Keywords: Similar to the App Store, insert comma-separate keywords (no spaces required) to make your package findable. Again, this field allows for a limited number of characters.
  • Images: While not required, you can add up to three images to your package listing. If your package is a UI element, this is a great place to demo it. If there’s no visual component, it still can be a good idea to have a screenshot or two of its example usage. Developers are humans (or at least, most are) and humans are visual creatures.
  • Pricing Model(s): The last thing to add to the package submission form is the pricing model (or models) that you want to add. However, this is a larger topic, so we’ll discuss it in the next section.

2. Pick your Pricing Model(s)

There’s three pricing models you can choose from to earn money on your package; and you can pick all three if you really want to.

  1. Pay-as-you-go: This is our recommended pricing model, which charges buyers based on the number of downloads their app that implements your package gets. You can even implement a free tier before charging begins (e.g. 100 free downloads). This ensures iOS devs can try your package for free, continue using it in a way that directly scales with their app’s profits, and provides substantial recurring income for you as your package continues to be used in the wild.
  2. Fixed Price: The second way to earn money is by selling your package for a one-time price. Buyers pay you once upfront for unlimited use of your code in their apps.
    To make sure you get rewarded for your work and avoid normalizing free stuff (which we think the App Store has struggled against), we will likely require a minimum fixed price of at least $1 in addition to any other payment model you implement.
  3. Subscription: The last pricing model you can choose is a subscription model, which charges buyers a weekly, monthly, or yearly price for unlimited use of your package. This could be a great option if you think your package deserves to be rewarded based on the duration it’s used, as opposed to the strict number of downloads a buyer’s app gets.

3. Import our (super simple) iOS SDK

// Somewhere in your package...

import Codestore

CodeStore.configure(with: yourApiKey)

To get paid, you need to integrate our lightweight iOS SDK. It tracks your package’s usage and charges consumers accordingly (or prevents them from using it if they aren’t paying for it).

Adding the iOS SDK is very easy. Just import it via SPM, and configure it with a one-liner by passing in your api key.

That’s it! As apps run your package, the developers will be charged automatically per user (if you elected the pay-as-you-go payment model, that is).

4. Launch

The last part is quite challenging…you have to press the “Launch Package” button.

Congrats!

After completing the four steps above, you will have successfully listed your Swift package for sale on the Code Store.

Now it’s time for the fun part — making money!

Stackademic 🎓

Thank you for reading until the end. Before you go:

--

--

iOS Developer and Co-Founder of the Code Store: A Swift package marketplace