The Configurations.swift
file
Open this file in Xcode and keep reading this guide, you'll have to perform some edits in this file in order to get your template ready to run:
App Name
Replace this string with the new name you want to give to this app:
let APP_NAME = "Z Store"
Parse Server Keys
As explained in the
Quick Start section of this guide, you must replace the strings of the 2 variables below with your own
App Id
and
Client Key
that you will get from the back4app website after creating your own Parse App:
let PARSE_APP_ID = "K7SCPO9S6zywk3DMoEskABkJCOOWNkwx6Lfew2hy"
let PARSE_CLIENT_KEY = "kC36ZLG7UWs31cPpLUN3M8RkS6K6BK544MFYm3hD"
Custom Colors
You can edit the
RGB
values of the following variables as you wish, change the numbers before
/255
. The main color of the app and some UI will be affected by your change:
let MAIN_COLOR = UIColor(red: 245/255, green: 75/255, blue: 143/255, alpha: 1.0)
let MAIN_COLOR = UIColor(red: 243/255, green: 243/255, blue: 243/255, alpha: 1.0)
PLEASE NOTE that NOT all Views in the app will change accordingly to the new RGB values you've set in the above variable, you will still need to adjust some colors in some Controllers in the Storyboard.
Custom fonts
This App uses some custom fonts, and such fonts are stored into the
OpenSans folder.
In case you want to add a new font, you have to first drag your
.ttf
or
.otf
font file into the left-side panel in Xcode and click the Finish button in the popup that will show up:
Then select the Label, Button, TextFiled or textView you want to change font to, click the
[T]
icon on the right-side
Attributes inspector panel and select the font you want in the dropdown list:
Admin email address
Once buyers will place orders in the app, both you and them will get an email with a recap of the order, so you must set a valid email address by replacing the string of the following variable with your own one:
let ADMIN_EMAIL_ADDRESS = "[email protected]"
URL path of the PHP files
In order for you and the buyers to get Orders recap emails, you must first upload the 2 PHP files included in the
PHP folder into your own server (you can use
FileZilla to do that and you must own a domain with PHP enabled), then repalce the yellow string of this variable with the URL of the folder where you've uploaded the
email.admin.php
and
email-buyer.php
files:
let PATH_TO_MAIL_PHP_FILE = "http://xscoder.com/zstore/"
Please note that if you uploaded those 2 PHP files into the root of your server (usually it's the public_html directory), then the URL you must set can be something like http://yourdomain.com/
Otherwise, if you've uploaded those PHP files into a directory, your URL string can be like http://yourdomain.com/yourdirectoryname/
What's important is that you always place the slash symbol /
at the end of your URL string!
Bundle Identifier
Replace the string of this variable into the new Bundle Identifier you have set in the
General tab in Xcode - as mentioned in the beginning of this guide:
let BUNDLE_ID = "com.xscoder.zstore"
Default Currency Code
Based on where you are located (so also where your PayPal account is located at), you have to set the default Currency Code by replacing the string of the following variable into your own coyntry's currency code:
let CURRENCY_CODE = "USD"
Just for your reference, here's a list of all
ISO 4217 Codes:
https://www.xe.com/iso4217.php
Default Delivery price
Since Z Store's concept is about selling physical products, you will have to make shipments to deliver goods to clients. So you can set your default delivery price by changing the number of the following variable:
let DELIVERY_PRICE = 7.90
Default estimated delivery days
You can change the estimated delivery days for when goods will be delivered to buyers in the following variable:
let DEFAULT_ESTIMATED_DELIVERY_DAYS = 2
Based on this value, after a buyer will make a purchase, the App will show him an estimated delivery date in the
Orders screen.
Courier tracking URL
You will surely choose an international courier for shipping goods, such as DHL, UPS, etc. So you must find the page relative to the shipment's tracking on their websites and replace the string of the following variable with that URL:
let COURIER_TRACKING_URL = "https://www.dhl.it/en/express/tracking.html"
Please check that link on your browser in order to see what kind of page you have to look for on your Courier's website.
Merchant Name
Set your own Store or company name by replacing the string of the following variable with your own name:
let MERCHANT_NAME = "Z Store Inc."
Utility Extensions
Unless you are familiar with iOS programming, you should leave the code of this section as it is since it includes useful functions to show alerts and perform other things in the app.
Parse Dashboard Classes and column names
This section is a list of strings that the app calls to perform queries to the Parse Server database - aka Parse Dashboard - and it contains a few useful custom global variables and functions.
Do not edit those variables and instances unless you're an experienced iOS developer, otherwise the app will not work properly.