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 = "PenPals"
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"
AdMob Ads
Replace the string of the variable below with your own
Interstitial Unit ID - you have to create such Unit ID on
apps.admob.com, just follow the instructions on the AdMob's website in case you don't know how to generate a Unit ID:
let ADMOB_INTERSTITIAL_UNIT_ID = "ca-app-pub-3940256099942544/1033173712"
You also have to replace the string into
Info.plist
with your own App ID:
You can get both
App ID and
Unit ID strings from your AdMob Unit page, after creating it:
Sometimes Apple reviewers reject apps because of Ads, the reason why is not clear yet, but a new submission on the App Store will fix the problem and get your app approved - just in case you'll get a rejection because of
IDFA issue.
Anyway, after clicking the
Submit For Review button on the
App Store Connect page of your application, you’ll get something that looks like the picture below. Mark the options shown below and everything should go smoothly on the next review you'll get of your app:
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: 255/255, green: 206/255, blue: 75/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:
Stamps Quantity
This project contains
30 pre-made stamp images. Stamps are used in the app to send letters and also to exchange them with othwer people, you can find the images of those Stamps into the
STAMPS folder - which is into the
Assets.xcassets folder in Xcode.
You can replace those stamp icons as you wish, just keep the same names and size. Just keep in mind that is you'll add or emove some of those Stamp images, you must update their quantity in this variable:
let STAMPS_QUANTITY = 30
Buy Me A Coffee® Link
In case you don't have a
buy me a coffee account, you can create it at
buymeacoffee.com.
Then, create your Page and grab your link. You have to replace the red string of the variable below with your own link:
let BUY_ME_A_COFFEE_LINK = "https://www.buymeacoffee.com/xscoder"
List of Topics
The following array contains a list of Topics:
let topicsList = [
"Language", "Pets", "Nature", "Poetry", "Adventure", "Climate", "Handicraft", "Vegan", "Writing", "Anime", "Philosophy", "Magic",
"Storytelling", "News", "Law", "Beauty", "Makeup", "Sci-Fi", "Coding", "Fantasy", "DIY", "Games", "Environment", " Design", "Music",
"Technology", "Fashion", "Movies", "Architecture", "Television", "Travel", "Photography", "Fiction", "Books", "Cooking", "Sport",
"Business", "Career", "Finance", "Future", "Ideas", "Space", "Politics", "Art", "Religion", "Humor", "Causal", "Psychology", "Health",
"History", "Family", "Lifestyle",
// YOU CAN ADD MORE TOPICS HERE...
]
You may edit those names as you wish, or add new ones, the app will automatically show them in the Options screen.
List of Languages and Countries
Check the following arrays:
// ------------------------------------------------
// MARK: - LIST OF LANGUAGES
// ------------------------------------------------
let languagesList = [
"English", "Afrikaans", "Arabic", "Aramaic", "Armenian", "Azerbaijani", "Basque", "Belarusian", "Bengali", "Bosnian", "Bulgarian", "Brumese", "Catalan",
"Cebuano", "Chichewa", "Chinese", "Corsican", "Croatian", "Czech", "Danish", "Dhivehi", "Dutch", "Esperanto", "Estonian", "Faroese", "Fijian", "Filipino",
"Finnish", "French", "Frisian", "Gaelic", "Galician", "Georgian", "German", "Greek", "Gujarati", "Haitian", "Hausa", "Hawaiian", "Hebrew", "Hindi", "Hmong",
"Hungarian", "Icelandic", "Igbo", "Indonesian", "Irish", "Italian", "Japanese", "Javanese", "Kannada", "Kazakh", "Khmer", "Kongo", "Korean", "Kurdish",
"Kwanyama", "Kyrgyz", "Lao", "Latin", "Latvian", "Lithuanian", "Luxembourgish", "Macedonian", "Malagasy", "Malay", "Malayaiam", "Maltese", "Maori", "Marathi",
"Mongolian", "Nepali", "Norwegain", "Pashto", "Persian", "Polish", "Portuguese", "Punjabi", "Romanian", "Russian", "Samoan", "Serbian", "Sesotho", "Shona",
"Sindhi", "Sinhala", "Slovak", "Slovenian", "Somali", "Spanish", "Sudanese", "Swahili", "Swedish", "Tajik", "Tamil", "Telugu", "Thai", "Tibetan", "Turkish",
"Ukrainian", "Urdu", "Uzbek", "Vientamese", "Welsh", "Xhosa", "Yddish", "Yoruba", "Zulu"
]
// ------------------------------------------------
// MARK: - LIST OF COUNTRIES
// ------------------------------------------------
let countriesList = [
"Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "The Bahamas", "Bahrain",
"Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso",
"Burundi", "Cabo Verde", "Cambodia", "Cameroon", "Canada", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Congo", "Costa Rica", "Ivory Coast", "Croatia", "Cuba", "Cyprus",
"Czech Republic", "Denmark", "Djibouti", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany",
"Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy",
"Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kosovo", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho",
"Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico",
"Micronesia", "Moldova", "Monaco", "Mongolia", "Montenegro", "Morocco", "Mozambique", "Myanmar (Burma)", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger",
"Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda",
"Saint Lucia", "Samoa", "San Marino", "Saudi Arabia", "Senegal", "Serbia", "Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa",
"Spain","Sri Lanka","Sudan","Sudan, South","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago",
"Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe"
]
I don't think you have to edit those arrays above, just because I guess I've placed all major countries and languages in the world, anyway you're still free to make changes such as add/remove some items, the app will automatically show data accordingly to your changes.
Admin Email address
You have to replace the email address of the variable below with your own one - the one you want users to see when receiving a Verification code:
let ADMIN_EMAIL_ADDRESS = "[email protected]"
The 'verification-email.php' file and URL
You need a server where to upload the
verification-email.php
file to - you can buy a domain/hosting on GoDaddy, Hostgator, etc. - and your hosting must have
PHP 5.4 or higher installed and enabled in the server.
Use
FileZilla - or any other FTP client software - to upload the
verification-email.php
file into your own server, then get its URL path and replace the yellow string of the variable below with your own one:
let PATH_TO_MAIL_PHP_FILE = "http://xscoder.com/penpals/"
Example: let's pretend you have uploaded the
verification-email.php
into the root of your website, and its URL is
http://mydomain.com. The string you'll have to set in the variable above will look like:
"http://mydomain.com/"
It's important to add the slash
/
symbol after your URL!
Instead, in case you've uploaded the
verification-email.php
file into a
directory, grab such directory's name (let's says
myfolder), and append it to your website's URL, like this:
"http://mydomain.com/yourfolder/"
Again, don't forget the slash
/
symbol at the end your URL!
In this way, User who will sign up or login in the app, will receive a numeric verification code to type in the Verification screen.
The Verification Code is always randomly generated by the app.
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.