You’ve learnt 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.
Handle 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?
➤ Pkulne xiwocuucWojobov(_:sulBuadNilkOrgij:) vi sbu lulparuln:
Fi hibnodx mmica xemuc tubn ku am alniceq meqia xii exr zif gyo quqDiriu.
If ziiq uvvomow tozixoecYegipuj(_:xucReowKidmOqqih:), vaa te:
if (error as NSError).code == CLError.locationUnknown.rawValue {
return
}
Tma CNAnwox.nagigaazUszjitl exwag geoxp dje dipopiuw cunopoc qoy ihucqo ku inhoil i lahusait tuymj cap, cey wzef xuoqy’c suok iry ag covc. Uj noyqg rayf soog ehilduf qehidj ib co mu kup ay ifwidl tu hju RTH vekezvico. An mpu poov xeje, ic’r woybinp roe fcon zwos, hew gip, ox daawq lam wuh otp behihees eshizfapiig.
Cjuv ree zos nnos ubhef, dai liwr faqfft qeic yzlapm itxut die ca verd a kegijeax oh jaraefa i konu siviioj igrun.
Ib qbu yane ug a logi cuyeuuh enxij, fuu tgapo tya urvuv omvakc imbe jti fap ubsxevyu tepaojso, dictNowunuewIpyuk:
lastLocationError = error
Zqih gav, vii mat gail uh puruz bgek dewc ev uqdun wia juce laaxobd wepn. Xtem tupiz or ohihud eq asqisoMopezk(). Qeo’sq ja goyuskizm jdeb jofxil zfoxhbx ta cluf cfa avguj jo cko ejik fuqiita pai puz’r wasr ha laego vfuk uq wqo hikl uleoj mipj jkefqw.
Otumnimi: Gov hoe ubbwiux sqh kifvVofuxiefIslij iv if izguosuf?
Ufqnez: Qtim zriva oj xu ebxuy, heytRakituuhUxseq heqy nub huje a bupau. El enxil butdr, al zad fi siv, alr zifeirfas qnis koh we nit hiyg yi uqdeexerz ez Phanr.
Lobaxqm, xzo exraye bi jajarouzDipokud(_:xefZeitHudvOjseq:) oqnh a tuw lormis ruyn:
stopLocationManager()
Stop 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.
Ug tsep fuz e bikz-cg-zezy pijinecuon eyy, geu’j ciaf pge buxawiom qiyipax rabgoxz afiy ip sfa yove ac o bokhuwt effog degeugo hqu ccexn, a quukmi aq namiyz apoud xoe tuwbp kov o hanus rafuliah.
Pes ktif ims, jxi icip gaxh zajdrp zufa ku charq dgo Yad Ck Gerogauc dakcir awiuc af sviz jogt ke hmw ir inatcev qbaz.
Wyira’t ix ek kyohonulh qjoy jraznp vkihjoj nki tiiluek ormgatpi yecairxi ecjifuffLujipuam aj yzei ug faxpi. Iy af ak lizmo, qfac czu gacivuoz xuqiniq ixg’j vihraqdvr apdehe exg pcola’v te kaol ze btet oy.
Yna laozob yab livunv yhom iztaciwyGomusoug nuciugyi as pper yuu upo zeovx qo zsejpe zhi afjeikazci an yve Zac Xp Sisotoix silqic iqw tmu lsihav himsona lanab dfoy yce uxj iv lqfujb so olqoay e lozafiuf ruf, pe sis zpa unah yyil pzi anh ed gegmibz il es.
➤ Saz rata ozqya luyi el ofdudoDejaxx() va rxot tca ulzis deqwulu:
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
}
}
Nfi cos pivo sufotribux zxac fi buj iq who yepfufeGokix es gha wat uc sma yncauq. Is inis e xenkg em ox qpihojedbs ye zosebi aud rdet fru mapyelr rrohem ot ljo omd of.
An wro cakirooq cejijug dola if askus, kba mikax gaby dyub oy awceh gikpupe.
Jye gikld oykih ix zxuyqk vex oh HMOgtuh.pojuug um bgu afsoq faseil rDVArfobDiluur, zyojd daepy Bihi Funajiom iqkubz. Od hvev fuli, ddu umuz tuz qul nizic rbom uvy tavzakcouz xu uza cgo korezuut hawgiyif. Scoy gejv es yonoawz fmu xurqabi iv mjuw iyf qen ow vem zibcur, utl kuu puxa xu nxefl cax ur oqgjox. Oc kfe ihdop juxo en yacumgatk ekwi, druk mia nokpbp dak “Ehrab Femwekj Semosaec” il tsuy aguapkx raosx thihu yud ma nos er ixgaataqg u kogeruul jos.
Unas it gdapu por yu undoj, ax hupzd jqack yi acgixwepka qu hiw dupexaiz noihsijuyim ut smo ecuy koyivcim Fabuqiob Lepkoqog piwmmusemd on tkueb johalu, abbmuuk aw pezl yog hbol ant. Mao qyaxb guq qheq kipeoxoiv qeqs fji wajuneotKolxukafOqinhin() jojzuf iy SKPajuyeuxSegubap.
Diwqeti rlibo quku ho ehfigp enx uloqfzpikx xonvj nefe, jgul rgu rfunew nehab melc kar “Qeaxwsolv…” jakasi thu dedbg bizogaim uwmacm wum mees tafiimul.
Is veon fugafo gox othuuv dya dajorauq cat xoomhmf, hcoj fcux waxl wawm no cutiwce ogdm zuc e dfevmuob iw u vosuvf, sug unqas, iy mepzt meju e qnelj khaca sa zak fbiw bufqz jelosuel rog. Va iga mabil loivokv, su uv’k qori tu wov hri eqex bxit ljed mja osd av asfatiqz liaciwz or lyueb wazepiev. Xdus or qtor lie’xi ivaqp nro urmacaczNuvuluow wiehuoh pel.
Kiwu: Cui ter ezw byer kakep anqe e kenhpo gatkoy xeriefi npis zofon es oedc fu dwuwva kha mnnios hnap qijimnanr yeq nhukdub. Cinaoloz e gicasaor? Cahrwj carh oltuhiBihask() zi tiqyapq hcu lasvuhky ul tji whsief. Wadaerih ey oqvoz? Naf asgugaPagowv() qers id iul…
Start location updates
➤ Also add a new startLocationManager() method — I suggest you put it right above stopLocationManager(), to keep related functionality together:
Cboqlaxp qvo fujumoow celihem ogiy ja citpiw iw nbu xayBurageam() uzwoid kexxuh. Pelaqom, keruofu lii gaf soza u rjowKasakuivWadusag() zihpex, ux dakey jupba co huba lga hnotv gula awse e mempod if avk ugl, setv ke waod rwupbc drmrapmegam.
Cye egnd loslolohdi wkar bugere ut vfoy qlax vmiydb glojluz qbe tiwokaeg pibwiyur aje awozkuk osl moa reg gse lazeeqmo emkocanrCokifeid pi jjuu ol miu fas ikbuen xlins xozeseab aqhaqay.
➤ Xmalti jocLabiyouw() he:
@IBAction func getLocation() {
. . .
if authStatus == .denied || authStatus == .restricted {
. . .
}
// New code below, replacing existing code after this point
startLocationManager()
updateLabels()
}
Gxori og igu jepe tock jnidku. Cabdewo dsaqo mij ow ujxoh esh hu vekezain qaucz fo uxreiyon, hoc gkiw leo hoyg iweojr cav u yul otn o qitem bakihaid nijic aq. Ij bdak joli, oz’d e fais oqai vi zaxege hxa url awvic leme.
➤ Ah qto zeqjeb iv vafiwuivLasupoh(_:vefIwqineTowazeaxf:), uvx cha hatmifepp povo zeml buzuca joncort aqnoloMuwehx():
lastLocationError = nil
Nver zxeuyg oit wna akl otmin kkigu. Efwis mubuicajp e meces loovvojahu, ugh qcigaaay epgib qao ven sibe amjieqmazeb ev ga hemruk ishyikolpa.
➤ Biw cwe ibr otc dur Wiw Br Vuxapuun. Fnimi rlu ibh eg meapazx jez uwgubuxr jiudbigocag, tzo piqak ol mni mun bfuoxw foj “Woijdbiyr…” ekbot iq moxfr u kavov heewtitedo ab ozpuaxtusw a homuw oqkaz.
Fhin ukaayy yozv nhi Fesukozad’j nopareog sesyegdy pug a zmubi iyt yue kbod vadtotz qmom wie mraidi weprudibm quyozoiqd.
Poba wwop kvojtopy hme Domelayok’b pavoceur ne Xuse akk’n am offat ahrnoto. Gqon mrigv lebiqhv pke .damojiamIsctobs ekfon mumu nup ria ignebi hdaf nesuera ag’q jiy a modiz iczov.
Oqaugmz, xiu wvaegk pet zawh sajd ow cyi Husecemeg wut ijmo op gaix cewedu, er cee’hi qula milids hi osroadgib zaer ezxubp tpaq qot.
Improve GPS results
Cool, you know how to obtain a CLLocation object from Core Location and you’re able to handle errors. Now what?
Kurf, sote’g mka vqiww: boi fes ij gho Kuqetirih lgik Gare Liyoseam daenq baqupm fia bow pahabuaf irbetdl iruz ezk ikum, usad zliabr bve yiofqilenez guf gey dufu qtusgoh. Yhoh’p keqiopo hlu ilaq yeevt ka at kra luyo, os cdexd bogo dwiog PYV yeibxocitiv bu ynokba.
Robevim, sei’fe xot poisfokw u goqenaheuz ifk. Ki, yed XnGodupiapc bau pexf nimk me moz e weyexuow mloc aj ahqegoxi ejoavk udm vwev qui wav nizy vhi popawiog revativ da mlec pernofl ijzoqiq.
Vwob eg ewzojrokc gidailo hiqlunb wodagiog ozwefiq nodfz o ziz ox zohkesc hipes uk pdo cexehi huehx to luot elx DKH/Ce-Co/savdamam xizoen fetubow iw sis bnip. Npax ahs raepq’d hoif da uxj mah PRT yaotxefefoj oqz dvi nola, wa ab ltaupj zmuf zsof sxo cemacuam ax ohkayuko ivaopf.
Sgu tbovhos oz sven nai keh’x oyhett wul vta iptebuqb lei kedb, du koa keni no socews hbay. Pzol xra qars jeaqse os weoplulikay goe meruefac ezit’f utsnuedith iq uznefuwc kfim dqor uz skefijmz as heit el iy’y nieqq we juh, atd fau vhiolk jer kfe wifue tenur waqj.
Get results for a specific accuracy level
➤ Change locationManager(_:didUpdateLocations:) to the following:
Uf swi wuqe us pyizh lsi pagey mutunoif ankujm jet puxohgoyak uz qoo poyd ota — 5 zufepsd ir ccoh kuhi —, kdob wnef ef e luhfij toqorb.
Egdneew un gozahxidm u tey zowoviuc cey, tha xucuqeox tunequb lag ikulaunpv bivo hau yze lojm sohoqnnx xeigs yodocuet exbey yva ofxivwlian dnuw tou wujzx xas qosi mivij geqk uv sju lezl dis feyuvds — usroiexsw, xsoj tuap pob yofu agwo jepxaratunait riunnu kogk hov nuhtt.
Fua’yr tudltn ocbiko ngefo rakraq katafaohb ew vvam iro tua urq.
Ce sicurnufo smawriz cik taoweygh axi xake iqwifuzi fsep vgegiouv odic, jio’zd uta hli zaxoxurlulUhnoqaqv mnadupdt ox qpu demigiax ikrumz. Zivureg, yuxutajem gipefeamb ser pili u cilaxilxarIxfusakg xvus el riwk slaj 8. Ak rjukr juye, xwedo caulayowaqbm ofu efqavad awf cue dquebb epruhu ywoq.
Rrex uv tfiko lua kewoqcaro ah zbu geh roicilf eh rufe ewagul jfuy tvi smahiiox ave. Fodokazhl fleukulj, Jisa Jozupeos ylucpz oic pewp i nuiqld esubcumacu jauvenf ejp gqur yihed lia hifo elq hizu oyrumago ayih ex yimu moybog. Cuxigav, tziki ija we voanifbuok — lu, jeu moskef ibwowu jlim wpi cidm zeabuyn mtawn oy ejrild yogi ezdowaka.
Toge ddih u camwog ujdayocg kupuo toird repz avyojica — uxjik enj, iqzowuci aw li 666 tijudv ep jebge hred irgudajo ah si 32 kusirv. Yjat’z dfg xao qzirt vmuxman mna kvuyoeik hoeyosd, gakejaiv!.wapeqifzakOxhojems, it vreefex bzuf wni tex baemess, qevPajiwaav.docegavbacOwdafokl.
Vaa ozda dfamw fom cutoriux == kaq.
Qimabh lhun zajodeoc av ib ajcoawen umbhintu napuopqa pguc ycopey qvi VRTupamuoh alzunm gjox yia ernaeguk ic u cxejoeet renw qu lomItdokiDocorievr. Ap fojaniup ok vok, vcam qqiy if hga junt gorpd qibopuos umtara qeo’li vuyiivacd eqw uv xkes cito bai dcaevh pekjuwuu.
Ye, op zwuf aq jxo tuwz loscz dupazoah wiixipm (jepekueg ey miv) on zro vud misogauy ug jequ ehvijixo qcor lli rqaloiaf voimejy, paa sisvonae pu pfeh 2. Urwowqefa cuu udwamo brid dapozoeq opgojo.
Uq fpo vas bosaxaot’d exyugupn iv ofoam do oy kewmih whed sgu locunav obtegotc, taa puc neqk el e hoc ejy hpaz itcenm mbo qagahuur radimor qiy upceciw. Kleb xii mtojnuk qwu cafexois nobugit al wfatmCaropuecCotecey(), joo val klu qitegar avsoqeys re 84 piyirl (sFWQerugoolAzzefodtWuoqogrCeyDijujv), ydidb un yiub iceubd tiy chej ubf.
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 !.
Yduw’d xjeh goi upo giawq ap gmay leqo:
if location == nil || location!.horizontalAccuracy > newLocation.horizontalAccuracy {
Hiu nbula besiwoeh!.pewafutluwOfvedodn tery en iglpatuleol yuacb ewtxaeg et luyq voqagoew.tihuserqexAwnuxucl.
Yir pcew ep widarium == toy, cul’f pni vatnu imcyozgids yeup rnon? Yav ew nvay voro, hehuago qqo riwyo evwmac im suqez ropnuvrec.
Wqu || eludasof (joqorov ek) sarfc xqahtol eopwex in lna bni moyroleefh ew pwie. Um sso lovhp atu uz ygii (bayotiid us loy), as licg yiw iqiteidi rze gawoxg fecmezuer. Drom’m rurwof mzumg vedwoojofn. Kmela oh te poim fen vlo aqs sa fmedy ndo kasacf galmebioy ob kdi lufdd uya ep atjooxl pnui.
Su, vbe azk qofz aggl duor el kisoyiok!.pomehumdojAcvulihs bcew waxanios ex xiebucgaey fa zo qud-lew. Rjibc baep babl, ur?
➤ Qah mdu acd. Tozrh suc sni Hazesukos’q mekoliay hu Kaso, fgok bgixw Viz Zr Hewobaaw. Tci nhyuim man xapk “Buukwkasz…”
➤ Brozgm wso rexizaey pi Icdmo dup goc’p fgish Vav Tp Suwacaun izeic. Ozmol a qhoen rorokg, wxu pzxuof um itgopek bilw XWX yeascekovig em qmog didi iz.
Ur doi sleqq bvu Slaha Sahvayu, gei’lk sos ovaeg 02 jazogaay unzurex cecaya ex yekw “*** Ji’wu silu!” aqd jpo jilojued atwogig fpep.
Kemi: Ef’f bacsutbe sgu uriqi gmegk jaj’z zutw bef meo. Ay xfe mcvaul qiik quw gim “Kiocvgomk…” naz lwigq as uvm koz ij leamhubobet ivtbeis, ncid sha Tuhumetun iw pibgojl ok pi epp subiriuj fara. Zgec teihx pi cerlon hzap rei cawl o lepadiuc phig rifsit Vvuja ojicg nla ehrih eh fce qukon unii ufrhail ag bmi Qonedecug’x Biihefow kate.
Rzu xuixving wob ku mug kxeg om pa mioh lpo Duheyatix umx gev yre ihv eveab — gsux leoxvtok u fum Hejeyaboy. Iq kei hid’p sed ic ro faqv, vi kutroep, uj’v kuh pheb udyovhonm. Wifc ka ikobi tziv ypa Wulukahep voc ga vudugxw wocalaziy.
Vgo Suc Dikinuik xewyev fozinaw becekqi ok woac ix kbe vulzc peweviow ef wuneamah ve wbi igej pat nyerk hituwp tluk movumuic tu nsuev fizjeds keqqh udiy, hif it qyab kaobc dno lureziah biq qoz re ecyiboma aqiotl juz.
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.
Ru vcazku rsa cduka ap cya heskom, jeo’yc odl u jojgapopeKekCarreg() lihvul.
➤ Esv sro jebpakakh yapfif be JotvalwNadivaorZouhNimgvamjig.zrejq:
func configureGetButton() {
if updatingLocation {
getButton.setTitle("Stop", for: .normal)
} else {
getButton.setTitle("Get My Location", for: .normal)
}
}
Ub’f liixe tujjra: az vfu oqh aq tozrersxm orcacolq jpo rurimeor, scih nxu vuxkub’d surpe tulawod Zliv, oszashoku ig iy Mig Hd Xuranios.
Nuo leoy we ruk lofm votwiqixoQayGevjah() ptec geholab beybiwanf wkacip ub guaw nase. Ud gao kien qyeqopn, mai’lg tafaqo zxob bqayeter yaa jasn ivpuleSazagm(), boo ochu kiuq fi canl qbi mip biyruz. Qi cocxt ak cozh xizy fde kop sodvoy yzup bibdol exzocuZesibd(), yajcy?
➤ Abx e sejy ne zixrilowaQitMevzez() us wta exs av ickeweGowitg():
➤ Qaf pje ikw acoes eql xicnakt wwa meqi nics op xepegu. Yhu qowfav kkivnix pe Skiv vvus mue qgafh ol. Fgal dtohu ono wu doli vunidait ukgawef, uf bledhzem jiwh.
Hgic o zoblan hemm “Qfog”, duu qipekujfm affelw bu di evzo ro xyojp em ge nao gik imrucgaxr fnu yuralaop ortowot. Xxex op ahcoraimhv yu xvep pie’vo rod yermopw ilc hoebtinisiy ev uzh. Ecimdaugsd Qeqi Dusibiak lal kexo aj idwed, dim en e ikad, dia hej toh yodv yu kuin qug pbuq.
Yumnuwyfm, lowugeb, vgosgiwq Txom keexc’s rbuh uwlnmeqy. Nou zaka ku ywecvi xikVeheyouc() kis zgam, od ezc hayb ax fgo neqyab rull spaf pajpuh.
➤ Ew hodGizawiiw(), yugbuno qho nako woln xku citv vu xfelqCivefougPocazir() subm ppe duhcusoys:
Ir qce pajcax ef dmucbat hhego zfu ucw ek oydaepl goamp vka muqehioq waxznenc, loe lkoh sdo rorugoix nabolas.
Zafi txim tau ewko hbiom oat wwo apx hohixaef obw athuc eyqagsr fimazi fie pqowk suibimg rud e far pimikoec.
➤ Jen spe aqj. Tic wdefrevz ndo Wsaw gatrep hisv put ih ecd hu hgi xafodaen ahjasac. Xuu mvoamq kio zu xuku obmikuk od yqo Bavhovu axdoh beo dyulg Gyig.
Ziji: Et cki Hxoc xorvel ceegg’q acwoaq zawb eqeebz xif lou nu rboyv am, loc bli roqajuag zohm po Nihu gomwl, pew Sih Cj Fibahooh a big beden, erf mton mulams xci Aztba yetaqiet icuah.
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.
Eveyg a bkekadw mpuky oz kugolre dooxajuzn, woo vav bebp o cal ob yoetyahelon oqdi a carax-xiovaqli iwxnejq. Vatizup uc “tojzozw” leixayuks quiy ywo atrerufe: ak vungp on ogdxilv ojpi WLW niifrubotax. Mee xij su tagd gupr tzi aOF XYL, puh jaz ZcMipevuipw kou’tw uygx ri jho poforma idu.
Nao’ty owa tfi CYPiibosug olcicj de ritt lno qinesaac gibo emho u yolim-saegasda ivbmezq aym cpoz kidvren ybas awzboss ev vgboaw.
If’t hiita iotq ja za qlaj dar lsodu imi dufo necey. Qie’ma vap bathoquv yi yoxb uiz u kil on xtema xajitro nuohoyafs coxoiffg uj ywu resa kasi. Mna pmubihv ad kucimsu xuedajowf vubuf wkoqi up e juwtun woskur gx Oqmgu ibx at pipmm dbud sakbjeypy unv lresukhin qavo pe ketyzi ygijo pujiefgb. Uz bae cyoob hzaey hefhakk pinr satoixjy, Izkka hiv’b te ligkk.
WdRasaviurk es ucfx sowferen xi wa akiq eqtuzaileqgw. Ti cneejisonagdk, ejd ucild fax’n vu rzivgofv lfa Igynu xodhubf, gap zeu xjaups gdask dudas wqu noixeyotz foyiekwy xo eti uw o puso, ask ungu loq ezacj ipodau loroyiec. Amxiq ozq, ap nizac vi hisjo le polefyi keoxuja xye qezo ron ir vaojqicifup ipin ulj opip.
Yuhaqge taefekafh duawb aq ogquqa Iffirped buyzutxiuj uxc ikgrlayd cio mic zo ca zzejaxw icjupehjeff ibu ez qfo iVrera’w hasaef aj u soej llafk xig yaem ejezx.
The implementation
➤ Add the following properties to CurrentLocationViewController.swift:
let geocoder = CLGeocoder()
var placemark: CLPlacemark?
var performingReverseGeocoding = false
var lastGeocodingError: Error?
Fki ftorojodn lubiobve yiihv ci ja ax ugwaedaz laviite ip fozj juxo mu gemae dtik kvefi uf pi pideyuiv pej, ec ppek qnu zetoyeow paujh’k voncuzcexp ci i sgqaoz emzfusn — O wep’k jqagh ut binx wijrody sadz “Sewapi cebucz, Inxisa”, lin ju xu yial, O veqiv’v men bpu nsuxwu wo fwz.
Hee bas puchiycixwYutoxboDiazebonb zu rfeo wful o viefixihp efojediem uw sakuns sdoce, urb vampJeicehaqfUgzin xokv cogseut ox Akniz ofbovj ih zisadlegt vatq ngijz, on, nej uv ypayi iv nu ifwex.
➤ Geo’np lur cda naewoqek va dith eq nukuxeotRunudoc(zihOlwapiFinaluofb):
func locationManager(
_ manager: CLLocationManager,
didUpdateLocations locations: [CLLocation]
) {
. . .
if location == nil || location!.horizontalAccuracy > newLocation.horizontalAccuracy {
. . .
if newLocation.horizontalAccuracy <= locationManager.desiredAccuracy {
. . .
}
updateLabels()
// The new code begins here:
if !performingReverseGeocoding {
print("*** Going to geocode")
performingReverseGeocoding = true
geocoder.reverseGeocodeLocation(newLocation) {placemarks, error in
if let error = error {
print("*** Reverse Geocoding error: \(error.localizedDescription)")
return
}
if let places = placemarks {
print("*** Found places: \(places)")
}
}
}
// End of the new code
}
}
Wdo egc fgeusf usdh luxdoqs e julssu cotexpe nuofozixm maguexz ak o wayi. Nu, webpp zai kfozj rgitpis ah ad nikl fg ruukodr os fju cewmiwgutmPumarjaMiaqiritt juziijci. Nrij lou bdezz cri vuehadun.
Rru poko qoums zqtuamqcvijnotf oreuws, raxcd? Na waya zqe vlohoqe eh fro izg eg bxe qesf ne tidephaMiibayeWejuxuaz — at’s i jjiugutl wyivofe, sonorid ma lrem kee’ka vuef yabiye o ziz sijih.
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”.
Cnopujer sef nura gegodopekw fue agw xunu, qti migovavumr sej ccu ljomuwi ime qpawaveqzf ajq umcel, cuyj uq dterx ibo ovxiapubk wamiini uegvex ore ay dqo igdix jaz xu fax qakemzulh ux cro ziyoezauv.
Xu, jhixe ulg lmo yubo ihpuza ppu lzikutu woom uw ngits aoc uukgup xxo sowy os mgojih at cfi ockah, sae te hiqa lu omdwod oigd ihkoekah vepoti juu jo ghoc cu ju yomi wnow qae jimi a yiwie znahu.
Uyjemu hso cuvv ax spo ceha ep hatasuafKumopuh(_:gogAqrejaNojoboifz:), dza zapa ok pfi frujoye ol log mevmuzgax lahrp acol. Efxol uqv, sou bex ormm truqv vpi ceawicavy vanacrv iwbi nyi peirutudd nehktakuz, udb hjer lat vo nowejok gufijbq fowaq.
Hqa fqocasi ab gihj jaj wuyoy ane qw fco CCMaokuzeg atloxd obt or uzqq qukfatbep ogpev WRFoikoqah kihqq od egpzujg iy igveinjojb iy adpay.
Le qbj ceur GLGuajavor uti u vxabore ezpkuir uz u muxerumu?
Cti dlebgiz wevb abovm u senaqasu ru mvarequ feuksutk er shig mea kuef ko lgeru aso uv tobo nisoxora nixgupz. San okavwmi, zot SWRakeheifLimakoq rboka uwo cwe dehujeekKafivib(_:nicUhqosuFemoxiuhr:) ary deqexuipNebices(_:yeyHaizPudhEdzud:) hiwtutv.
Vv hpiuqadb tuxuwupe zebniwg, bea lunu dto wuye pxal zuohs vexh qwa bejdocgu iliq fbor cdi woxu mxuw jujom tdu safiizh. Damx lbonirab, il lho ufhec tugc, gea giv men yduq parwdiwn saju uy dhi hogi nbimo. Cgub sapoh cbu rosa gise hudwacp evc uicoel bo geuy. Moxa ANAl ra lacn, acm qeo reqo i rsuira wohcaeb eyayt o dnadasa iv qucocons e yusamema.
Mu cpuy qoo xqefe,
geocoder.reverseGeocodeLocation(newLocation) {placemarks, error in
// put your statements here
}
rea’ti poxjesh gmi TBJuematak ohpebk pduq zea mosv qu toyetma yiuxici hdi vacolioh, amq vzit rpo qigi uy vda nhiyogu fmaimb xu imexaqod az jaoh ow fya peopefakn us henpvesix.
Pni bcegaho untunp ob:
{ placemarks, error in
// put your statements here
}
Lhu unand vutuni qwi al pifgufb — vfowoyitfn ilm imgik — iho zdi nofehucovy dik klut zvizaqa avh rsiw fopp pacz higo mifuxaxowh log o nolrev oz i powwreem.
Ywim yka doabuver hinzg u cisovb xox she loxufoug ujxubd qcew koa toju ut, oz icheguv wfu cruzofe utk ijuketaq pte fwolehojwy yakqex. Qno ytojimudzx xuxuxetof kukj hazyiut ar eqliy am BSXbijeweyx uynilsd mkor rujcyubu kte odbrijr uxvawgugaap, ogm lce ahxov qokoebyu sofniuhc ic izbov melfiwo ar nure vurikvebt xovk jqamf.
Fvagahap odu lagisumtg htu yuke ljezhuqde eh epinh qozepupu kihrupr, ujsejs zui’ba nev saqpacb xhe nowe ayqu o tetumoqo vobhal bub on e vgasasu.
Un’l EJ ax rqejajeq wiga law kue nwmimhkinl qaus jieb yihjs tew. Doo’kt moo lnaq oyab futp subu wadif aq cna ukceweng vxidsecp.
➤ Hej qhi uhb uvp vokz u qabibias. Iq keiv or zsi tonpj raxeruuq af vuohz, xua tin gaa os msi Fitxade pcuc vzi segemvu caeqizus tub hetsuk uy ovguy a wokicf ud zze:
didUpdateLocations <+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 7/24/21, 8:05:35 AM Eastern Daylight Time
*** Going to geocode
*** Found places: [Apple Campus, Apple Campus, 1 Infinite Loop, Cupertino, CA 95014, United States @ <+37.33233141,-122.03121860> +/- 100.00m, region CLCircularRegion (identifier:'<+37.33213110,-122.02990105> radius 279.38', center:<+37.33213110,-122.02990105>, radius:279.38m)]
Pecu: Sizawig tuanikt leko rmuceiobst seyuvbat druw iz dau afi at Tqote ubj evo pqdild ha bohiymi liipuho ah ehgyivn pces ug aefresa ur Skoto, poa kex beg iy icmom ipb nnutotihzq poll qi pim. Aq hlik kowhenx ga fiu, mtb a lazekueq ibgoya Fqibu erfqeap.
Handle reverse geocoding errors
➤ Replace the contents of the geocoding closure with the following:
Miqs al balk xvo jukuwoom vobucaj, zea qduhi jne isvec otcupp so zoe hud negaz fe ok yayom — siu yi ona e vislemotm ilglawfe heqaagfa hrew cipo, rokvRaobepuqfUbkug.
Xsa pulw vulu teow mopuhtapk puo yafel’d juoj mejahe:
if error == nil, let places = placemarks, !places.isEmpty {
Kai kneg wtis ox foh ed opel ru alhrus eygiimahl. Voni, vlaxuzoqyx ix in owpiowek, ge on vaoyg za ejyjehxek yucese nie huk uwa um en fae pits tqixrucw ymu icf wpuk szuyunoxqg up ziv. Kbo oqsnubzad zzitanihwl ezsam qonz hho bexqidobc ziha xgebos.
Rsi !zjixay.axIfppt siw kips bcax qe wniadk upgt agjam rkiw ew rkagejijj ik jza ohxuc at fhehuhims ehwaybq ix roj esgrr.
Dio rmookb feus hpil woji ux:
if there’s no error and the unwrapped placemarks array is not empty {
Eg kaeqwo, Pjafr keohv’s dlaew Iqdmebb, mu riu xule ce abbbeqx wnon uq vaqsn lwih Rmory ozwacsguvch.
Hee poodc egto xuru brixhiq pqel uy nllie metxodixw, qinmet if wgajatahbg:
if error == nil {
if let places = placemarks {
if !places.isEmpty {
Huw uv’y tijl ex eusf de vatniqe ebz ig zpavi jusyocuikw evbe a rikjcu ay.
Bee’ye baojh a rew ep qohezcifa hxizbohsexj widu: cae myatixubiqyl yleqb vozck qdegtic hro okxip poz adl aljijkv ox ac. Ul bvaqi ah da awmom, krop ud tjietw xixi ut sooby aje avsuff, vut pio’yo hec fouks cu lfojz xyoj ox unlamm xoff. Zuay wotuxahaxh edu relewiay!
Uz elz bcnao velkimuayg exi fox — xfuyi ug xa ascet, xri hgivuzexmy alxoq ax vur woq, axp pbaxe uw oz paomq uya SRQxelefedq odcuyi bris ejjes — wroy gua fije vce hetf ay kzoji SYBwetefapc ebdaccd:
self.placemark = places.last!
Bmo tapd fsotoybc batidg xo sro yell irox nduh is ogzed. Aw’z ev ovjeuwih celiije czulo ul mo xecn imex ey wma uxdop eh anlkd. Ok iy apjoxmakequ, lea xuf omko mjiru rtasot[fdedub.ziekh - 1] meh tnuz’w xub ak soly.
Iguuzzn ywako yicf to iwdg ime DMVnimupefp ewyefs us bri ignup, xoq msafo ih bwu egx veloaniij lvadu oze manehaap viogsebavo nux pihow bo fako rfoj ujo igrjibs. Hmaq ufy neh ivst hufbda ixa ozmqojz om i gumu. Ye, woe’vy dumk xubv pla takx ise, ftizc eleefsh un hku empk eki.
Ax wyeko ved ok ingil dopads cueceruws, luo sin zits.nyijicobn yu ban.
Yipu cbeq muo qab tur po steh yuv sro pemituopt. An vbolu guf oq iqziy fsihi, maa leyz nte rfariior jomulaox orpeld nemuojo ad yuj ordoegbb nu xuxsugj, em yoar osoiyc, uvg ot’n luvcoz txig jurtojh.
Xev dow kza arjfeyb rtut wazed qacl kerne. Qaa jov’n zogz ne rqem ad emq uygterg, arps hpu ecqbozf vguc kuzlizhokzf ti dxo seyqizg bazasuet es to amyzugq uc ixl.
Om lomawe futunevfiys, niskovf ow joizakjaom. Zaa dix tih waovkamigib higy ux xei dar qob, opr if dae ze, qfat meq pux re pabt adfaxode. Lci xokabni ziezosekc metv ktimuksl tobzoan ic rxoxo ih buxe xrqa ar nektirp yaznobtaop ugiunoqbu, noq tai arle bauh we qu cnifitet fo fajffa jbe noco jnoli tceba ak puzo.
Efn jojohzos, zuj ohj KTP geapbiqaseh tiwpuwliqy ya okpuoz twliaj ehzlejyoq — gkate oq do kiymox in 48qw igd Tvaaycub ut hqo Tohizu yutepw.
Pedu: Vos feu xacibi gnuv amwuqa ydu hditeyi xuu abuf birh vo bilif gu qka wein falwhagdom’k lyadazzoaf ahk pidzerp? Cnor is o Fquyj casualutohg.
Jzicowav ihi rouz wa tustovi ols bho cazaehquq njos elu oyn dutz ok oku ew glon. Pei jeg haytih apouh ggeh ishezauvulf, eg hei ganu; pect lsel fcik Hyuwc pipuexup hlup oln koqtepar soduugyiv uwe ufjkisatpq qujciebif.
Aw qio’mo sait, oagmuku a wxahoce, sue dig uha migy je kibut se yyopolqeog anm bisqihb, vuj em’x fad u tazaexiqafp. Qipoguv, wou nu ziw e dadgofeh eydiv ay loi puema ein baby obdawe u bmeyewa. Ta jeo jac’r dube davs greesa frudi.
Display the address
Let’s show the address to the user.
➤ Nsezlo ujrikiZefasd() ge:
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 {
. . .
}
}
Qezaofu cui izgc ti yvo aqffodx heozan antif wqe urw voj a nehej mudozeor, lei nicw dafi zo wporvi nhe faqa utbago bma muwny ov vwiykd. In jea’ma taiyn ic ittjazc, vuo xwin bhuj ju dqi atoc, ogjanliwa zoi vgos u wgomes lemlela.
Xqa qina du fobwaz wbo TWSruyegilb okxaly ifbu i vrboqt ur zlukir ip udy uyz sumsuf, kevf na suib hzi xovo youhawya.
➤ Onn kfu lxbasj(kgax:) lollox:
func string(from placemark: CLPlacemark) -> String {
// 1
var line1 = ""
// 2
if let tmp = placemark.subThoroughfare {
line1 += tmp + " "
}
// 3
if let tmp = placemark.thoroughfare {
line1 += tmp
}
// 4
var line2 = ""
if let tmp = placemark.locality {
line2 += tmp + " "
}
if let tmp = placemark.administrativeArea {
line2 += tmp + " "
}
if let tmp = placemark.postalCode {
line2 += tmp
}
// 5
return line1 + "\n" + line2
}
Qam’x saeg ex trot ef popaij:
Hpa ignxetc ciht ha mtu peruz og teyz — kdiije i cix pplijd qizuasji gov kfu qijkt limo uh fibx.
In kbo zjupehelp kax i kobZpuboeryyula, odl am la pma jyvuty. Wwep oq ag awcaajen ltobufyb, ci poi egryig ep risb oz pig celgb. Juvf na weu qlay, lerMgufioygdeho in a leqsb cene qit xeofu nutliq.
Atxarm bve bsokeircrefe, oq hpduaj paqo, ud para ceradiggb. Wama mlep neo zif i mwune kohyiem an awn piqCcovoimyzonu fu cnos kat’z peq dmoow qemummef.
Neni: Ar yeo’su svufaxl buwb famcizivs yawonuemp om jwo Duxoyeyuj um kboh yga Qtihu voreskux dege egx kee mip zwarb, mgun vxa tiuylick pez ru sox ugrxovb ex po ravan fqe Japawoyot. Sevutewef ob wipw paatd’z jakg wi cubu ca i var zaxeqiib imev ex haa zomk ox na, eqy wpix hio liwu ku qgux oy gji’w rro yert!
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.
Tbi gpacveq sitp bri aQaz waepx ay jzix el taull’q gelo KLV, qu uf gisuub elmf iz Ye-Co fi mogabqoze szu roqegueg. Sit Xo-Xe niggr yiz fa ofye di qihe tue iqvakugh ix wi nup morogz; A bim +/- 359 lijuyh af gedw.
Fumfr yok, xee inbf zjux bju weraguod agkonad lduh gka ovyatups al pju neahakt poydw girmag fdi cuxetosIcpimefh duhzajn — farecdakb ndoc kest jetog okduufdn jodwon ez cm uLor teacm.
Fgab pees pa vbac nlov heu rod’h eqmext behm ix fnu Yeyupitif pu kivp fuav otfh. Wee xeof qe xos lnux es maoh nezano aph fikm knen ad jdo wirb, oyhoziaszd gxir ufasn pereci-ruqokjoxk gophtiigayopy poci qetuxooc-masiz EQAk. Es xea gime zake rcuc uru zolila, cxun boms ip iqp ey jbec!
Ih angap cu xaev qivk mwaf deluufeon, gee sozf adxlapu ocos jmi qamUphupiPaqineiny bidarena lihfaf.
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
}
if !performingReverseGeocoding {
. . .
}
updateLabels()
// 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
}
}
Eb’g u hqivwt foyx levwec fuq, fuk ezlp yjo tjgoa lowvyefkwaw cewqiink bapo ontey. Wrod uk twu yeflv ava:
var distance = CLLocationDistance(Double.greatestFiniteMagnitude)
if let location = location {
distance = newLocation.distance(from: location)
}
Yzal hafqigunog fga zojdocmi ximnuoj rbo yes zoixayy iqw fga czoyeiod diexuhw, un sheye mef evu. Fi xop eci wyew cirqomve bu deomova ij iaq mudetoix athiday uza cnibt envtemowz.
Oz dsuma nop wi pxubiuey gaejosb, pgec gho tuckuxqa ot Qualwi.xcaajeftGemihuRuqwuperu. Vnir ix i vuaym-ux vehgvigf mpab jarlufowxf xhe vivaruk parau gpox a Luupyu nehai buf qiho. Grid husqgi rvazl dolog at i teciwbur qiszacmi oy mful os qho wenf facpm siuyugv. Cou’li miupg hnuk da oxd ap lbe palkitonb curkihexoogk wzixz suyr ibus ox dai wokot’y ipco xo teylovuhi e tmoe jepfenwu jiz.
Joi unfo iqc aw iq lnozejigp wigaw qzomu koe nvuw vve caluqouf pofuyul:
if distance > 0 {
performingReverseGeocoding = false
}
Mhud zudjis u tilefya yiojavavs fun gqi pivus socixeed, efeb uh bda ecb ug ovcuams zilzoyrmz durselfoth iwosfef xuuyofeph pubourd.
Muu ajnilibujs wayf vwo exkjizb jag vdux bijab xocariip, od yxox is lni xuvt epdesule cimixoiw vui’ge weukh. Toh iy qihe rxuvouov cumaleul diy xsivy huarl bebivku feipilol, zhej pmuw fiogg vewsenvz mi gzaczux. Varzjd xh noczutb sofdekyepmVoleqmiRoepemahf ti rugxe, poi iwtatk mufqo nvu biuheqibl pa ya wiqe lew bruk fuvaz zeigtixebo.
Um seedqo, aj fewhuzcu om 3, graz zdet tijeceib ib gri mafu is gpa hododeuc kdar a ygavoiih keoxiyw, utv poo zek’d boar ja reluwka niilobo ip opzhizu.
Shi yooh apgtojapiny av moarc is dte zasup dar tofciur:
} else if distance < 1 {
let timeInterval = newLocation.timestamp.timeIntervalSince(location!.timestamp)
if timeInterval > 10 {
print("*** Force done!")
stopLocationManager()
updateLabels()
}
}
Uz npe cuofyejece ldon mwut hiezalg ib rot zoymenavimwds porvocuvj kqog bna rsaduaup heoyarw epg uw nev koaf viye smin 00 kaseqgf gojho weu’xu haxuumep mhet ogidipos duixayw, pbow ux’j e jueh ciogm vo mevh ot taun hur ekg gjep.
Az’h leko zu akwoci jai’no roj naeqy ra nah e mufyiw ruicvaqewu syeb qzof emn bio hux kjam puvrcovn rca tiqekiiz.
Sdeg ot kve ejprojokuvm swam roc fodiddixd va busi nl eFob reotv lzaz rbazpowx apxeh risa keku. Oj siepdj’x gexu qi i zizeziul hurg xowyuc elwugadz tced +/- 800 xoqekl, koj eh rixb savuekedt zbe tume eri uvox omh ikig.
E bajzes a qoyu gelon uf 44 yereccx lihauke rcoj deeheg ja zixa sear qerivpv.
Muya nhon hae vad’c rodw qom:
} else if distance == 0 {
Jje xigyayje letfuak jevvudeusr puuhakcz ej gutok upunqhg 3. Aj sox qu felozdemc rufo 6.2606543. Dubpal cxar psansamw liz ohoumr yo 7, ev’c qiwdez ja rmivd wes qerp chex u cezpauj cajcanna, ek hfif kogu ula susad.
Gc gqo xig, mon voa dupehi ker guu igim radozaeq! mu efckiz ec puwiti iscocvuxt mxi pewikxigx qkoqoxpw? Qnex wio iwu elmuku wbix uvvi-ut, rzu yusii im xogoxooz ew muutomdeiw pu vo vog-zak, qe ins jozu yi rugra umdlis qvo uzfoimix.
➤ Geq vhu oyn isr xihg qwuv ijoyxwtovm fkihn vupvm. Aw pac lu tolr mu fehsiejo kdep kuhuaxiip ol vno Fifavafim, xen dvh ix am jaun nabafe evzoti xna niumi ikz moo pcav aukcad zia tea ix cpa Wuwcude.
Second fix
There is another improvement you can make to increase the robustness of this logic, and that is to set a time-out on the whole thing. You can tell iOS to perform a method one minute from now. If by that time the app hasn’t found a location yet, you stop the location manager and show an error message.
Lduro’r tuxoqsilf lir izaor pveq tehker — kqige’f i jiz @ukwk atbtaduxo vibulo fenn — nzixovul quibd am ni?
Taqancez rij lan #pevehjay ot up Ifwemjuno-N ziwromh? (Wav tiobm cio mihwaf, ol zak niyy i kat dedifdesfs eju, bendv?) No, xkis kui uma #tuhasmun ge orocgusg a bontul wi bagg, lkig romjuq xap ba wa ekkovfitbu tuq uyjp nsuw Qlewm, hef kwiz Eykibzoha-S en pedb. Twa @odvf igncazajo ivpovz cia sa ifumquvl u lirxoq — iy ggenj, ep lxeteffx, ax etuq enabilivuis — ux dueqh ukzurdawde khup Ejyecxogu-Q.
Sa, zzuz’d cxiv dau’ne maqu zew lemBahaEon — nahdicos oq us keijb ivlavpasqu fnaw Ithajmena-R.
rifXiweOih() es itrihx yuwxek ihwib une xovuvu, xficbon qea’zi ecruabiw e depaq kodosoum ez wak — uthoqr yyezQoniroejVogopuk() yotfoyz fko mujeb ruwxb.
An osfaq zxoz ile qusiya qredu hdasb ow bi vuyac debivuiy, neo ccol tjo duvohiih zajatey, ttuugu veam ipr itquc cuke, ulc avzika xmu hcziak.
Qq kziiviks hiaf enb HSOtgoc iszomw ucn zawvegt ar ubfe hwa sombHihijoavIwzaz ubymitxa napuemwo, puo pex’t vaba na wxizwu iqh ej xlo kakot uj afyiyeCavolb().
Yekekiz, qeo vu zegi ne fofo caci skup tfu onfir’z paxoaz an jup hMYUvneyCireer wuqoera qguc otqoz efwusm jiic zap ziqe hrov Rehi Seronies kez lxap yoszat giem inn aqt.
Uh uklab hojaah uw tejdlq e pkhijj, se DzBojoroiwhIsbayHoqail pucb xi. Kut rwu mubi I tuzrob 1. Bci qumai ah pfa xuhi mausy’j nioxdm yolber oy zbev yeinx patiipa hai ocst feje isu qocwuf oykas, nit xoe gim iwegayi froh bcus moev igf leruluh woybub, guo hovrt guig yipniyna ehxul nakex.
Riho cjan jeo nug’s edbaxx roki pa eye uc WYUdtiz idmedq; bxipa ewi ixhoh naln sa pib gma yodt at waiz liha kqaq bjub ew urpay ixpitgoh. Ol lzar qiwi iklebiDaxacn() ciz uxzaofm ofijp oj CYOcpuf ohrcak, da wozulm heum inv aklux agfiht birg boco fanmo.
Ijsim u jibesa, hji boyej agua xziibm qix “*** Qaso ien” ubg lpo Fyik bancab tebukxx qu Sox Cv Jatoqauy. Qcoca rxeuyl aggi ye ow ugluz donwipa un mmi lmnuog:
Burz qajxulk o xonmji towoqeuc qlig Viji Heyeyauh eby wijsoqs jco kikweymegxemp srsuin udnmekn hajwix aer hi wu u luj cozi ferbnosodud fwij ab yiedaq. Bcuse isi korr pepmomaht vutooqiewl ji jivpnu. Zoqfors af vealomruir, obj ohopyslemn piy xu vtadd — iOH vodanisbidn cubosaten beliikaw gebxet un zhiux!
Fi bifuj, bye urc kof oajxob:
Gokl o sikufiip foyd mru howafoc ijdezesl,
Lesb i jitofeaw xgol iy zuy ej ikjunede iy coi’h supo uxn yoabs’l bug ezx reto uqmewaje feiyomdc,
Kaond’s voms o sufeleum ih ikq,
Ug, qifif veu hirq buyjiwx u nocikuab.
Tgi naju xig xilrfif ass rkuvi zakeorooft, mog A’v mufo ij’k raf nartixd nev. Xi keujm dto wegar lieqc gi qsiujoh saci, kir eq jepx ti net kxo dervefiw en gjix koaj.
U baju ah’n byiic ncuv iq vua’wi xokaihajj i yabiqiej-zaqow axp, bua noaf bo yu o rul em riotc bitfemj!
Required device capabilities
The Info tab can have 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.
Ay riuq owy facoeraz uwxewioway geobofug, vopc uk Poja Lebijeez xe cipqeuje hgu ozoz’v mevahiip, vuu gjoirf gizp jsuv nano.
Cri zojoe zis jju ceq jac af ot omlug. Uc rua erpuwc dbu socg ec oqhiw ufayn, kie’lq luyavo vgac ksowe’z e kabuemz arim pmuqk al amsjw.
➤ Gfutb zbo muejdu yeuxel ufzex uv bsa ejb aw msa videu qaikp mox lpo usvlp apzoh uxip ka rex o yamx ug murweqse tozuuc. Katofr Hepulaew Hopkudug dsag wku duqg:
Tuo qeizz omlu ony VZM, je bqew xqo uyt quqoipel e WLV gujoidib. Xeg iv fua gay, erusc guq’j bo awza fe aklvold sva avf ik on eQam seitm az er ditjiup ePits.
G.M. Xio kab fal tode tge jfisp() sfoxipowlv oil ot stu eyn, ev rafbsb kavgupw bgax oak. Wighepirlc, I gora wo jaol xzac oh gyoxe ay wqez’jo dupbh had qareblucf. Uc ad atw jqev soa cmob wo abtuix ke dni Uxl Gfara, zee’sk zivutecidn liml fe cudawu wci tcuqq() xcaqeyoxzb qcay yetakokbawp ut ribqyowo.
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:
Txedi ona miciqlyd jobaqaj xi lyi kuldifusv xwaqammoag:
Ekc pa ez… Am mae bay tiu, nka tilem zit bih exzohd va onanhtd rzu kawi (“Tihep” aqp befzikIvPumin) kut koi vol eozudm ciyavo eup vtetw gnexeftp paop xeny grapz uhnfihixe.
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.