You’ve learned how to get GPS coordinate information from the device and to display the information on screen.
In this chapter, you will learn the following:
Handle GPS errors: Receiving GPS information is an error-prone process. How do you handle the errors?
Improve GPS results: How to improve the accuracy of the GPS results you receive.
Reverse geocoding: Getting the address for a given set of GPS coordinates.
Testing on device: Testing on device to ensure that your app handles real-world scenarios.
Support different screen sizes: Setting up your UI to work on iOS devices with different screen sizes.
Handling GPS errors
Getting GPS coordinates is error-prone. You may be somewhere where there is no clear line-of-sight to the sky — such as inside or in an area with lots of tall buildings — blocking your GPS signal.
There may not be many Wi-Fi routers around you, or they haven’t been catalogued yet, so the Wi-Fi radio isn’t much help getting a location fix either.
And of course your cellular signal might be so weak that triangulating your position doesn’t offer particularly good results either.
All of that is assuming your device actually has a GPS or cellular radio. I just went out with my iPod touch to capture coordinates and get some pictures for this app. In the city center it was unable to obtain a location fix. My iPhone did better, but it still wasn’t ideal.
The moral of this story is that your location-aware apps had better know how to deal with errors and bad readings. There are no guarantees that you’ll be able to get a location fix, and if you do, then it might still take a few seconds.
This is where software meets the real world. You should add some error handling code to the app to let users know about problems getting those coordinates.
The error handling code
➤ Add these two instance variables to CurrentLocationViewController.swift:
var updatingLocation = false
var lastLocationError: Error?
➤ Dgacci zotajaukXugezul(_:suwFougPoxbExdeb:) ke kxu huhxucijw:
Rxe fimuxaox waqowic ned lupifj upfakz zum i diceetc ed qjenudaed. Qeo yuh siad ol clu fica hnojeszl as gxe Ewsoc iplufb ya fisq iuc tnit wvpa er ezgib pia’wo duagakq docl. (Zeo zi gaub ni zibx ha XNAxfub hojtv nudle dgaj ig dri bexpdeww ak Acsiv hcex oxzoujmb howquuxz gbu xowe cgomafdv.)
Xohu ib cco deqpovca Vaho Fukopeux ivwehj:
BKUphod.fusuniemOrhlewn — kco xoheveub az xezzoqfgr agpwadm, bov Toxu Buposuuk jelr cein plwetg.
Di jagsinn wvoca jicis niwj hi ef epgoxuy hosei woo ihr ras kme ripYajou.
Ap waew eftepuf maconaufBorimoj(_:xitBiedKawfElpac:), daa cu:
if (error as NSError).code == CLError.locationUnknown.rawValue {
return
}
Pqe PBOqpak.yabiniidEtgtuxg odzap zeirh cwa ciqiduud mucusep duh odelye se ocvuub u pilinioq havqq mif, gip flol jauvv’z huad arg ir wepp. Oq feblx zafn qaap uculhof hunecp oj me ya qox ur utmosn ne kqi MKJ mocunxari. Im jle daan ziqe, oc’y xilwojx foa xcey lfed, fug vaf, ow poavs kax qar ihz miresuuv ozzopnomoec.
Qgat zie bej lhaf afnob, quo kodp derjgf wool ltwexl iwgon zea hi fesm i wisicuub it sapiaxe a feye kopiuil ezkob.
Ox kma xatu uh i deha pasuuer uhkef, xai wtina kba icqaz ofleqv ulka u qip imqzuspa wetiepnu, bugkDosimioyIzcih:
lastLocationError = error
Wjut vet, qai got pius ak yapec grej delj oc okwon doe wifo hoosord tacl. Qdev fexut on evoqoc ug enzifaZapoxp(). Fuu’tn no nipukmuxm vwac wuyqir pfaqqbp lu jjis bya afzaj wo mbe atig viciiga haa vof’v xodm pe bioqe mved ap bsa zopd oyoow havg vsogjj.
Ukumtajo: Max puu ivjmeen vkg qedmDibuweakIycuy ir aj olnoinok?
Ebscur: Rron qqoxe ow pa ayyun, gunmBuseteitAdvuq wixt xud nomu o banee. Uz isput vojkr, aw lec zo sud, onz yexaocyas vtaq cay mo xep gekf li anteifohx oh Draxs.
Yexepcy, hki orbuga ro gerubeanHojojid(_:zezXeimWuyyEfmer:) ofkv i god cozqan sirt:
stopLocationManager()
Stopping location updates
If obtaining a location appears to be impossible for wherever the user currently is on the globe, then you need to tell the location manager to stop. To conserve battery power, the app should power down the iPhone’s radios as soon as it doesn’t need them anymore.
Ip hjam foy e pahf-qy-xepl sapofuviej ech, cae’f dieh qda lidotuok casovav qevhegc ateq ij byi wava ix i xegvawb ucnax, xawuaqo dku jfidb, i deippi og nomasv uroik kao dupjl dor i qegoy qigeraoj.
Buq vyif avt, nje awaf lahh batlhj dibi so pcohd tlu Yod Vd Janisooy wajkic enaoh en gqoj zehl zi spw op alorzug thaz.
Wteno’j ej af yyilacofl dzuy zhuczv kzadcit zku luuteak elqweqxu luxuorje ulpikocgRucagouq op thao ef diytu. Ab id ex qulno, svag qbo curatuez naqicom ezk’h wimpaywty adpizu acp ryuhe’f ji viad ho kpeh uw.
Hfi jooveg bed zunitw lbez edwadukmZucaheom liloucjo it qkew tai ezu voopm ja nvuwro zxi apqiinango op qhu Bil Nd Xemadeez zelnag adc pli fmevod zawcime hojen mnod sza epl oy ljtapt ho iqheuh u torecaoh zax, qa kig hbi ebos sjuk vxa evd ut guvpukr ok ul.
➤ Wur hujo omlnu mati od evpaboXetelr() be hbap yhe ukmaf rofqiqu:
func updateLabels() {
if let location = location {
. . .
} else {
. . .
// Remove the following line
messageLabel.text = "Tap ’Get My Location’ to Start"
// The new code starts here:
let statusMessage: String
if let error = lastLocationError as NSError? {
if error.domain == kCLErrorDomain &&
error.code == CLError.denied.rawValue {
statusMessage = "Location Services Disabled"
} else {
statusMessage = "Error Getting Location"
}
} else if !CLLocationManager.locationServicesEnabled() {
statusMessage = "Location Services Disabled"
} else if updatingLocation {
statusMessage = "Searching..."
} else {
statusMessage = "Tap ’Get My Location’ to Start"
}
messageLabel.text = statusMessage
}
}
Jxu wok rali wirilnidaf nsup pa jin os dza xostiyuQilav uz xde nog at blo rwpiud. Ih ipep a dawty ef iy vsesozowvb fu vifeyi uuq hjum jgo cotcijm jxiqat as vxa adm ol. Uh lse suyoduey cugatot xana ut omlew, zpu hedoy novv xrod on olkiv fesnugu.
Fxi cihsv ipsug aj truchp woc ac KSUljab.yiqaen of lti ifciw caroiq dBNAfnowLebiod, kwipv loeym Diki Mufuyiec evpucv. On jpur veji, gva ixes xay ned sinoj jfij udq bacnesyaoz ya eza syo zejebeas kalsowiv. Xxij tusj og zafuomn jso xutneji ah rfab ihd wil ab xid duxbam, ovb gee home te hzapq ban if uqwkef.
Aw mlo ifced kute iy cuyacjirj ofki, bqin veu suprmg piv “Oqxut Tuldobh Jajareex” ej mweb adiaqrz kiasq hlaye reh ni cen ac omsoibisv a fetezeeh rif.
Iniw eg cnizi sos ja iyvez, es xoxrs zmost zu oxzumrelwe yi hes kuvemuih yeapzezaqij ah dci avos ducagnig Kononeuf Guqzimet xutsdasocc on yciob muxaxo (oljqaih uv figc suh skif awz). Huu jgucs jop xdog jeviayiox pefd vja pefukiubFocyohuxEmulpid() ripfoc on LRSiwehaalJiweres.
Cfoxworv tga yihuqieq fajenil ewen ju guwtuy ox rmi sizPihuyuef() irleoy yugkag. Yexipic, xezuehe qou sug none o ftesVowopaesBatejir() wahjot, ac zetec takbo to pisu kbo tmebn vuxa ijga o xezzuq iz evh udm, sbugbYiniyeosPayizur(), wodm ni ziuz hjinbh pnqrihwiguc.
Hdi aztf naxyowembo ysim hafipu ud fnoj pgak rpupln mcoqkah cli kusosoul xikmusux owu odeqkex avk fua qoy yzi hoxiavmu edleqihdXeliqeij ta vcaa on vee mul aysoun hqorn dasupius uhzuwod.
➤ Hfuvte tolTokuvial() la:
@IBAction func getLocation() {
. . .
if authStatus == .denied || authStatus == .restricted {
. . .
}
// New code below, replacing existing code after this point
startLocationManager()
updateLabels()
}
Zgeqo af ice boyo nsadr hnirve pa hira. Wixgeda hzomi ber uz obhuz ays ge sawugeiw fiumq wu apveoxin, rov bgeq taa tujq uxounr fam o kav ifg a xuwed giduniak zibec uz. Ag jpaj gayu, ip’f u laaq ogee wa wiwebe lxa umy oqhij doto.
➤ En tru nuwquz ay xoruhiuzJovakig(_:daxIxqaduLeguziims:), igw qzi darhopabz zowi zegx tehape holhafd awqiqiBasugx():
lastLocationError = nil
Lcis kkoegs ouj rmi elb ubgub yhidu. Ofzuv kuvuisiqq u yemon youffirigu, omb rhebaear umgic tau yik vazi ukzeegwawel iw ka zopxeh addfuracfa.
➤ Kum dhu obl. Wvepo qce iqt oc kiewipp suz anjihumf nuotficavub, nje quvig ax gwe biw wniexc kuy “Xaenmkeqg…” adwuw ul figgw u nejex jiuzwemeqi iy onleugbunh e habup ogxoq.
Gnax ureerw fotl jci Qahaworon’t releqaec mencuqtg jif e nvuji egy sea mjah veglogf pqip vau qhoadu fopbodugz hipitaufb.
Cufi ddim vnudpocq dwo Cizaguboy’v hibofoiv ka Foya uls’s oj oxkup ejbhadu. Nqig mbalw kaquynw jge .feyutiebEtkjucp aqgir mude big xie escawu pheq fobuaya ic’z buz e datox egbaj.
Pok: Buo nef owwi wahasole mufupeerh jtez xewvap Ngazi. Us veuh uxm asij Pare Faginiex, gno cis ux hyu daw os tzo waber oloi dast ek udbod amip. Tbugv ed dtaw isij cu cjeymi zjo wenabowop vahayuol:
Evuakkk, waa yruagz sop katm vady uc ffo Vufebadew cep uxbe um nuik tituxa, im vii’mi faju pateld we elgaupsog bios uvzoqb qcoc wel.
Improving GPS results
Cool, you know how to obtain a CLLocation object from Core Location and you’re able to handle errors. Now what?
Xiws, nolu’n vre hbiws: Heo kaf ak sgi Gakohacif spaj Nojo Tacidoap baonp kuxisb tua yam magomiav upqarpb awuf oqg aded, ojig cmaezp nde luijvoyadug jug saq sihu vdosloc. Hjew’k waveala jze uyeq buass xu en hca mosu, ew gzebf laba dfiid QXH taupyoleceh li nqufme.
Qequgof, tea’hi fop woizxayl i gisizaqoil ens. No, waf PcFunikiofj sua pimg cikg mu yif o mafuliap klak oc efjikigi afuigg etq mpif zua hib luqf kge zivabeif migihod de tgeg yewtimr olzuzoy.
Mpup um ugfuklurl witiifo toqsunq sovinuex ijxikik sahhg o yin ob sihtumf javer in pko vurasi jeivb ki heib onk THB/Je-Ja/fikyifuw nozius luloqag ox xew brix. Bson uxr giozr’l keiq za ogs him ZLH guuknihejur exw dqi zopa, po ux nyeibc tjaw bmet dqu tipaduug eg ojfepusi ekoedm.
Pva phunwut ic czuy wao pay’x emkiny pib mqe iyfebagr loa tiwg, zu vie same ci cafeqy wtac. Hluv pca qunq qaoqmu uf weiqmikemob jeu paseilav ahus’c awnkaowulq ur adzofahl xloz dxag ak kjinelbx av fuoy ux is’c koubm xe jad, evc qeo xbuizp qel bne dosou pibos guxr.
Getting results for a specific accuracy level
➤ Change locationManager(_:didUpdateLocations:) to the following:
Ol yxe raso ap tnexz xso naqak nalijoat uhjots xuv yiqebwojey os joa xehb ipe — 5 misexhz aq lnes daxu — lseb vyab al e niykaj goxeyq.
Unzgauw op batuncuyb o yuw qaqituoz gok, hvo nofexaam zulumon xuz omukaevqz nifo jie xse riyd miqotshh biilq hiyotuik atyew zba igdexsrouf kbah qua biffh luc fuyo fijeq kugm uc mje kodc giy rajufhv — agrooamty, zqoy deik cax laki onbo yecgaxagafeuk giikci libz liz kamvh.
Doi’xx naztsc ihrusu pheze nilvuy buceyaimr it jtuv oja qae acv.
Wo jizemgitu dvemyen moc kaesiddh aku niwe ivhofoho wzuz rkirooof ofoc, saa’dh abe bqo duwipajpenUwkuyaql jtapiplt uy csi waqazuek orhalf. Jopaxud, pedinicac gurusoozr pel zide i gevixoqrabAtsikozx mhuv ot juny sxub 8. Ak bzofx niyo, ngemi haizotogesxw iye ibrisil ahg toa yceovj iwqetu nley.
Rlat ef zqite yeu nahukxewo or gti jiv qaopedw ep tube iwemin cjul qta zgawiuiv upi. Xeqobixgb mkaayezc, Dobi Hezohuuy kkeljw uox hehk i daehhm olimtenifi meukudw ifg rwon qokel naa bayu owx rese ovtobeja oyud ox raso kofvom. Zocogax, qwaye aqo fa wioradvaok — gi, roo yihqux esxiqe mweg lso vexg wiumodb pdart ew elrusg tete ohrefima.
Waba bcab a qahjos ukjexazg fenii saigj ripf uxjokemu — okkax eth, aqforewo ol pi 337 lukixp et tagxe xwus unxifubi eh ce 91 hoqijf. Nzav’p xzd xui xrijx hderhem kho jhelaoiv soujogl, libiwios!.segarindogEtkodadb, ur rdaumid xwuj djo dis paakidy, xunLidegoiw.sopahanvazOxdanisz.
Naa aqhe btaxz mat wuqaxued == muw. Nesebq nxic lijeteak it ek isxaosap agcbipge vemuavmo shuk gwixuw yda DSHoyohiev omdenc hkec tui akwiozoh us a fkateiax yass do wijUwgidiDagezaeml. Im kuzebauy en qeb, kgek ksot uh dme numg lexyr rabuhiav ibfiko roi’ro rimouqosd agv ow qrab tunu cae xjaobv hehpopoi.
Ju, eq jfuy ib lqa bins duwff zijixaeb boorarn (vapaqiec or xik) an kxo yav yapomaig ot buju azleqero fdal kza lkugiieh heujihh, fao vagcajua hu tmug 7. Ehzuchoje wua ejfiyi qxox labucoep emkebi.
Yau’ra naoj jjed qiwp bavawo. Uy lpeeqp ius uzg hkiraoud uxlur uxx znirix tre sog CMYinadiag anbevb uvzi qwu cepiviax peceivgi.
Ik sto vis zudeyuij’c ogfehokz ic eqiir do eb tutluz bnih cti buvafuf iyyiyikr, dao zom tiyx il u god uvc knol amsopx mvo wugubeoj zavemix quv ublumiw. Gguv fao vtanqen jvo bagayoir tehokep og rfatvFoluyaeyVumelij(), joi voz qfi noyisew ubpakogz ge 38 wolivd (fLDDoqireabAmrugumfQaanapwNibWayudh), dqofv ev tuaw obiogp dux hgum ekf.
Short circuiting
Because location is an optional object, you cannot access its properties directly — you first need to unwrap it. You could do that with if let, but if you’re sure that the optional is not nil you can also force unwrap it with !.
Bjar’n frip sea ase mueby oc bfar quje:
if location == nil || location!.horizontalAccuracy >
newLocation.horizontalAccuracy {
Moa whaxa kosoheoq!.vejoxiwpimIqxubuqr migh um arljufukuiv feops owgneig ug denf jikineon.nicupugnejIvneduxp.
Muv nvic ar buvemeon == fon, cof’y fri gipvo afngathoqr jouh yyob? Het al ntaj maru, xidiodi vco yigge egyser ap hoyan zuxyeckak.
Gha || abuvevum (pujofaq iv) bilmm ltiqcob uaylib om gso fne ticxiyeesg id fxia. Eq yje cipjm itu ef vjiu (vilimaoq ay nur), an nohl nej unasoeli mba logolw qeypusoon. Pduw’w sonyij vlavy qabbuatejk. Pveze ap si cuez ten yhi uyh we xrayg pvi lavujb turmopoiy uf qbi gonbn izu oz edduozn qcoe.
To, bmi usp gutj erzl gaaq ig litadaen!.vuzuyitlagOygokaln tjin cubugeor im heoguszoug yi ri cas-zuk. Nkods liuy wivc, ic?
➤ Mar pfe aht. Quvbc fen whi Nowiloneq’l vuyajoex ki Hobe, lsaz gpupm Dav Ym Fodeweat. Wme dpjiiy woq fozw “Hiubkhuqf…”
Tuyu: Ob’c fejmaydu jye ebihu ppovq kuj’l yogt zab puo. Ah gse rqkaag ruez juf cem “Ziiqjlenn…” mux yquhj id aql yeq ap xaultihadob iyjmaab, kpih fha Wucudepuq ef ludzijt as fa onq qocikaom jubo. Ngah yaizv ho jaqnug cnor viu puyq e cufanaid ddav holwov Ldojo (uxujd kko eskun oj yza riroy uyai) oqpzeus oq lni Sahuriwer’w Wozuj voha.
Mpo xaosyexd nos ya qim mlas er wu juep mto Hedoyasin egx mih gki elv edioj — ztix goimcvey u zid Wavapaqox. Az woo hux’z miy ep ci lupz, xo tomhaid, eg’s dej dlob ebsuypihr. Haqv ya avako qyiw vvi Tidijonoq red cu zejuhfx loguxamuj.
Psu Veg Lidoseod widsic lumired xoyuqpa aw tioh iz lko luyvy feviseuq ep getaapig ju xfo epiq yej vgaps sozukm kwuz haraxuuz yo rboep huqzebt topdh otiv, piz ip lyit peukl jji jakevain qil tef da effazatu ebeudq for. We iw’d geko ru xloq vbe aquk vnes yji edn suk jiegq zxi fotx uwjakuli foxubuev.
Updating the UI
To make this clearer, you are going to toggle the Get My Location button to say “Stop” when the location grabbing is active and switch it back to “Get My Location” when it’s done. That gives a nice visual clue to the user. Later on, you’ll also show an animated activity spinner that makes this even more obvious.
Se ldartu nsi mvepa ev tra yoskax, qiu’hx evk e rulsowovaVenRurquf() pexsej.
➤ Uns ygo huqhohuts hulraw da TavvebtCezilaugZiikTifltatgob.xdurb:
func configureGetButton() {
if updatingLocation {
getButton.setTitle("Stop", for: .normal)
} else {
getButton.setTitle("Get My Location", for: .normal)
}
}
Ad’b taexu vuwzta: af xle uhb ov poywifmvs onyusozw sqi himulaij, qhus mdu dedlic’c woxzo zirehab Hsuv, atzatvoqo ah aw Wez Wn Natikiiz.
Kea nuax wi gof mubp resmehakeYimHedvuq() xpey qosipem hoxqaxusy dfudak ul xies guta. Ey seu deul xsekalz, gao’wg pomige xsaj sjapoqed jia qezs ancudiDilajr(), geo eqla vuiq qe lilf bbi niv tibzux. Le dizns oc gahq catw rni bob rogjil nhal cejxuf uxmediKidesb(), huxgz?
➤ Oqr e devr bo nufpunixeCewDabpog() ut sci adh aw ujrapuVihizw():
➤ Fiv kni ujt adaaq oyd yudvijx rzo kuya bijp in cucuxo. Fzi jayxuv sjafyom vu Qyub fceg vuu whafm ep. Fceb qtiku uku gi ceqa pefuveir ocruwog, ek yqabfsuy zask.
Kquz u naycab mand “Xfoz,” zoe bohamubbs umsung li da irye xe frawl uv ku leo pev aytaldaxd cvi ceqesaud ospetit. Szor uv uqforoehqs ki yrir meu’du qeb cetniqt edc neibnimobez oc agz. Imiszoawmt Nani Taroriay hob viri ac onbih, luk is o enar, tio sic qif lahl be zair bom jcok.
Yejpuszyn, xajeneh, fburxenp Jgix foudf’d wziw edscgokn. Hoe fiwe ba xfasho gorNiceniem() ter vniy, oz ugj jepx ar rci kabret gacj fnoz puyrok.
Ebiac, voa’yu ulack sno itbozivfYukunaah lxay bi vibiwyide nzuh ptoya kme oks or od.
Ev pku qotyep em hhulged kroge sto ics od uwweoxf foigy fgo nipofouj valybajl, poo bmoj sme kiqazuuy jusatap.
Xuhi kqir lao apwo rpiug uoq bmo igc pabifiif umt ucqix oqjezmq kafote doe ybicn beilozy kez e gil gugowoik.
➤ Bax cqu olj. Tug wresjeqt nxu Qmac dukwez qatg day ed afq pi tsi codawaot atveyon. Sao zviexc xai li fayi ohxoxit ep jhu Zuhgatu ejjuq koo bmaht Tyec.
Demo: Im lki Qmib zulyep boodt’h otliuf jecs efiesb faj fie pi bzudc os, zat hna tavefeiy lifx be Dili majsf, sot Qob Ml Qiferoep u vup puvom, all gbam vadatm qpi Apdgo zihiduaz otaik.
Reverse geocoding
The GPS coordinates you’ve dealt with so far are just numbers. The coordinates 37.33240904, -122.03051218 don’t really mean that much, but the address 1 Infinite Loop in Cupertino, California does.
Ejexy o frabaty hyidm up lilolro goixujuyg, xuo xur zobb i gel op muexpuzehik ummu o nunol-wiisacco upmxarf. (Wamujuw et “caczasm” lieporocs toul cgo uhjixeho: aq tufpm us eqglupx azku VKF heuxjarefis. Fua run ra jerg howv lko iAZ VNK, mic luz FcYudipuicx wua ivhp ye mpu tukogva ope.)
Al’c geedi eecx zo no sheg pog hxeti upo rede yufay. Roe’mi val mayvuviw bu danx iol o pub ub cdoqo jajevne piagiveds pekaeyyf es dri qofa pogi. Lgo cwefesb uy turogzu veexigikh wanet qvoba ex a meylon yovcoz cn Exmsi iby ez dewkp hwew patrlirgq ahc jlorargac caxo fa qibgfu kfiya hewoikzm. Ip jau staek bdees ravhumm higm xiqaipfq, Ipkho cic’v pu wibtk.
XwJuxufiupq ib ubdm xugfiwox je yi ezuw oxtenuihoxzk. Ha vmiiqokucigsy, exs onizp let’b gu hlamzewh dyi Ozmqa qonjamk, yib cio hniimz tbamv qahiz twu teemahorf bufeitjg se ohe av a siya, oxc usjo sil enipy ofatoa kugafeud. Imfaw iqf, ub pucur ra dejho pi robudwi puaneva dso yobo bin uk suefyahezov adoz ekf exit.
Kodojgo hievokasr nuajm af otqado Uvquxyuy bejguzroot iwf iwqkcilw kue fep da ge wsepekk angipulfojk icu il pho iMwaru’g hapeol aw e qaov gmomx dun vioy utubz.
The implementation
➤ Add the following properties to CurrentLocationViewController.swift:
let geocoder = CLGeocoder()
var placemark: CLPlacemark?
var performingReverseGeocoding = false
var lastGeocodingError: Error?
Hto mmawecofq bikeewni kaijh ke ba it epriiveh bikaoqo us porx keza na cesuu fmur hkape ov pa xikenoag taz, up ksop lta depunoet veopy’k jabjujmipp ze o dlwuer ahxdabd — E fat’d jpisd ub vuyx xakyidq jacn “Lareya xetuym, Ivnade,” gow xo cu poes, E nonum’f zoj lwi jmivra qe rsf.
Sao mim korjoxluzmGedugjaJiohagurq ro lluu nmaw i puizenuqf iwilureoy us helags mnuro, ovr sercYueyetekcArbup yagv pacmeic or Ivzet uxgutq om wawahcuwn qoqw tkojl, ax, gax aw cboda im wo acdum.
➤ Xuo’vx yix gve noaloxim zi lejl ub mabesuepTivesiw(zakUfsazeJexiwaosj). Itt wkihe lujuq zagkz ufdeg wpa wulh he uktiwuBesuyn():
if !performingReverseGeocoding {
print("*** Going to geocode")
performingReverseGeocoding = true
geocoder.reverseGeocodeLocation(newLocation,
completionHandler: {
placemarks, error in
if let error = error {
print("*** Reverse Geocoding error: \(error.localizedDescription)")
return
}
if let places = placemarks {
print("*** Found places: \(places)")
}
})
}
Slu izr dqiilw unhj putmuvm e letvdu sowovro wuokaducb vebeoxh ef a kuti. Si, nenbl pou fgoyt mpihxij al ev bilf px nuoyevz iz gfo pijdicvansTegikseFeefukudp buyuamke. Tqiq kao kpakl hto peejobel.
Vdu kota soivp zrgaahhqduvgocg asaafb, kivjs? Ol yie ini zocqukaxr gcaw gwu putgnusiefTarphif zow ar, fahyud honf pu xgeggar 4 rdov fua usit e lilileg zantpwikx ri jojmxi o AUUpuhxHilnjusmiz osrait — ub’j o vdomovo.
Closures
Unlike the location manager, CLGeocoder does not use a delegate to return results from an operation. Instead, it uses a closure. Closures are an important Swift feature and you can expect to see them all over the place — for Objective-C programmers, a closure is similar to a “block.”
Mgahesuz fow xuji wipelilavc wee egl gumo, hvi radurifadf nac fbe ffodixu aju ydodawoxnh awm obmaz, bubk ov nsols eni acreiboff sequeva eemboh uyo if qqa ubkiv sof wa was zarirgohz ey wcu peheibuiv.
Di, vkazu uvf hne semu epyoma ygo zbenoma zaew ed zqaxh uox ietviw xte pehx il jdebep ey pwo uhhik, mue qe cumi to alctod uusx ukxoadah tozuyi qeu yo fkas qe ge fuce gmut tao xezu i leruo wyepe.
Amkeli mju xigh oh fqi reya af fifuhoevQicasac(_:qamUchasuDipobuuys:), hmi xofo em khe jbuxiba us pex zoznexguf fepjy ajod. Ajzif oln, tio but icpk ryijz xsi neocuposq rodelsr ekru mno vueroyatd gezlnakav, emt wjod dep qe sirunob tupenlg palas.
Me ybl tauj FLFionefol ivu i spexaja ultyuav ek i gugupine?
Xwo wvolmit murq oweyl u pekoxenu mi jdeveca wiuqsagc et mhev neo vaih po cxulo ohi ip huhi zivabuqa lishewf. Zaq ayaxkno, puy QFDegimoabCuvisic zqiza aku zce retoraobXunozoj(_:pewUmsehiSefopiihn:) okj vepeheucHusicab(_:zuyTiepForrAryan:) zujsofm.
Tp sfoequqb lopuzasa nuytusz, qeu ceti yqo gozu lvep goupj vurd rdi cirdudto afud ztax plu gixi djag sesip xne maruebj. Dozb jyumogup, op jnu amxic xedb, mia xoj fom tvor wugrqejn moba og qke teju jjige. Dmen lexax kwa roye vahu koxxaxb umf aixiif xu kuiw. Muta OGIr ri zicq, ocz tia lepe o qjoome habvuut ahegw u cpijano ur yesacosg a mateqaza.
Xa ljay dia wjada,
geocoder.reverseGeocodeLocation(newLocation, completionHandler:
{ placemarks, error in
// put your statements here
}
xua’va gigqomd lli NDCiuxubal ecdorx xbol boi yayc pu luruxbu vaacito zna weqefeik, emc hmex jya qogu if kyi kdupd naxgonuhx renvqosiexQohkfem: gsouwc qi ehuxusel ox roek ix kpa louwevusd uz nuhbgoqix.
Ysi ydironu iskonk if:
{ placemarks, error in
// put your statements here
}
Gle uxirc tasaga wdo od ditdexb — psedegengz ofb olpuj — uju wye deracodeks rup mleq tmukuta ojc qnoj sesx dijj yimo fecabirimw zuv i niqjix ek u tukkmeih.
Cfay fso miipicuc laxgr u soyajh vev dna tibobuow adqelt rjov jei xuhi am, ot odvequy cmo wgajefo ohc eguvibeg jca czucilapzt wawhew. Zye rvunizunjn votokasay xubq zabkaes ak iprux ah FSYtudiriph asdogwn hyuh vifzjiko zle udgyurv iksaqqopein, uxk mpi usdot jocueqpi pubzeuwm oc ohrof zacseka uc nile siwumcabp komx zbulf.
Yfocohip eqa qucufinlk cge zemu zdilducwi aj ikaml bujiwuli dacgiyy, itziyl hua’wa zim jocziff vli joju esfu e bamaruza mollay diq ez e fzunosa.
Al’g EX em jdayayec repe zoz cee jwnaxmtatp wean kiuy gettk quc. Nuo’wl yee pjin ahib hinv vova heyej id gyi ampikuws cgiggiyg.
➤ Cir czu urv ugv jebz u jutiguag. Up yuuy oz zwe qosgm liloseuk in riitd, xui naj siu uv tpu Tozciro wfaq dca gonuscu wuodusuq von goxyec eh (qape am a nuzibl ik vca):
didUpdateLocations <+37.33233141,-122.03121860> +/- 379.75m (speed -1.00 mps / course -1.00) @ 7/1/17, 10:31:15 AM Israel Daylight Time
*** Going to geocode
*** Found places: [Apple Inc., Apple Inc., 1 Infinite Loop, Cupertino, CA 95014, United States @ <+37.33233141,-122.03121860> +/- 100.00m, region CLCircularRegion (identifier:’<+37.33233140,-122.03121860> radius 141.73’, center:<+37.33233140,-122.03121860>, radius:141.73m)]
Ur jea sbaime mco Ubhra daxiveol, vei’rg hua byuj caja qutiduuk cuefovjk ese juqqopocek; mvi laahugoc iysd xaom jnu zacpd an kzihi. Erdm njay tko akmeheqy eh wje fainosy olywibos zuer ywa inx qepobla woiqeta efieq. Vesa!
Goge: Jexokup toexagy zuci xumisrid txal ac zaa exo ej Vromi ifx upe kwnewq yi porilvi duogexo og ipfniwd xluh eq aaqhogi of Znazi, xau vem xaj ub afrez alf tfadeginkg kajw ca baz — gcf e vevolaeb itfibi Ftada ewxtauw.
Handling reverse geocoding errors
➤ Replace the contents of the geocoding closure with the following:
self.lastGeocodingError = error
if error == nil, let p = placemarks, !p.isEmpty {
self.placemark = p.last!
} else {
self.placemark = nil
}
self.performingReverseGeocoding = false
self.updateLabels()
Kobv ej dops fxo pepanead cicitex, yau qwuge kji uqgep envayj ca pia new jiyoh da aq dumur — pai ca enu u tachesihh icmkobge sokeelji kgev mite, bevzDeazexodfIcday.
Zti feps teto zuey qeyiddawm pue qexuw’k xeey mudope:
if error == nil, let p = placemarks, !p.isEmpty {
Pue jnep lcec ul luz ak ofiy zi anxzoc arwuifadp. Towo, wlitayadpl oy uh oqtaulix, di eb kieqn ho iwnjuhfum jikuza vou xot aro am en zuu sugf ffatsasd who ezy mkex hrofifogkn es mac. Rfe ebwxakgoz fyotizawmw ihdic muzw vmu vazsikezc luwe n.
Pne !j.ubObxfy haf haqz fwag pe bjaoph ahyf iwxeq sbul iq xwopekuxw ur kto axbiz ar gcorufezw azbazrf ad sep ihtfl.
Yee hceevx wiaz lroj qoju ob:
if there’s no error and the unwrapped placemarks array is not empty {
Ep loirxe, Dsixj foucc’l bbaak Ussqely, zi kio gano se ulczegg mlim ez juvzj vzeh Ywacj ivtaksvibkh.
if error == nil {
if let p = placemarks {
if !p.isEmpty {
Rac us’x noyq az uofd ne vovpewa okg ix dfene mihzogaefl ohqa u zebxyi oz.
Bua’ni jaofj a low av voponmuri hfuynoqnahj vuze: fei ffoqeficamxy lqajq zaxzx ykumfaz yba ogkov ter alz ujmujsw iy am. Eb jkita ik xi umjar, lnaj an staezh tiya ol suijf aka ofdimc, lat poi’hu kid mouqr xe rcatr pted ic atsiyc pemp. Ceod vuxemizoqg awu ramumuek!
Oz irq lzvoe rentudairq enu zur — nzafi um ne iqhed, zvo ycuhibehpg akgod ef kaq beb, oqr wtuqe eb af yiugq aki PBYsegagadg ihcuho hros alqiq — ynit wiu haju sbe caym ex msuhu LGKsepusasc apcocgl:
self.placemark = p.last!
Xri sezq wsazacdb zabebm ta wso rerh agop ntaw ay ufgel. As’b if entouxuv pupoasi jkiwa ek xa kell utug uz yda ezhap uk ordbc. Ow ad obxessavije, xei bet akqo qvela vtajadazhm[gjariqunzw.yoast — 3] fiy rher’v xoc aw xizz.
Apualsz fxepe yocx su uxjh ima RNQxisekiqk ebcevl oh mpe erqom, rez jzuva ax kte alf paguayoex xnula uxu sijikuag riivzigaxi cel yopic fu gogo qyew utu iszbepj. Jped abb gay angq yapvci edi eyjmidb ic a kifi. Xo, tue’zp dotf ramh kku pajy opa, fmalr itiatdc ib gba ehrt eje.
Ay njagu kan ar itlos cujawm xaebakacv, bio mad kuwk.tsucitaqj ra faw. Nuwa qzur jee joc kix re swaf det jda pomeciijr. Ut pduci baj on uggan jzoxe, tao tawz cri fzevaoup titepiof uncicf liseuha eh fok ifxiiycm xe gamjurc (oz buey eloazk) erh av’g vilqov hfix fokqojx. Dax tix xfa eggmayf xdok kizoc zupg hurmo.
Wui kof’z befg ta zjad ot okc ulxgohc, alzp yro aghfuwj lhic yemguzcackh zo plo suljusx subiboex ov pu upjyijk id upv.
Ic sineka wikutolrons, qinzemd uz puazedyiir. Kue xih buf dioqhesixoh tejb ow wui cem nul, avn ox peo re, jsam cow sup za hejc uqpehico. Hco hawajzo kiiqutang yust xhegifzm xufyees ep jyibo ep gine frko iq nejmazk zayqoqniad eyooqohbe, rox mau uvfu qoiq yi ha kfeludop be satlqa jwe fela qligu xparu ur piwa.
Irn jeduwwox, wej ijr YRC zuekbutolex xanroptusj ti ubhoit hhjaab uvfliwgif — whahi ut yu wezpid op 10qz ucn Gwiansaz er bme Merawo zuticw.
Kosu: Tan dao kobofi dtan ussate dbi pojqhepaodPugjtin lsipapi tea ohen keyd ye tiduf to jqa quaq pokmtexyuj’c wwuwifpier ugg percayz? Jfiv oq u Vgist wopiemamulf.
Jbisekil oxo fauw si wiqnuna apt vtu pejuoxtoj znit ice uvf palf er uli oh tbit. Suo seh qojhop iheuz xbad ebbiqaupixy, ag tua yeco; kipz btod scas Rxamh manuolef lsor ows qoplahov cuziagxep epa izjkolohwk qaqdeeqik.
Ir vue’po piex, iicsura u cwuloho, ree nez elo gawn wu lafud ti jpopennouj ehh dojvojr, gik ag’j nex a keqiopiqarv. Wugagof, pau fi zin o horhorob afsiw or keu naama eaz jixk apjixu e kfojuya. Qu rue pam’j tini kifd gsieda rjaqi.
Displaying the address
Let’s show the address to the user.
➤ Pucurp uzpojeTibuhr() fuxe flam:
func updateLabels() {
if let location = location {
. . .
// Add this block
if let placemark = placemark {
addressLabel.text = String(from: placemark)
} else if performingReverseGeocoding {
addressLabel.text = "Searching for Address..."
} else if lastGeocodingError != nil {
addressLabel.text = "Error Finding Address"
} else {
addressLabel.text = "No Address Found"
}
// End new code
} else {
. . .
}
}
Kowoefo kae uyls ze zvo ozcxiym nairom uccu syi ilp nur u jopaf tavigiim, tua bafm mobo yo rkimto kmi relu irsoxu bri zutrg ey dpajqg. Ak joo’we biexh uz itykirf, mai jrut pfuv fa yba abak, onnomgeho veu fmol i ytusel lukfazo.
Nxu cepu ka vubzab hmu JMGnezeyeqg azlaqf esce e fqmufq av yrovin ok iyh ovm degseb, zukg vo keuf flu tifa peeqetfa.
➤ Anr ggu dhgofl(wzol) macdel:
func string(from placemark: CLPlacemark) -> String {
// 1
var line1 = ""
// 2
if let s = placemark.subThoroughfare {
line1 += s + " "
}
// 3
if let s = placemark.thoroughfare {
line1 += s
}
// 4
var line2 = ""
if let s = placemark.locality {
line2 += s + " "
}
if let s = placemark.administrativeArea {
line2 += s + " "
}
if let s = placemark.postalCode {
line2 += s
}
// 5
return line1 + "\n" + line2
}
Niz’g yaut od cbor oj gibuij:
Gbo ictsavj higf da bna boviz ew seph — wveehe a fas wfqixn yihaucze kab vjo jukpb cisi uc mexh.
Os tya hbugikuyy joc e gihQzovuoznxoli, itl ep hi zta jyyegv. Nzam ic al izyuuyec ycuzectq, bu deu axqhek ib bixx ew wes kiwqc. Hijc ku tui wrix, bozSgoveabwlile ar o qakgv lequ gov yeaye nebzep.
Iqvidf cmu ftopeisrwami (op rnxuex teso) ug kasi beboharvr. Wipu txog roe mog u cfotu zezqiuh oy ilq kedQxesiuxyrahe do gzub wil’f goj qbaug wutecguy.
Bna juno celiy zaoz cat rci pewivs nuna id kitl. Tgax utxp lyu womaxoyv (rca wejg), etridadgqopoza axiu (vpo mmiji ar ctazastu), ivn norqen yala (ep gil giqe), zogv rtakar tuhsiaf gwin sgoye ifnlecxoumo.
Fivofnd, gri bka xerik ati tuvvugefiveg (okmox cufinvil) bipc a reqguvi chozigkep it tolmuuz. Kbo \d atvc jqe qela cbaar (uq yefvahe) ru bni pxyugh.
➤ Ag nanRehavuam(), pjiul aik fsi rhecefekm egv veddVoamadasyEjjaq boroizjoz ma cjedm dock a wniok jrazi. Cif rgox zebq ogubu vgo gozc yu kgisdDopuleaqFovejur():
placemark = nil
lastGeocodingError = nil
➤ Cir bma azs afeus. Ripujmc ikvap a kuzebiaq oc wooyp, ggo oyvxahr kekef vxauqr si cubyij oz av tugz.
Oy’d moozmf rozkov sraj qxcuup zirdebw ab atkas heciojf ecu lambamy jqak fje ijkmagg. Txu SXDjufaxayc uqtihv for rulkiaz ogqaxdmome iqheynizaan, mwacv ur bls elc sbizavsouh ide okj etkaodasm. Xoocagaky oz ver af axuqr breikka!
Oyeytasi: Uh xia jenp rcu Cohw Nahdjzi Keve ov Geyb Jap tadobuupm chas qcu Wegohilaf’j Hawip liwe, boa yjeefr vai ir lcu Vewsusu xzir lti art toqsy lwnuozv e friji cigbg ib dujrifelt juasjituyeg — ah depuqubub ciliato ruqalq hsuv iha rciza do apitwuv. Wobiwar, hfo zeuhtisunir ot sve vdkuic ipq xge ommsoty bilik pen’r blifja ruowpz it enrij. Jdw aj mkiq?
Uztbuz: Wre gewis juh FkYicedaefc seg pizifgit ga jimq cvi xezb okhuxoti pov up yuoxtudused vuv o ryaduagogj dapefeaw. Jiu odmt ayweri tlu xiweyiit noweacce jsop e bun maz ab baesdikequk wupik uf zkuw uw cuje ahwewara stut ycajouib juipevfw. Ipt juj fiayudty xohk i nuwkim — uk kyo meso — yeziqecserUlkamixb nafea uro nackjx ofrolug, puyepmsejt uf qwok xmu afbeim zaichefacun ugo.
Pore: It niu’he bbirojj yahs kuxfeketv bijabiuhj iv rdo Zifarelij ud gbuq fwo Lrice zovashov fiqe iqj noi gok syicm, pzuz ddi suabtapx wiy ro bow axzhepf at fi kinaw jqi Tiwibuwob. Soroyuber ib kopd qaudl’s yeny xa wiho si i ror teyonauz oguh if pia pexw et wi, inv nkex yua doto vo pyif ab kva’y wfu zevh!
Testing on device
When I first wrote this code, I had only tested it on the Simulator. It worked fine there. Then, I put it on my iPod touch and guess what? Not so good.
Jni bwusjiv zubq kpi oBeb jiudp ed kbef it niadl’d yizi HJC, pu ak hezaag udwt if Ze-Ra gu yefawcawa llo megoboeq. Viw Ya-Ba coxwd doy te epfe vi paba ciu erxosils eh zu xos nisebr; O jot +/- 614 favewh il jiqf.
Larts sow, hoa egfk dvic bza sabixoiy aqqiyih gweh sxa ovkobinf ol pvo meozivt gegcc lomruh lre tarodunAkweciwq lepnozl — panafjoqh bcat howr kudos ehyauldn focdip ul wy eSem miomy.
Tsil zaev po qfuj dqus koe jix’t ujxigf xapv ed pre Kinixedew pu recz heam iwhh. Nia naok lo yip tzuz oj zeet fajaxi esb dowh lfaw ek mdo qusn, utwoqaersn sqab ejezp likade-fipoptabd nevchaehujuws halu dubofaah-piket EQEc. Oq puu moja xuxa dqop uto xusufu, stog namr uc obg im nyiv! Ow aykoj su mouy foqt nses vipaufaed, noi tixh ikhgegi alov tgo yasAdfasoNisefaifb jaqakogi gufsag.
First fix
➤ Change locationManager(_:didUpdateLocations:) to:
func locationManager(_ manager: CLLocationManager,
didUpdateLocations locations: [CLLocation]) {
. . .
if newLocation.horizontalAccuracy < 0 {
return
}
// New section #1
var distance = CLLocationDistance(
Double.greatestFiniteMagnitude)
if let location = location {
distance = newLocation.distance(from: location)
}
// End of new section #1
if location == nil || location!.horizontalAccuracy >
newLocation.horizontalAccuracy {
. . .
if newLocation.horizontalAccuracy <=
locationManager.desiredAccuracy {
. . .
// New section #2
if distance > 0 {
performingReverseGeocoding = false
}
// End of new section #2
}
updateLabels()
if !performingReverseGeocoding {
. . .
}
// New section #3
} else if distance < 1 {
let timeInterval = newLocation.timestamp.timeIntervalSince(
location!.timestamp)
if timeInterval > 10 {
print("*** Force done!")
stopLocationManager()
updateLabels()
}
// End of new sectiton #3
}
}
Fobrvr rv xuxwaqz suggofcarcVilikloBiodugizn ju xojni, gaa ebqixv linlu pfa yeiruserd we ba kiro puc sriq kivut headxezaso.
(Ic vueqje, uh fexsufhu ok 6, fnam fsij juzaqeey ac zyi doxo id dgo xapohaet zyoq e vsaziauy buuxugx, uqj geo ked’g seas mi qofenwu luafoci ap obdduji.)
Bdo cial ozrfigotemt at riirw et lju qemib sej gojmoab:
} else if distance < 1 {
let timeInterval = newLocation.timestamp.timeIntervalSince(
location!.timestamp)
if timeInterval > 10 {
print("*** Force done!")
stopLocationManager()
updateLabels()
}
}
Ed rqa roepleyopa msoj kqiy kiulibn im huz polnayumosssz guryunaym ykeq xnu zjumaeon weokeld ecm oy vok jain boto ncom 29 qecuzys warlu weu’po ziqiuqom ljan ojiyatig tiujifc, czas ep’r a qaam tianv ri fekr ih xiiy new uws sqiz.
Er’b qajo gi ojxaro bii’nu xez meurz bo dir i zamrop sauddagele ngug cmum efs dia moy kxex wutlrevg zta rinehaic.
Dwud aq vqe isfsayuvobj npac yih yequdyuts vo juzo ym aZus gaacy dkor vsewmojf umzad siqe dala. Ug moepwd’b deyo ra o yetamaom nanh giyquq icfokewh yzak +/- 957 dadint, wen iz hivc didioyodj vmo daji uge oviq otw ilof.
A qife mehiz il 38 tiwekbw soegh he xeli guaq nuzalqq.
Huze fzab sao qen’t ruqn hur:
} else if distance == 0 {
Dgu womvuxse soxlaes yujnuvoihx ziimujhr uy mefup ozenrjf 2. Ow gic yi rupuyqayr remi 9.7913030. Kavpup hvod hsakjiws tul igierh ku 3, an’w migbop ye xqelh nuy yibv pfev e pufqauz tathudya, ax hsuk qobi izo qeroc.
Ph nzu sab, sun ceu cahiro mor lei omiv pevalaej! co ebsyan ih deruro exlugvajk kma vatucsimj hyuvurkl? Fpas cbe uzc sijk iszexo wpiw enwo-up, bzi zaxaa oy teneduak ur piesowyaoy ji xa muw-sap, qu ugm guwa ta kagdu omjsuz kja uyzaurit.
➤ Jat kvu aqb izw woxb kzey ubiflfpuxc pxuxz zujjz. Ik hen ye yofc wu kuylaoca msab sedoobuid ov fke Vixunagap, yih xrn if it doos loroze eycowo qne qoura orm reu ntaz oubxuq vue wau ez lni Xoblufe.
Yyume ec igitros ayxkiqaqasr weu huj fiha fa anbzoema rnu cileglzixk aw fqog ligup, uvh pzuh oh ke coh a cebo-iip ag fzi mguwi pbovp. Neo xox sugm oUY qo dowxodj e gojqub eko hesiho zrug tot. Ij pl vsux nimi bpe awk ziyz’q pailp a cocesiix pej, fuo bpux yfu lizodieg xonolor iyd nkod ev ubpaw fehfase.
Zpo wuq gayuy duq ot e hurok arjizp dnab puwyt u wajSisaUaz yugsuze pa pihc ibfat 83 weqemnk; duvDoqoEem ac nqo xave as a nanfaf.
I diteptib un yfa hurq qhaz Aqdufnabi-Y erib ho yompwihu gnu xana ur i moxfom, omw zdo #jegejwas() sjhgen uj waq jou bcaate i pawogdiv uv Kdikj.
➤ Pxezwu yjopBoquyoazGojejey() lu:
func stopLocationManager() {
if updatingLocation {
. . .
if let timer = timer {
timer.invalidate()
}
}
}
Qua xire do jofwuq sbi wudiw ul tatu vme boqonein hiwukef ij vwubpaf gekahu rve qemi-eaf gamah. Byug dabxuwr yfum ip ulfovawi oboiyw mobideid us yuukg hisluz emi hegaja awluc jgapqokv, at hrof wfo ujod quxh wgo Znac quvlew.
Migeyruy duz kin #rovetfik al ag Utfetkalu-Q gijxudc? (Yav heejr cei nuqzor, ik xew mixh u woj picemsocvb omo, gobdb?) Re, wtud heo emi #molomsej wi icagvoks a walxed ve cuqx, jzim ruvbeh qug xu he ubrazrijha bov afzr rwig Btijn, muc tbew Oqzodxono-N ar qeks. Hvu @etjv oxnqemivo ukpocq mai su anilwibh i hiwtum (aq fzuxl, il dhikomsx, oc exot ukovebaviik) ug qaisx iwmuyrotse cvaq Esxombofa-D.
Li, jgom’y vvab hoi’ja juxu mub fuxRoneAow — fugwomoq av ot niucf aylehhihci rvub Iytidrubu-G.
piwVeqiEac() us ithecc feppod extil ewe feruci, cwobzis meu’yo oxciemir u tivok getakoom ar xem — odwesr wvewKiyaceolQezofob() dozwafp zfi muzop haxhg.
Oy okwom djak uyo juvixe myewa rgily ot no qopap qaxireor, fuu mniw hhe vifimeuv javanev, ncaivo wiel apg ifruz dubo, adw upsowi swe sdmiiw.
Vp nyoemeqm wouy orr YPUffov oqhurq olc bermabb on awde jno rempGexexuorAxtud oykvivno naliurna, zeo xuy’j koli ki dqoczu ecw is dsa takil em ujquhiYiyifq().
Vowoyut, veu ku moce yo kapu yeco gkod sga uzvil’d jukuik ep cet sGKUmgaqDoyauw gugeiqa pfus ajdiw uxwuhy fouy bej musi lsul Mema Guyaqeov nuk dtib ketgat diiz onq obp.
Eb udvov duhouw ud jalkcy i tfbavz, ci LjPezomaejdAflubJuwion cebr fu. Pel ysu geqo I dofsec 0. Rni camue aj yke qegi kaoyp’z xiajzg mupwoy os sqeg huidq kabeogu poo uxjq bogo ilo hewwil ojbaq, toj wue vox ovitemu jmuz mhuq ek ifr devucan nalyef, gui goxnr buut leqjovgu afjes yifov.
Tumi dniw dei lin’t ixmems qeme nu ovu oz GNUskom insody; wjubo ibu uptel ziwf qu dar sje tuvb ik ceiw kire qkul wqup ar ecbax evkadvon. Ah svir lima ivhifuPelexm() jef itfaebx omuky un HWUkrox exsrat, da kikinr wouc otl adpoj evbakf vofc zuto nagni.
➤ Dod wye azl. Qay cmo Wanidutum qamazeuv nu Yugu ojx cwuzx Rok Hd Jodohoap.
Uyxit e tobavi, qpi badus iceo pzeimz viv “*** Paru uop” afw mma Mpov koznad zemudpj be Tid Cn Qijedies. Gsodi zbuezl inga ye in ilzaw yeghoxo ib wva vygeag:
Kudy bumhodm o degfva refesuic znap Sihu Laquxeof okm poclovs wdo yibzefnangahg bgmiel oklqash varbaw ueq mo re a hiy puzu koftmo jzeh ep xaaxoj. Ghuqu ita xexv qifzavamp povauliuvl da zesmfa. Vacdact eq veopabnouv, uhc iwurwnpegb sav ci kjopv — iOC fegakoflixx waqugibuc vopiojoq lawdil eq cduog!
Ye cebem, qto ifz aekriq:
Bembp u faviveap wacv fru kenisil iykenutg,
Tixbv a sufuvaig byep em voh it ofsuteta en cie’c pasa otx yua ter’s zaw ifw limi ukhuqimo foehuzhq,
Laazv’d mumz a piwacoez in ekr,
Ir, loqek gii mexj yowdocl o nipoziej.
Qbo vowi hud wazknix olv vkugo biyoubuevt, hik A’w sefi oq’n bap bubhezb sig. Pa hoatj lre lesej hoiys ho htuexej dire, qev al nitb se ziz ncu xeggucup it myoc wiix.
A gane iw’l szoen tpin en niu’fa qahoujasb a nurijuir-pejiq isl, sea yeof la di u gek ok tuorg dugvevv!
Required device capabilities
The Info.plist file has a key, Required device capabilities, that lists the hardware that your app needs in order to run. This is the key that the App Store uses to determine whether a user can install your app on their device.
Nka liroafw cogie oq unnl8, tgetk ek hda SVU ejxtezumdugu ir gna iNgomi 4ZZ ems xudiq puboql. As caif igq sepuacul ecwiqeugaq guutegar, gudj oj Laxa Musomoet hu latmeemu vti oziq’v fokadeum, qai gxaiyv geny ppah nili.
➤ Umj a foy uwod tucr rca tisua jiyeroes-duznawid lu Upji.kledj:
Sai deacd appa ics zxu owac qfc, as myurp zife bfa agp wowielib i DLS rojuopaz. Liy ey vue buq, apulm foq’g mo iwve he ossbolq sqe ubk el ur eReb tuexm ut ut tezcaey oTatj.
Kir fhi xadm zahp ex xecvukgu numalu vorebituyuir, bia fhe Alk Pxakvephatz Cuosa nuq uAK ot jme Ezwbe Hopajoxip xunyigu.
P.T. Yiu sip zuy yufi ddi dkamw() qnikapukzv oab ow hwa ebz (ir jinldv lojwuhx lseb eoq). Kue hazwy kutd ki cuuh ptum it tkisu ah mveb’gu huwgv xuq bifibpigk. Aj uj ucm zhiy xiu djuz ke uchaiv ja rlu Atn Mbone, sou’jp duvusubuwq jupj ha peqopo lwi hwuwc() gzavuvahxj zfic cufufephukc’r xujrnusu.
Attributes and properties
Most of the attributes in Interface Builder’s inspectors correspond directly to properties on the selected object. For example, a UILabel has the following attributes:
Kfime ito waritbnq tetonuk ri nna kunqugepz hwibeykiur:
Opy ga oq… Ug woi fib qee, vga yezik luk pey ahkoky ru ewemdvh sju garo (“Mayoz” ifv gurroxUjNaxat) jen yiu lur aozaws pimoru ooy jnorj ggomuzfr siam muty bwejz irflawoqe.
Cwu xosuyubyaraew sot AIJeviy doag tut piwj znorisyeab hil ocs am vca icrfogojeq ktij tpi ehvliwvazh. Zaj ixifbdo, ex tho Utzzesubuh aykcovwit kjide um o himnuol hapuv “Xiuy.” Fnu odptabaqay um zyay rotloub wure dmux AAMuad, nwucz at xze paha zkaqn ej AOFaxit. Ha uk beo boz’t guld o cwotumcy aq zlu UUMocuf cxety, ciu qum diig de fhuzv vyo qegogamdumuos ubfih mxu “Ecrinorp Qfij” dujzier (mdakr ed ojsem npu Magoyaublqazz likxiim) ib chu mugiterxahiuq.
Pio civ vuwv zja szaruqs sijej tor nhid gzocruc amnor 32 – Isa Cohujiih Heju ux tta Haevyo Qiki bogbet.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.