Skip to main content

Overview

This integration guide shows you how to how to update your existing project to:
  1. install the ButterCMS package
  2. instantiate ButterCMS
  3. create components to fetch and display each of the three ButterCMS content types: Pages, Collections, and Blog Posts.
In order for the snippets to work, you’ll need to setup your dashboard content schemas inside of ButterCMS first.

Installation

Add the package through Xcode:
  1. Open Xcode → FileAdd Package
  2. Search for buttercms-swift
  3. Select the package and adjust dependency version if needed
  4. Click Add Package

CocoaPods

Add to your Podfile:
Then install:

Configuration

Add your API token to your app’s configuration:

Initialize the client

Import and initialize the ButterCMS SDK:

Basic usage

Fetch a Page

Fetch collection items

Fetch Blog Posts

For complete API documentation including all available endpoints and parameters, see the REST API Reference.

Models

Pages

Collections

Dynamic components

Component views

Component renderer

Blog

Caching

Use URLCache for network caching:

Resources

Swift SDK

Swift SDK reference

Android Guide

Android integration

GitHub Repository

View source code

Content API

REST API documentation