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 = "Askk"
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
HEX
value of the following variable as you wish, so the main color of the app and some UI will be affected by your change:
let MAIN_COLOR = hexValue(hex: "#8344af")
PLEASE NOTE that NOT all Views in the app will change accordingly to the new HEX value 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
Poppins 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:
Support email address
You must replace the following string with a valid email adress where you want people to contact you in case of questions, support or account deletion requests - accordingly to
EU GDPR:
let SUPPORT_EMAIL_ADDRESS = "[email protected]"
List of Categories and Colors
The following array contains a list of
Categories which are being used in this app.
You can edit them as you wish since they are just strings, but please note that every time you'll change a name of a Category in this array, you must also change the name of its relative icon in the
Assets.xcassets/CATEGORIES
folder in Xcode accordingly:
var categoriesArray = [
// First fixed Categories (NOTE: these 3 items must alwasy be at the first index position)
"latest",
"trending",
"answer",
//---------------------
// Categories:
"photography",
"health",
"tech",
"movies",
"politics",
"music",
"psychology",
"books",
"sport",
"science",
"education",
// YOU CAN ADD NEW CATEGORIES HERE, ALL LOWERCASED...
]
As you can see by the above array, the first 3 items are separated from the other ones, this is because they are fixed categories that won't be loaded once you are about to post a Question, and those 3 categories are for the
Home
screen to filter questions by
Trending (the first 100 questions that have 2 or more answers),
Latest (the 100 newest posted questions) and
Answer (those questions that don't have any answer yet).
So if you want to add a new Category, just add it below this comment:
// YOU CAN ADD NEW CATEGORIES HERE, ALL LOWERCASED...
and
DO NOT EDIT the first 3 items of the
categoriesArray
, which are:
"latest",
"trending",
"answer",
PLEASE ALSO NOTE the following array of colors:
let colorsArray = [
"#000000", // latest
"#444444", // trending
"#777777", // answer
//-------------------------------
"#8344af", // photography
"#ed5564", // health
"#fc6d52", // tech
"#d870ad", // movies
"#8cc051", // politics
"#5d9bec", // music
"#48cfae", // psycology
"#39bf68", // books
"#8344af", // sport
"#ed5564", // science
"#fc6d52", // education
// YOU CAN ADD COLORS HERE...
]
Similarly to the
categoriesArray
, this array stored the HEX color values of each category, based on their position (see the comments with category names next to each
colorsArray
's item).
If you want to add a new category, let's say
Lifestye for instance, just follow these simple steps as an example:
-
Add the category name in the
categoriesArray
, ALL LOWERCASE CHARACTERS, like this:
"lifestyle",
-
Add its HEX color value in the
colorsArray
right below the last item, like this:
"#ed5564",
-
Lastly, create your own icon for your new category and save it as a new Image Set (so 2x and 3x images) in the
Assets.xcassets/CATEGORIES
folder in Xcode, and give it the LOWERCASE name of your new category (so lifestyle
)
Done. Just repeat the steps above to add new categories.
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 developer, otherwise the app will not work properly.