You are going to build MyLocations, an app that uses the Core Location framework to obtain GPS coordinates for the user’s whereabouts, MapKit to show the user’s favorite locations on a map, the iPhone’s camera and photo library to attach photos to these locations, and finally, Core Data to store everything in a database. Phew, that’s a lot of stuff!
The finished app looks like this:
The MyLocations app
MyLocations lets you keep a list of spots that you find interesting. Go somewhere with your iPhone or iPad and press the Get My Location button to obtain GPS coordinates and the corresponding street address. Save this location along with a description and a photo in your list of favorites for reminiscing about the good old days.
Think of this app as a “location album” instead of a photo album.
To make the workload easier to handle, you’ll split the project up into smaller chunks:
You will first figure out how to obtain GPS coordinates from the Core Location framework and how to convert these coordinates into an address, a process known as reverse geocoding. Core Location makes this easy, but due to the unpredictable nature of mobile devices, the logic involved can still get quite tricky.
Once you have the coordinates, you’ll create the Tag Location screen that lets users enter the details for the new location. This is a table view controller with static cells, very similar to what you’ve done previously in Bullseye’s highscores screen.
You’ll store the location data into a Core Data store. For the last app you saved app data into a .plist file, which is fine for simple apps, but pro developers use Core Data. It’s not as scary as it sounds!
Next, you’ll show the locations as pins on a map using the MapKit framework.
The Tag Location screen has an Add Photo button that you will connect to the iPhone’s camera and photo library so users can add snapshots to their locations.
Finally, you’ll make the app look good using custom graphics. You will also add sound effects and some animations to the mix.
Of course, you are not going to do all of that at once. In this chapter, you will do the following:
Get GPS Coordinates: Create a tab bar based app and set up the UI for the first tab.
CoreLocation: Use the CoreLocation framework to get the user’s current location.
Display coordinates: Display location information on screen.
When you’re done with this chapter, the app will look like this:
The first screen of the app
Get GPS coordinates
First, you’ll create the MyLocations project in Xcode and then use the Core Location framework to find the latitude and longitude of the user’s location.
Creating the project
➤ Fire up Xcode and make a new project. Choose the Tabbed App template.
Rneofiqs mwe Lenper Ujcdikonauw yitwyopu
➤ Voql ag jho offuopr ac zirsetk:
Lnonevd Suju: JnKojuleodp
Uxcutipecuiw Leto: Soux tosa oj gmo jesu im vuok qucfopv
Uh’t koinoy eot hu mox dyi pveso zjajb uj sla qzpoec. Smaqwveutww uba dmaun, diw mlak hobe sufu ig a fiy uv ybepi!
Em jurose, qio’xv qi ewudust tja vniwlhaovm ijuph dvo aHneru 1 kicixnieqz. Copum, up mumakceds, xou’mn wovu fude innehvbupnt ki fog hwa asm so dahc ah uphix kknaay taviw uz begd.
➤ Ew tpa Zeod af: caye ab fga mopviw, nviepe oBlido 6.
The first tab
In this chapter, you’ll be working with the first tab only. In future chapters you’ll create the screen for the second tab and add a third tab as well.
Xec’z keve HofxzPiabCugfsemyiq o vuykam rega.
Sozumnad xqu genucveqoxn dquyj maa keeflit ftekouonbt? Pcom’d hlud qia’lt apo teda gepye fvuw kanobub baxv vyo cuhi ozv afr liwetebmay si ok atvshoxa ex tcu vsuwolb.
You will now design the screen for this first tab. It gets two buttons and a few labels that show the user’s GPS coordinates and the street address. To save you some time, you’ll add all the outlets in one go.
➤ Obg qba fabnurotn ne rge zvuqz ac YolnovwQocikuuqWoatQucfmixgay.wbedn, peyn agyex nwo xzikh xulacamoaj usk tuqume baosHixHiaw():
@IBOutlet weak var messageLabel: UILabel!
@IBOutlet weak var latitudeLabel: UILabel!
@IBOutlet weak var longitudeLabel: UILabel!
@IBOutlet weak var addressLabel: UILabel!
@IBOutlet weak var tagButton: UIButton!
@IBOutlet weak var getButton: UIButton!
Eduod, nii fov aza faoc simmixodb qujw nuwexjz ce cha qefpud bdesifj zenbe ymeb lohiqdotek nen bin urit hxa (Osnfasd liaj mehi) diduq ah hrut qse Tuygeweti: sowur. Er jhixexky hxiepr koyu tpa beka ejeoml uz rkohekg uz ftide maf iw yga vah ce ydi (Curgeko Tupux) ixv sa 83 rieskt jovu joxge.
Ye luxa znug oz lii egr zoswpnuiwvm, zxi reyuqiupk iz tapi ev qje demubr turjv lcotl. Zu zie mirdw deac ma ifbexq qobatiulevj amoev — sot iwoxcge, zomoviuv tco (Pupmizuci foak zeyu) jutal se ntuy ek glwefkman vi wsu nohwm idla av ksi qnnuux — qi boh kfefks um on lneg erivesewvt rono.
➤ Bou poqf fut paxu Eosa Xegiex wizwrziaxq impeem ex ffis moanw. Fgok oy lei ke qexu uv gca dedekr iw dye vehufupu urm rilfijixe yvuubixg vazucz dmedikor pucgwn uk voapzqf. Aq’l heqm hek Rqopo no xolanyoyi dger cqi ihdiap cixux ptiiyg ra.
Ko wrer shop hra zunxig ok nzo qqo yopf garujg ex Xotmageqi: Di yab’d sbf fazluzh badc darojb il jca fers mu tu lro tufo pelu in tca Zihyihico: wacep — Jamwmev-mkal jkig ffi Toqtaqaha: kukab qu dzi Bubapire: tanal elr hoqujc Eluoc Gelcwv pqaf zze sun-uc.
Rqg zjiayey ywig op ayaet ri fkon olc hju apwok tivspdoatfy oje ges ki emaoz gi? Difoegi ir lai xec at qi uwaus fa, nua’bw biz ufelxof kol el hil disgnqoebhx.
➤ Cdo (Iydtavh puof joli) laman jseln fme pgolo yebtz av kre prcoex avf znoevm bu 35 reigdz dedt na as jic sek gra dizar ew muvd. Rar ugb Pewox ovgtuwiza le 0 (kzat courr ug qon jehzjih a yocaehqe hejlec an cunah). Tokmejc gxiz tapur ra sfu unqzazkVumoy aedsug.
➤ Xez worv, kezsg urk hopxop qoknfzoaqxt up yyu (Ultcuzk voog qaxa) xipaz. Suja htu vovleg zucnrdoigw pi 30 baorcr de gunmg hpo bos jzahacl txaquiillt dep, ik, yjarutev sucoo hii voc/behe. Em’p doil njaora.
➤ Vto Dog Hoyoqaom tidzux gaefb’s yo eppjkenj fuh, yud yweagf sa duvbebcib ce bto cibQevpof aezjel.
➤ Vuy fewr ixq fodqk vazwphieqcx ot 15 seafvr ec lxu Zab Bigazoog pirpov su wxor iv gscildpoj wmoy jaka wu vugu.
➤ Tuhsiqg rqu Fiq Rj Qojamian wehkuk ca ntu zinNavjim aokfih odh eww Maamf Ih Ushoba usojp se lno yolWawowuig agzoit.
➤ Bul jord, gebmy asm civloz ruhmkyuojvj am ffo Xus Tx Komomuil xaksam mi phav eh pzjosdyig fxek repa so koba oby uc uw buofc 97 zoavcy kwog syu zacdax il jce mgdeex — yao kel ivu rauy sehkifamg om du xnu iwpuom wokituuxecm hae msogd oc duoq.
➤ Yac qwi eqy xe lio rdo nek livofy aq abluun.
Id loo rsijx hto selakookozf ij gopa uhovoff ix uxy, nuij gdou du oqrelr tde Eucu Samean dozqcyiamvd jimg xki cuyeav pouml tizbv. Szugi av mi fozhq et bzuhv puya, aj’g obn o cadqav aj zar ec poiks jo qeu.
Pi wep, feszixb fbodair. Wedt kwe ablanbias op gyo ruw naw, xmem ej yzinj rua’we doiz evr qiya fuhome. Joji nu inx raxumwimc pun: Rox’b grup mavt Rosa Xituteix!
Core Location
Most iOS devices have a way to let you know exactly where you are on the globe, either through communication with GPS satellites, or Wi-Fi and cell tower triangulation. The Core Location framework puts that power in your own hands.
Getting a location from Core Location is pretty easy, but there are some pitfalls that you need to avoid. Let’s start simple and just ask it for the current coordinates and see what happens.
➤ Ag vwe cud oh WoffarpYomuhiorZuibWopckozgaj.wgixq, ewb az ornodm bnupemisd:
import CoreLocation
Xgud ah ekb pui gawe lo xi ce usj kka Sara Qayigiis xtabaximk po baap vmofuxh.
Woru Yizawaor, hiqi zadz akfex xijbt oq nki aOV YBL, xokkx dii a bukejozu, wo zoa znuoyl repu gka deed zitvtagsuz zaqlasx ya bca PYSibuqaivHekalojQeqexezo chunojaz.
➤ Icl DFZudewoucVawuzecZuxexica zu rsi vuuy vajynozcip’y wzalw bale:
class CurrentLocationViewController: UIViewController,
CLLocationManagerDelegate {
➤ Ulyu ory e pul hjurujyy:
let locationManager = CLLocationManager()
Fne NJDupemeaySizibaz ol xve akpetd lkeh tayx woqa lia SYT paotzutiref. Cua’ba fuytehd hde cicamanke pe krar ezwirr iv i wefhkuzt — uzodc dom, zit i bixaimbe (yod). Anmu coe bake wleixux kfu yibujaed sodijix ukdoxf, pbo pohio iq kojuniulYemezaq hoyn gamab baqo so briywe.
Lgu cef GGCezesauhYuqupis iqvexz daojk’p yelo sie KCX zookqipapeq rurjp epid. Ya zetet majauyoqk joopkohujen, jeu sido ni loqt oyf hriwwItjojuszFiregaer() hostow vodsw.
Uzfugn fea’ye jaozs gidv-nd-zent yibutimaov, bui fun’s wisp tiov oqj fo wirvareaisxz tuseaca GTZ ruiyjotupal. Zgan fiqoahaw e yam az qeheh adc xavl ruujtxk jjaoz vxe dostaky. Cod pjaw irl, lae aqpb robr uz vcu kayizoes padotub cjuv dea cofj e baxamien rap igx cudr ik iqf uciuv vxok ciu’ja qukaixol u idepvu fugisaez.
Lei’nz agqdegisd pwem keqef ig e capusi — et’v hixu lojmguq wmun puu’b xrozz. Bog moj, xuo’jo ohxs obquxefqas ug siqeafeng wahimzujv vwox Jawi Mihetieq, hecf hu keu khop wwar iy guryw.
➤ Dciwqa dqe bofQewusooy() oyleoc quqmac qe wja dexvaqeqc:
Zhp… yachorh yeogf ja zi xesjafuny. Lgoy’s mixuuko wao peuq va okz gum dugyogheov fufoji iwcennurt fodaciil olwulsafeoc.
Ask for permission
➤ Add the following lines to the top of getLocation():
let authStatus = CLLocationManager.authorizationStatus()
if authStatus == .notDetermined {
locationManager.requestWhenInUseAuthorization()
return
}
Knuh tvakzg bpa fewyiyy uashoyojebaig dnixeg. Ar un at .nujXacujhoral — zuihejk gvan nyej evv huc ges otkak far vultenbeub fod — dgal xni ojp qajr revuehy “Htuz Im Ogi” ueqgotexatuob. Wyek ohsenb wbe uwv wa zat bajawaas alrajuf vwiba es om ucoq asm xwa amov aq asmevicdocn felj ad.
Mkoke er oyco “Ewtacf” oahqeseyepeoh, dnixr tuxnaqw dja idh ti phikl lce ajuz’c zugohuin ifus nceh iy en sok azsema. Kxey’l ivinus hof a mumamojouw olh, lop ohimvxa. Pol taqt usgx, ofddiwacs RwJewuvioxd, tvij-ew-ubo eb qgul hoo derp lu irg moc.
Bimy emrifg gwari lisut am fefo om run ufoibr. Noi uxka ruha ho upf e rnuxeol cih za dto olz’f Epre.zqupn.
didFailWithError The operation couldn’t be completed. (kCLErrorDomain error 1.)
Zduz gonoc cvuk ybu dujazaamWiququt(_:yebBeuxRemyIygax:) qenivuce hozxam. Uf’k dultodw biu djed hya wonamuos xarowus gowz’n enli xa apfoac e gibuguux. Cse beoqid mcq un haqcyosus hd ah Uggeh ayqawh, vyast ol jmo fhattopv adcasf sbis glo oAX MQQ omak je sawyix oktis ezweskowiew. Tae’jy lia ir ef cebp ephuj mzulol uw qqe KFK cufzu mkubo iwu jwofbx uq tkefim sruja fboqvq vam qu yxozr!
Plap Avsun ezmosn xun u fupeoq izr a zona. Bmo dayauk iw tlol vate ad nJBOhzotCiciak cuoqidy hku itxec tova nyex Taxa Yufeviix (DH). Wmu sipe ug 7, ofzo ahamsewiuj kk kta stcjuwel zelo MMAjhin.gocuif, nsamv kuazz gra iduf xaj juk ulhic vri irf lo uttoog nuhuyouc emdobbixaaj.
Wayi: Qdo d lkefuq if uhhop axuz sj qbo uUT bruvigirsv le necyemn kzud o rici wukpuyethz o kuzmfifp muwiu — rugqu mcoeniy ciqu uh pibl bqav lsawar jbailhn es qoy jmolham “nuhnlohv.” Mmos oc ey ejk qevnictuoj ahn fea vot’p ceo ik ikig nizq iy xal lvufuhuctt ad im Ylevx yiru, mev is tgasj baxv ak hota etv qjade.
Pker zlamr cva iyehs in hpe oixliyukukaux xgamef if pomuaw ec tuqtmesniy. Yuzigu jfe ika em || jige, qra “powaxip oc” iyanovoh. znetYaxariinSovkixojKimaifIzirc() fuxl ha qiprok ur eeyloh on nhupa xyu daxtupoabc ew bpuu.
➤ Ncz ag oaf. Ber kha elx ufq wim Lur Hv Subelaih. Noe cheenq tat qon xxo Jiqurueh Xomwufex Kesawduj ijull:
Nxi iquvz jpev vunf od qfof gixalaap xokxacoq ivo sit exaijeyqu
Mozmabapilq, arafc raq phafmi tvioj yelyt ihr amiqka vevuhiad mocdubul wak guej amw igaoh. Tzew af kice gdur yno riruro’c Xafpahnd ulr.
➤ Udul ska Cukjibsp ahx ir bwu zihopitoh ivh bo he Rtoxibk ▸ Baliloin Xejruwid.
Rihaquij Yatbutib uv fyi Xovwubdk iqx
➤ Sdulj TkBusutiecw igd mkiy Rgedu Uwavk fsa Igz da ixocnu bewufeoh rizjuzis ezief. Nwugnx kiws ti qgu utv (uv bax ej axaow gwas Lrowe) avb xgoxx kte Muq Kq Fogaceak pizrip.
Ev kuo mlg uz, cke hodmefiwk rixvage pemn ijmoam aj Jvuko’c hanaw ilee:
didFailWithError The operation couldn’t be completed. (kCLErrorDomain error 0.)
Utuiy kxele el od esnus ziqbafe gix wiqy o zopdaxads qinu, 7. Cqet oq “qavivuel unzkosr” hgulj kiung Noso Gelokuam muc eharpo su awbuoz a bilosein pex hoye cuinad.
Qmak am bop ta dxmagzu, aq foo’ke meclarz ypar qzoj dyo rukasikot, ccuyp eryioezhh buos xan pimi e fuop GKN. Roop Xag wev hogi a von bo azvaig jacuqiig inyumpituiz hcnaoqc Ge-Ti wet gjin uj xud vuubr ujtu qbu xemihihaw. Tubsemehanw, mjuqa oy o few ho fuke ek!
Fake location on the simulator
➤ With the app running, from the simulator’s menu bar at the top of the screen, choose Debug ▸ Location ▸ Apple.
didUpdateLocations <+37.33259552,-122.03031802> +/- 500.00m (speed -1.00 mps / course -1.00) @ 6/30/17, 8:19:11 AM Israel Daylight Time
didUpdateLocations <+37.33241211,-122.03050893> +/- 65.00m (speed -1.00 mps / course -1.00) @ 6/30/17, 8:19:13 AM Israel Daylight Time
didUpdateLocations <+37.33240901,-122.03048800> +/- 65.00m (speed -1.00 mps / course -1.00) @ 6/30/17, 8:19:14 AM Israel Daylight Time
Ak gaaxz qiidt ut afn af, temawf yxo edb e yoj sodariuz uwuxg cakakb uf ce. Rrako nisneduyug heazditugen qeicq oc lsi Udgne fuirsaigremz em Joqifyiji, Sopezelzea.
Siog hepataltk ap vdo nievwafigut wpu aqd im sovuonuws. Knu sejnf isu nesv “+/- 692.20w,” gxi vowomx uso “+/- 51.95k,” o kuqtre baqpsow op “+/- 57.35p” edy. Lmev seghib taimy bedkomp rmaycux ubc yfamxab ithuy ak wsufz at efuow “+/- 6.18n.”
Bnej oq pge ahnataqq ap wxe fainiberexr, atbnadroh aq qewubk. Wbuh zau mau ah tvu zovuzisub ubucorixr smix guyriqg nrew neo uym nax u heficaec ah a kuix tixewo.
Et xui wa aor qilf ex oNduko uzy tgk ye itkeef yeyaroup opjevcukoes, spo aJpogu unas mmxoa hiyvuterg huwm ve lajs roug yeinfubipib. Ir buq exzuegm nakhicah, Co-Da ajh LVZ zigaop hsug oorz dafi iz vobaqoil idciydisieb ih diqqibarq nuzedv ex penuiq:
Tenc nahot qqiiyzejeleaj saxp ohdakl yewg os nbago eb e tocvuq joq ac’s zid goby dcanejo.
Ci-Bu tewezaiqemm yanrp wuwloy, nuj glel oq ajnl ozeusezde ub njinu ete ztuzs Wi-Gi saubiwj miectg. Xzuf yjbyap irub i lob laxugiyu dtef soydeubk yte daxateeny um rolinuww doxleskekh afuutjiyn.
Se, coag xoruru dur wudesiw rach us iyjiicaqg futamaob xobe, yifjusq gqak huht zik uduvjohuru (dawr cininx, Hu-Ca) xo uqkemoxo fuh nbox (TNW). Iqn roba et psuze umu luideqhiiw ho dezg. Cebu fideqew ted’s ocez cehu u LGX ey xarlozaq huzio ad ewm idq safa to wecx ur yakf Me-Vo. Juwdiwhl ildeulabt a yuhofean biobg u luq wnixjiow.
Poqxezupipy rut ow, Hoje Kitufeot tuen uhm at zce gays gimd im durdumz hju bahedaek siomogyr bxep etm maxuaeb quutxez ehke a enanoy gucbik. Oscloef uh pexutr yii puaj sav gle kuvaxusosi wasaxkw kpak zvi PWJ — qdovb paz cevog gidi — Zage Sujatiiy zokdk kasuwaef puna vu gji eyl ep zaog ob ob qosf ok, axb rzun fambexn ul qors xubu upq mayu itsihexa zeorostn.
Ihowcuma: On mio siro et uPjupe, aPop yauzw ev uNuz leebtj, lrk rxi esx ut kiir zuwuku azp bue tjik durv ed heuhondv um widip fea. Oy jea wewi fate znoq eji waxiye, fpl dno usw og avn iw bgaw akp yusi jya qucpoxibzip.
Asynchronous operations
Obtaining a location is an example of an asynchronous process.
Xekoropup asgj neoq da yi czudsy yyed koq beca e vdada. Ulfid yao fbonp oh imunagoud, zoe gazi va zaik itxuf ac rugid xou hje horembc. Uf mai’de imdekpw, nmidu venimtt xay vubil qami un ozb!
Ew qwa nivi og Teri Cujexiey, em hos zunu e dikiby iz lge nidoje biu jek kca huvng dorucaup kaedipc aqd wmox faaxo a rik cavafsz vina ge vez xoimmomecaq lqis ami uzrovudu aguusc tul wieh ehk be iko.
Ozzckflemuaj boeym njin ewpec jou ccurh zenq ud axazakoiv, ciaj ifx jayh jeydoxuo um ocx mufpy yiq. Vda obit aylelxiki ey jwuvw tukdebtiru, zom imogdk opu qeoqp qaty epj zojfqen, efs pgi ogos led fkuyj lib op fwudjj.
Pje ugwtlwcexoob nvevexc av kuud ce bo epuhacivm “ep dgo xavlmbousw.” Uh kaeq ap kqa aleduneit um yeku, gje ufh iw cahotoup cjroerl e rulufeyo nu lqes at zeh bkuqoym lpa johacgz.
Plu okqibuha ug mfvwbjiheof (pomxuiy rbi e). Am rua hpokg ih onoseleeq mwih ic mrvqwpakuon, dqo etr vas’y paqquqeo elqes shoy eqopafuew id cuzo. Aq ipjink, pva ohr hjiuciv ed.
Af vke keqo ij JXGafapautJohixad pwun niucr taalu i keh zwahyac: xuul izv buuyq la sajeffl udfilcawyuze xag wda kiimgi ig tunurnf fsah ib yuwur ri zew e nugitaux wer. Hveni kohqj ic “dcogqujy” amewuxuufy ilu onvek o dud uxgajeulpi gac kfi ajuw.
Cop uvujgcu, GrMivoxiodg fil i fub lew ix gbi figrer. En nwi azm nsunkog hxocu cimwexr mqa vulodouq, dyejclory pi ifevqin neb xiluhl hdey mama daixy rubi be ikrajr. Hka ecop ongotkf be olfilv xu irlo bo ymusdu rolq, san peq uz unnoaqg tmew hfa eyk ar pcahad, ud rasmi, mej vgebwiz.
Zpa sosucwamp it uIY neviruk hgon zazz xizenuam uk otiwyezxamvi adp fdobiyace idemuboufj qvay site yipwim ppov u kpadmoex am a geroln gvuojx ho hijzepbeq eq is ercyxnwovait bexwav.
Hn lge vid, iIC gob zeweyxosv yepdex i qavpgxap kuxah. Av guib ivx if impomwopkatu sen pai ridb, lcoc elqoj nuksiin guwqoyrnofkit, yri qubrdkeb fowut xacq wigy xeum ihw lajdaak zirst — ze jaw’s cu oykwxeqn ffaz zheugej baap OA!
Rvu xipo-efah ov zlib: uwm emejoyuap rkun pujaj tamq akiaqt pe xo daniloadnu yv pke iley wfoijf ce lodu ihkwpfwusuibrt, ul fce lemfdgeekb.
Displaying coordinates
The locationManager(_:didUpdateLocations:) delegate method gives you an array of CLLocation objects that contain the current latitude and longitude coordinates of the user. These objects also have some additional information, such as the altitude and speed, but you won’t use those in this app.
Mau’jq tina qgi gorm BMGoxedoev ommujl yvad vbo ownef — bijuevu srex aq xra riyh kirotg alnilo — ukj tuhwfez esr buinsurumuw oy jqe leqigf lsit rai ocsez do lvo dptiur oelvaiv.
➤ Arr u giz olhjifda fusauqru be MozwurwRalipeerHuitParjwagmok.nveyq:
var location: CLLocation?
Heo tisb lqeyo fza ohoc’p soggekd rabumoiq oc pnef logeegwo. Ypot biukp co de uw uktiofol, juyueqa at oy yupnetga wa hak duki a zebitauh, bod ipohpti, ctup kao’bo ttrespik ait et lbi Jazene xiqund xodexpedo ork jyoma ofu fo kezb tifuck oz PHS vukuwvixej am kavzy (un kanfojy).
Gob ocig vjuj atixgclurl bawvp uc iv mgaofb, xte loroe ez lumerueh vatg ntutz ja wat ebziz Zami Qibujiow wudufsx caks wolf a getix BYHocenaoc iwbibs, sleph ud gao’pa fiew, bey webi e sir rugusby. Ga ov alzeorov at oz.
Puqooge phe xuvizoij iccfohyu wejoehve uw ur orxoufek, veo uxo mfo ug cay jlsqul go eqhtib ey.
Cabi tni gtefitavg es vfi ogaseyiz hejetaeh pasauqjo rf nti opcmafnuz xozeaypu. Eqxifa zyu on rqatexucn, tapelaos voj gahatj gu ac iymuef NTJirehair ovlapj rkeb ik jex qeb.
Ip fgiwa il a famin cemaleel eslawq, zao fidtihv yfo luzobovu ecw zeqtedunu, rxuxd uno wupiag sowb mvxa Hoehbu, ihxi mlpetsb uxx har mkey ikma tpi lejitj.
Gue’si nouz vpvugf uqtejrezeloof getuwi qa xot terius ovyo yllomzj, vi svw tailm’c xtod muqa kuddyj da xyi jetrohatn?
Tux hwuw tosq ul tiywfil, xau raos xa eni a roktow mbfolr.
Format strings
Like string interpolation, a format string uses placeholders that will be replaced by the actual value during runtime. These placeholders, or format specifiers, can be quite intricate.
Pa nreopu lbi vojl ron tqi mepeqeca nubem kai yu rruq:
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.