Please carefully read this guide in order to fully configure this template, and remember to test it on a Real Device – the Emulator may fail.
This template has native Apple Swift code, so you can edit it only with Xcode running on a Mac computer. If you don’t have it, download it for free on the Mac App Store.
Info.plist
file – you can find it in the files list on the left-side panel – and set the text you wish in the Value
column of the Privacy rows.Main.storyboard
and you can find it in the list of file that is shown in left-side panel of the Xcode window.Assets.xcassets
folder.
let APP_NAME = "Opposite"
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:#
symbol. The main color of the app and some UI will be affected by your change:
let TOP_COLOR = hexValue(hex: "#8FDAF4")
let BOTTOM_COLOR = hexValue(hex: "#48CFAE")
let YELLOW_COLOR = hexValue(hex: "#F6D55C")
.ttf
or .otf
font file into the left-side panel in Xcode and click the Finish button in the popup that will show up: let ENWords = [
"'MOISTURE'-DRY-WET",
"'TEMPERATURE'-HOT-COLD",
"'STATES OF DAY'-DAY-NIGHT",
"'DIRECTIONS'-ABOVE-BELOW",
"'GOOD AND BAD'-ANGEL-DEVIL",
"'AGES'-ADULT-CHILD",
"'CONDITION OF LIFE'-ALIVE-DEAD",
"'QUANTITY'-ALL-NONE",
"'DAY AND NIGHT'-SUN-MOON",
"'THINGS HAPPEN'-ALWAYS-NEVER",
"'COLORS'-BLACK-WHITE",
"'SEASONS'-WINTER-SUMMER",
"'DIRECTIONS'-FRONT-BACK",
"'SOON OR LATER'-BEFORE-AFTER",
"'BETTER OR NOT'-BEST-WORST",
"'SIZE'-BIG-SMALL",
"'CUTTING'-SHARP-BLUNT",
"'STUFF CONDITION'-OLD-NEW",
// YOU CAN ADD WORDS HERE (THE NUMBER OF ITEMS OF THIS ARRAY MUST BE EQUAL TO THE OTHER ONES - PLEASE REFER TO THE DOCUMENTATION)
]
let ITWords = [
"'TEMPERATURA'-FREDDO-CALDO",
"'STATI DELLA GIORNATA'-GIORNO-NOTTE",
"'GIORNO E NOTTE'-SOLE-LUNA",
"'DIREZIONI'-SOPRA-SOTTO",
"'GENITORI' '-PADRE-MADRE",
"'PARTI DEL MONDO'-TERRA-CIELO",
"'VIVERE E...'-VIVO-MORTO",
"'QUANTITA' '-TUTTO-NIENTE",
"'COLORI'-BIANCO-NERO",
"'LE COSE ACCADONO'-SEMPRE-MAI",
"'CONDIZIONE DI UN OGGETTO'-VECCHIO-NUOVO",
"'DIREZIONI'-FRONTE-RETRO",
"'ARRIVARE IN TEMPO'-PRIMA-DOPO",
"'ALFA E OMEGA'-INIZIO-FINE",
"'PUO' DIVENTARE SOLIDO'-ACQUA-GHIACCIO",
"'ASPETTO FISICO'-BELLO-BRUTTO",
"'ESSERE UMANO'-ANIMA-CORPO",
"'CUTTING'-SHARP-BLUNT",
// YOU CAN ADD WORDS HERE (THE NUMBER OF ITEMS OF THIS ARRAY MUST BE EQUAL TO THE OTHER ONES - PLEASE REFER TO THE DOCUMENTATION)
]
You may notice that each of the above arrays name is made by the first 2 language code digits (EN for English, IT for Italian).ENWords
arrayITWords
arrayGEWords
and edit all its items into the words and hints you want for the German language let ENAlphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
let ITAlphabet = ["A","B","C","D","E","F","G","H","I","L","M","N","O","P","Q","R","S","T","U","V","Z"]
In this case, copy the ENAlphabet
array and paste it below the ITAlphabet
one, name it GEAlphabet
and set all the characters of the alphabet of that language. here’s an example of how it should look:
let GEAlphabet = ["A","B","C","D", ...etc. ]
Then you need to add your new language name into the following array:
let languagesArray = [
"English",
"Italiano",
]
So add "German", right below "Italiano".setTextsIntoSelectedlanguage(_ language: String)
function. Thake the existing switch cases as an example, copy the code from case "English":
to break
, and paste it below the following comment:
// YOU CAN ADD TRANSLATIONS HERE - PLEASE REFER TO THE DOCUMENTATION
Then edit all the strings into your new language (here’s an example):
// German
case "German":
LANGUAGE = "GERMAN",
etc...
...
break
One last thing to do is to enter GameScreen.swift and check the beginning of the loadWords()
function:
switch selectedLanguage {
case "English": alphabet = ENAlphabet; wordsArr = ENWords[lastLevel].components(separatedBy: "-"); break
case "Italiano": alphabet = ITAlphabet; wordsArr = ITWords[lastLevel].components(separatedBy: "-"); break
// YOU CAN ADD YOU CASES HERE IN CASE YO HAVE ADDED SOME MORE LANGUAGE (PLEASE REFER TO THE DOCUMENTATION)
Below that comment, you must add a line like this (still considering the German language as an example):
case "German": alphabet = GEAlphabet; wordsArr = GEWords[lastLevel].components(separatedBy: "-"); break
PLEASE NOTE: Each item of the arrays is made by 3 words:' '
because it’s a hint, and it’ll be shown on the top of the screen, below the LEVEL number. "'TEMPERATURE'-HOT-COLD",
PLEASE NOTE that the number of items of an array, either the ENWords or the ITwords one (or even a new array of words you may add), must be the same, which means that if the ENWords array has 20 items, for instance, all the other arrays must have 20 items as well.
// MARK: - TABLES & COLUMNS NAMES
fireInterstitialAd;
Xcode will show you a list of Swift files where such code is located.