Project setup
Quickly setup the Xcode project and run the app
Setting up the project and running the app is very simple. The project uses Swift Package Manager
to manage all dependencies so everything will be automatically downloaded as soon as you open the project in Xcode.
Clone the repostory
The first thing you have to do is to clone the GitHub repository so you can work on that locally. To clone the repository you can run this command:
- For SSH:
git clone git@github.com:Swift-Sail/swift-sail.git
- For HTTPS:
git clone https://github.com/Swift-Sail/swift-sail.git
In order to use SSH method you first have to add your SSH public key into GitHub. Follow this guide to add your SSH key
Install required dependencies
SwiftSail uses SwiftGen
for resources generation. Make sure to install it like this:
Renaming the project
Next, you can open the project in Xcode and rename it so it matches the name of your product you will be building:
A. Use rename script
In the SwiftSail project, there's a file called rename.swift
in the scripts
folder provided by Tadija. You can use this script to rename your project quickly.
Run this command:
This script will rename everything that needs to be renamed and no further action is required from your side.
B. Rename manually
- Open the Xcode project
- In the Project Navigator on the left side of Xcode, click on the name of the project and press
Enter
. The name becomes editable and after you type in the name of your product, pressEnter
again. - You also have to rename the scheme:
- Navigate to the top-left corner of the Xcode window and locate the scheme dropdown menu. It's usually located next to the play/stop buttons.
- Click on the scheme dropdown menu to reveal a list of available schemes for your project.
- From the context menu, select
Manage Schemes...
. This will open a new window with a list of all the schemes in your project. - In the
Manage Schemes
window, locate the scheme you want to rename. Click once on the scheme name to select it, then click again (slowly) on the name to enter edit mode. Type the new name for the scheme and press theEnter
key on your keyboard to confirm the new name.
Bundle ID
After you renamed your project, make sure to navigate to Xcode -> Click on your project in the Project Navigator -> On the top of the screen click on Signing & Capabilities
-> change the Bundle Identifier to your own.
In general, it should looks something like com.marospetrus.swiftsail
. Replace marospetrus
with your name and SwiftSail
with your app name.
Run the app
Now you should be ready to run the app. In order to test In-App Purchases, don't change the RevenueCat API key which is provided by me for my demo account.