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 = "Buzzer"
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
values of the following variables as you wish. The main color of the app and some UI will be affected by your change:
let MAIN_COLOR = hexValue(hex: "#6441A4")
let LIGHT_PURPLE = hexValue(hex: "b9a3e3")
let DARK_GREY = hexValue(hex: "#687683")
let LIGHT_GREY = hexValue(hex: "#F3F3F3")
PLEASE NOTE that NOT all Views in the app will change accordingly to the new HEX values you've set in the above variable, you will still need to adjust som colors in come 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:
Number of GIFs
Check the
GIFs folder in the Xcode's left panel, it contains 13
.gif
files progressively named (so
gif0.gif
,
gif1.gif
, etc.).
If you'll add some new animated GIF file in the
GIFs folder, name it progressively - for instance, if you'll add a new gif image, you must name it as
gif13.gif
.
Then increase the amount of Gifs in the variable below, accordingly to the total amount of the
.gif
files stored into the
GIFs folder:
let NUMBER_OF_GIFS = 13
If you've added 1 new gif image, the
13
value must be changed into
14
.
If you're wondering why the file name of your new gif image must be
gif13.gif
and the value above
14
, that's because the first gif image into the
GIFs folder is called
gif0.gif
, and its because of an array that gets created in the code based on the names of your
.gif
files. Arrays are 0-indexed, so the first item of an array is at position
0, not 1, that's why the gif file names start with
gif0.gif
:)
Maximum Video recording time
The variable below sets the maximum duration - in seconds - to record a video or select it from the Photo Library.
You can edit that value as you wish, but please keep in mind that if you increase it, it'll affect the uploading and loading speed of the app:
let VIDEO_MAX_DURATION: TimeInterval = 20
Maximum characters for a Buzz
This app allows people to post Buzzes with a maximum length of
140 characters. You can change that number as you wish in the varibale below, but please note that then you will also need to adjust several things in the Storyboard and in some .swift files, so I just suggest you to leave it as it is:
let MAX_CHARACTERS_FOR_BUZZ = 140
Support email address
You have to replace the email address of the variable below with your own one - the one you want users to use to get in touch with you:
let String SUPPORT_EMAIL_ADDRESS = "[email protected]"
Path to PHP file
You have to upload the
mail.php
file included in the
PHP folder into your own server - PLEASE NOTE that it must have PHP 5.4 or higher installed, and that you
CAN NOT host it on free hosting services like
000webhost.com
You can upload the
mail.php
file into your own server with FileZilla, and after that you must replace the string of the variable below with the path to the file:
let PATH_TO_MAIL_PHP_FILE = "http://xscoder.com/buzzer/"
Example: If you've uploaded the
mail.php
file into the root of your server, than the path string may look like:
"http://yourdomain.com/"
Instead, if you've uploaded the file into a subfolder, note its name and set the path like this:
"http://yourdomain.com/yoursubfoldername/"
DON'T MISS the /
symbol at the end of the path string, as shown in the examples above.
HTML Header style
This app displays names, usernames and post dates in HTML format, and the HTML header code is the following:
let HTML_HEADER_STYLE =
"<style>" +
" " +
"body{ font-family: 'Poppins', sans-serif; font-size:13px;color:#000; }" +
"span{ color:#687683; font.size: 12px; }" +
"</style>"
You can edit it as you wish, in case you changed the main
Poppins font into another font.
If you want to use another font, please download it from
Google Fonts so that you can import it into the code above, as well as drag it into the Xcode files list and change Labels, Buttons and TextViews fonts through the Attributes Inspector panel.
Buzz and Users report Issues
People are allowed to report posts and users, and when they do that, the app shows them a couple of lists of reasons why they should report a post or a user to the Admin. Such lists are the following:
let buzzReportIssues = [
"I am not interested to this Buzz",
"It's suspicious or spam",
"It's abusive or harmful",
]
let userReportIssues = [
"I am not interested in this account",
"It's suspicious or spam",
"It appears their account is hacked",
"They are pretending to be me or someone else",
"Their Buzzes are abusive or hateful",
"Their profile info and/pr images include abusive or hateful content"
]
You can edit those arrays items as you wish, they are just strings and will be shown when you choose to report a Buzz or a User.
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.