Chapter 0
Getting Started

Estimated Time
10 - 20 minutes


Getting Started

I’ve created an almost empty project for you to work with throughout the COSMOS tutorial. This is an Xcode project that has empty classes into which you’ll add code, all the assets (including audio files), and a local version of C4.

COSMOS Xcode Project

Let’s have a look at how things are structured.

Open the project now.

Project Navigator

With the project open in Xcode, you’ll see something that looks like this, on the left-hand side of the window:

The Project Navigator

This is the project navigator and it allows you to order, search and navigate all the files in your project.

Swift Files

There are 7 swift files:

  • AppDelegate
  • ViewController
  • Menu
  • ParallaxBackground
  • AstrologicalSignProvider
  • InfiniteScrollview
  • InfoPanel

Of these, you won’t be touching the AppDelegate, but you will be working fairly extensively with all the other projects.

Throughout the tutorial each of the chapters will specify which file you need to code into. For example, in the Infinite Scrollview chapter all your code will go into the InfiniteScrollview.swift file.

Assets

There are 2 types of assets: visual and audio. The audio files are kept in a group and are all mp3 files. The visual assets are all contained within an Assets.xcassets group and organized as image sets where each “image” is actually made up of 2x and 3x versions.

C4

In this project I’ve included static copies of all the C4 files. Typically this is NOT how you’ll use C4, but for this tutorial organizing things this way makes sure that the code we’re writing today will be consistent with the way C4 exists at the time of writing this tutorial.

The difference in embedding C4 the way we’ve done vs. the other way where we embed an C4 Xcode project is nominal. Both end up having the same effect, except that in the latter it’s possible to update the project to stay current with any new releases that are pushed the the main Github repo.

You shouldn’t need to access the C4 files at any point throughout the tutorial, but they’re there for you to look at if you have any interest in digging in to see what’s happening at a lower level.