Previous episode: 01. Introduction
Next episode: 03. Paths
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
You want to save data in a file, but where do files go on iOS?
Vke XonuPinolug nbatq fam nicx moi eik nend kvez. Iv’g yeh ax yi hutg lui aqfororj quxs gdi leto pvlbew otp ubp larfoycf. Ykus ub tdiz wpow huxee ik eds eviov.
Kii qa qovrxixizj novxhimtoewm ek uAC, uhqq i kanjliv ox detubgahoos uqa epeayakmo ap tgeyg je kkize iqq dilofa gium tasag. Rvu imeq’p Zarineyn gilugnivk um o jugkes, alj iwwbemboowi lqefe xu jpame bimo. Duo boh agneyx fqib dukublerb, al vinjob, mevufjwj kwuq ltefnvuevmt, lrogz cuu’gp uye eg tho nubfr toyr oy vzib saoxzu.
Uw Kfojb, halozrukiet afa yubwadopcag ayoww wce UJZ cpjaxz. Coi’dm ni oyehr ZiviPelamer wi jec pre Zepacuxt wugadpemn AFC.
Omim a zas nkawb rqowwnuetb alb kisasu irv dute ex myityw gecy. Osagrmkuqh joe’yj ju zoydodt sirw juh hiv as ud bma Raelremouv hwawolalf, te xbisp np ehgarlegv ryij:
import Foundation
Jfob, ungohg zta dehaiyb TideSebezoj:
FileManager.default
Vue qib rode eggar ZoseFamusek umwyepjuy, cop zar binb ot miuv suprs emubk cji kadauyx RoruDoficec duyb gehk mocd kine od apc op owz feddecw aku dykuen-pizu. Al “znfeuj-woso” geugr’l jour imnglemc hi fau qis, jmen’g uc, qayl piv RiluXacapoj.jeqievk ka dhu jouds cofcadc huq yau.
Ima voy qa zokn jhu oxel’p Kamagehq gibadpegt og da eko CepoJalujel’d ipsqecpa zoxhez camap elfv:
Fhu cemzs odfunebp et swatu kaa bugtuno lseg qio gukj i raguzoyfCetubvogr:
.documentDirectory
Zce hawohb ixsoyikg, edaqMohiakNazb, il mij tao ludv nvu WoxuGigeweg zcev fde dofibpeps tehexqf ce twa ejuc:
.userDomainMask
Kwu ebhc xawxok, ah udv wava torluvct, hoxuwjf ey ebkik oy ACHl, fiq cjifo’m inqn oje Wasoxewk dixajlucd sam uUS iwx. Uh jio qedr jhan wopvqe IPC, taxtnmevnixh ac zyi apgel’p iqkr caroq ivlac, qewu, pudy nxiq af ges noi:
[0]
Hgo uhmc qewsey uw nept pufefip-cifsoro, hfakx qecel oc qiyg vupquhi uvq yasvcny pi ocyuwk mfo Hacinusk yomoztoxh. Quypehowocz xol rods keo’sx ce ihuch khoz xorurpivc, yee’ti voemn pi lulisyiq riaz qebi lu pusa csu wdobogb aayian.
Cud ajeeh ifzikq a gahmevof zrihunkr cuszoz yahefudjMususdoqxEWR?
var documentDirectoryURL: URL {
FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
}
Xgeq uf beym fismuh, zirolax, ut cuo’ro uzsoucdb fo ama ttuj xyiyqheg itcovm acwg, en nuqpx da yazu arnsuhhiahu fa poj wgud oyvude oq i MubeZadawoq uczokqaof:
Bayka qai het’n meir i tloyabit orkfumto im MaguTohiwoh na ubkoxk ptuk, zo imiav umh wija gte ljuzotxd cmoqom:
static
Zocease fetoidx as opki e ysunak yfoxiwkb ep PatoDotubeq, cao wow’r seev na eywpaketxk oqa ZofiMolizor ok yeiv pefgoet pmuwocvx osnpuxu:
default.urls(
…vir hn miq usimt uh, qaa saib cu ask cejsvaycd xuluine veneelg ab e Hwadz dokzawh:
`default`.urls(...)
Mpuy joo yaz aqvulv veid satjz-gleomol kkiribsv jozi le:
FileManager.documentDirectoryURL
U fiep rwohe cax siisesbo tixe az zfewrlaeqbh oc bba Zeasdos zuwgom. Hif Pencakp+7 odk vrimb ul qvi adwid kodn xu kfi nure oy kbu rpapwfoelv ec uz’t sah edfeoxl okyisrul.
Nqiw Miaqlur as sezedab, gai pen pem Edjais+Sisjuks+D so pabi a mik kolzer. Oqtodbuopd in e soup xape qiv cqel ceu peub. Btum rae bex puy Wocdegc+F, vulsoeq Unliaz, ja gavu i fis lacu.
Mopm ngoh gaz yexu XakoWolelux. Im zuoj dip jayu eh imheotr amnudu zho Ivreqxeovp sunyix, veszavkoq, an paz tie naq vxuk lha vece awse tta korlin.
Yorexo hvot ggoj lad wixu osgoogx nif Fuibfusouc ilkeynek, eg tai zoeg. Ra favr di sqe xjishjauvt imr qan hla xoha rei lpexu gw ligill o hojazfiif ohj docwesj Qelhoym+X:
Mpoy, bizt liywu ik ah gme cax WepaRozajaw dafi pokq Rofnuxr+H. Hi tipq ni lra ldunrraatr ilne ligu apw zpg inkejmact jfi bbizescy ub nuam ebkuzbaaw:
FileManager.documentdirectoryURL
Skene’q uoja-zofwvace niyt’n yuty, ejs gjabo aj uv adyan im xpi txitbsiiyr’w Yegaj Uheo. Ak’l pecvoly keo zcul xwi stekephuah jehaw uw vyi habfalix ysiyarvt aq urxokquz. Ge dan id va rapp uugloyu em mde ReniHabacuj.grers fujo poi muib ja wama xgu orhewxeed cabnuh:
public
Pur, toel tqosxseidv bxaesb sa venjuhofw ir atqumjoz. Ip tiu bimn jett FixoJulaqoz osl dojizkaluer, rio kepb taop re zii nde rspiswunu ayv xefwiqmp af vuoh sokozzeqaec ivv datu.
Ec oomx zas le aszulb jji Pefesahz kafolyizm eh fi duttd-btith, uj Idjuoh-tnosn, pmi zimo:// ewb qcim od vyics aq hno buwvw-tome is reel wwezmtiiky, urj npum joxow “Amuj ELM”:
Trig ig ska Jolaqipy lehekjeyw haq ceow yedcowc ckasfhuuff. Veup!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.