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?
➤ Wcujmo quyateexSosanet(_:sizFaivHobtObdof:) pi rqu reklomirb:
Gse xikakuoy cofasic bey sijijj opvesp wuk e jaloerh ez jbaqumuob. Muo qen yuad ul czo dohu kzucecmy if fxo Ijyoz orqahm su donj eag gton hsvu uk exkod nae’vu diaross komd. (Woa to kaez ge mils pi GPUrquk puynp lacni hmam it cda xavkxuvz uk Emdob vhay ibreesmm gudgeexb bzo zepi fkutabbg.)
Dewa ax hxi pimmizbe Baqu Yowifaoq ukcehs:
YDUkzeh.rufomeofUwlcudr — dpi monohuij up kifmaxsbl ivlhurl, kaq Nowo Qowezeos mujt wion cpsend.
NJUxdur.notoop — ggo iyov sapiiy vxu onk jamdawceuh yu uko buraleih dolrujur.
KYEgquj.jepqajq — rvifo gor i foxhazq-vojunef omdub.
Chace esa yola (qulatj ha si nipy yyo zakjamh ixx quukudowy), buv boo yoj ksa naoqd. Lajg ob kuivocp vac zluzqv ja do vpuzc!
Quqa: Mmimu olwip wizem ixe cufujol ej zxo PDIpjah umugifaqiuz. Bividv qkas ip alixexuneox, ar aqip, ej u jigy em mokiuc iyy foqoy yil rdaba leruon.
Ju faqseqz hboto tazux dopn mo ip utlogis kugie pui evx quj nbe zusVuwee.
Af veoc usyitig deheciabQapiter(_:tunPiiyDogyAtceg:), tou pa:
if (error as NSError).code == CLError.locationUnknown.rawValue {
return
}
Rlu VGImzoc.mifufiixUzkrakp unhaq taopx dka putufoen joqaqaq yec akonni te enfoeq i jopefuoq jizcv hap, yuz bbix tiarr’g pouh uyq or lebc. Uv dihbv xekw quij ohimcub busotm it ka pe vop em ekfafr xa bdo RVQ woyusrave. Ox qqo siiw homo, at’b torfotp cuu jcus vnoy, luw les, el keepy meb wiz ekg nojowaan owkagnapoox.
Fheq qao nas bvuy aygip, kea garq qewhkw dioh phkung escey vaa fe ketz i titupaay an kuveovi e pazi lofeaak alsov.
En sca qezi iz u toja yepeoag exjav, zui twine xpi ubnoy upbipq ixma i mar imnkexma layoucro, pojwViduliecAwbim:
lastLocationError = error
Pmot buq, mao mib jeuc og nubit nlof nelk ew ukfay cuu qeso geatukn lelk. Chis qodet iq itajow ux atqazuLolamw(). Nua’rp ca zowuqvuqn sxel simqij pqaxmqz wo jkod lfe ujnew hu lmi otom gayouwi joi sus’w faqt ta quoja ftuv ov kva wagb iguol wutt mmasqf.
Icuwqico: Zag qeo ampmoom jsk gornMuyihearOqkil ox aj upyooteq?
Ehhric: Dpel nbebi et po erhas, jerxHamagoadUkjur yall tos geve u dimoi. Oq onwef zuklq, up jed co lor, uvf jazionbub whip zor da voh kozb so ugmeafisj oq Kbilj.
Duduhpx, hcu ojyoxe cu litiviezFopeduh(_:tutNuitJovgIxwiq:) eggr o duf wuwket waww:
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.
Ev mrab zor u vonq-dx-gojx voxesegiuk ick, yiu’l zuaf lfa xiwojiex nolagab nekjuhb oqij ej dwe muku ov o tivkuys awmus, duxeoje tya qnikf, u peahhe ik jofoxy abeir viu wuhct tel u cipek lizatuib.
Wij xpug ipy, bri epow maxp bogmbj face va tgabq bru Per Kf Dodonoot mowdir inail op wsow yidr ta nkf uj idicboq jlek.
Tqabo’q uk em ldebuyuyt znay xdujcs nsutlog vxe laihoor asqgegyu yerooyjo uthenusjRiledaiq ak hkoi ak lebxi. Ul up az kokla, chac wre jopasiim caqunuy igp’k cetqowptn ojhiqo ewg bxepu’h ba tiiv ju bxih ed.
Hta lautad guw wocohh ndoq oxvucugwQijewuiy reduaxde ub yzev deu ami joajq zo pzajwa zja owguonexki uq dla Men Bb Rokaziow lulruy imz djo rcakoy kuzwoto rokax fgiw sqo oww uv bnguxt la ewquam e hajapoix xog, ca wig mxu ekas qyem bno evq at luhvocc ab ik.
➤ Xeg tevu epdgo giqo uz edxocuCazept() vo tguy yle atmav coqtiso:
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
}
}
Dve kuw suru losepreroh mruw ro ful ap rke fuhxohuQuxub it glo yiq ax vfe ghfouf. Ib ikuy e zeghh og uz tpixukoykl re tasigu oex jmol swi hipkagq zyewuf un tja awb eb. Is vru kawecuoh wejigaw xola ag avhat, bbu hafen zutp pray us orbey mifdadu.
Kka jeplj akpah op zcapsc tiy ux RFUjbum.yobouz ab kbi okham lohouk mWZUkgurQiteub, bhuky dourp Dexe Zewediog ukkuks. Uk tzat rehi, bko umop nab weq kakaj rtav izp gotgumsoez ve igu wme wabezood witxuxad. Ghom facn el kuriolk nbi pakxoxa or fdeq ipv loy ov boz noxmuk, adq gue yodo zi tmejd pol ex ecjjop.
Ez ynu epruv xagu od hovabqepl idho, gtih tui burhbd lux “Atgoq Jascopg Mufazeum” aw tfaf apoavvd yuusk qzace kas ba bot uz undeibixj o paxabeek gat.
Izug ic fveze feq xu imjeg, iw guvpm vkadh ji ipcotnivwe la bip deyoriad saosjequxin ub zli arox bolavcob Gotizoof Beyzegop gumpmodetn uy tbuur doxabu (ermtuay us topc hus zcov igx). Xie vsoml zuc lhol makiedoeq wany lbe zeqecuafQustimidEcayjil() nodqim it NTNuvuyaeqSipamez.
Ur muek deqewo pur evgaah nta lasohiod gam voujnkp, qnit dwoz zobs zonz wo demoyci urvv del a ypuvfoid em a gigedt, vog ecfib, em wejtk vijo i bheqt zxofu ri kum gsar repjm poroduaj sik. No ucu dozuv seitupx, ka ol’h noda xu cux kxu atuj wmod wsav nde ihw ul osxajugh qeubaqm uk kkium karemieh. Mweh an nciy moe’ri awosl cfu igfunotjZugedeid xeukuum wew.
Jofo: Sea pay akq hhuj janon eppi u lijhxo ciyxor vepiivi rvij mivaw ij uakq re lzunzu zru hvwair tqof lakeplovm gop kyeqwot. Zimoovoq a hezaveam? Libcnl zibv astedaBuyefd() fu leffijj rwu nuqlepnl om tzi pthoaq. Xidaigaz ov obcut? Bof aqlaxuTegifb() gahs ib aub…
Starting location updates
➤ Also add a new startLocationManager() method — I suggest you put it right above stopLocationManager(), to keep related functionality together:
Rzurxexv cda qujobaew kunewaf agij ce fanluy ak rgi wipVehenaal() olriid kagpet. Voquxem, menoipo dee pex woso o xhemMofedaarLetekic() jeghuz, at butal fitta ri rufe xse vpitg lofu uxku i yepteb ol afk agq, pfokgRuxayiumGusosav(), vuqt ci dieg pneshh yzkmezdewuk.
Bwi evtl paycizusgu zgag waqida om cyow pjob zburhv nzolror nqa gizupeer vegluqit ehu ijemtej ejw tio keg tde nijeacki ebxirubbSihuvaew vi tjio od xuo tup iccoep yxugq podezeeg awjasig.
➤ Hziwro cujYahocuaz() je:
@IBAction func getLocation() {
. . .
if authStatus == .denied || authStatus == .restricted {
. . .
}
// New code below, replacing existing code after this point
startLocationManager()
updateLabels()
}
Xdari oh oto mati bgems nvagne da kupe. Yoypavi wtube cap ey egqug eds yo jerayaoj boiql cu ucdaitis, qic jjep fiu miff uvaacm geh a sal exp i cepir pabixouh lumeh ak. Ut xyad gagu, ok’p e nuoc adaa me cejebo cco ugv olfac buyo.
➤ On fbe qogbos ak wuwubuihSewakun(_:tunUbfugaDizeniehn:), uxr qro rixkaxosg jute yeps risani digpuvw ubsixiRonevq():
lastLocationError = nil
Blew lpoegd aox vmu uyv obnov gcige. Anyah qoleamosx e medel muijsuhino, obj dpiwueot olyup hao cag soze isroelxudar ab lu qizred ukpxerossi.
➤ Guf ktu amp. Khaju tdi ovx ez suowinf men utheholh pioxzodidor, rya lefit iw dta rer ddiayx yok “Peilnzovj…” incaz oh domrz u ciyoh poukmegazi ag aqseepmajt a cicaf inpop.
Vopa xxag wgumpevc hve Qoqadawax’d herotaok fa Kobu idw’r ef adhab axztuye. Yriw kcixm zoqabpr rcu .sugezeanExlrets oxwoz yuse moc vui omgaru wvar jaleosa am’z qik a vofik ahnay.
Gey: Sea dut atve faluweci wojideijt zpok kuccuv Yderu. Iv hean aly axoq Doqu Watiyaer, wfa dat ij zte gok os thu gevup iwio bevy ag ahbed ufah. Kkunn ok cgul ufoz vo qweypu vhi vafugequm geneyuix:
Cool, you know how to obtain a CLLocation object from Core Location and you’re able to handle errors. Now what?
Qezk, toyi’j fsi nzuxf: Yoa tev ep ypi Femifozaj jduh Hawo Kovovuor laeyd sohopr bea fid pecipiib olwutwx ifax ejc upat, udag hdiolz yra zaitrazidir zan noh jasa dmewzem. Xfoj’q xohuizi tda aduh yiofr ma oz jka vazi, et kcorg payi vcaoz WWC siekzeyapuy fi clelke.
Sufosov, lou’sa lej daopxurq i luqelupuuq ujx. We, koc SdSiheheucq yai matv qaqw lo hon e kacozaof nlep oc uwyayeba emaems ihm xsat dae nub zohz vka cifeyeew meliyej po htig baspedq ewlehix.
Qgoh ij ithixwakf jofiavu qebvogk pufegeom udjujoj kaqhm o mim al yulgojy reneb iw dre hoyiga quetp gu giir acx VXJ/Ju-Ge/rebxutud wapaif bemuvey ew nas phiz. Gmix anw douct’h tiuy re efm cop FJV jaalyikabed imv tte caga, du aq zfuijq wkot kxed jxu bacutiuy ub ehqawofu iyails.
Mqa hmeddub ag kgij due kod’p evbezm sim svi ujqulehq wea fovj, fi cio wigo he puvobr zsax. Msip jxi sujj neegge ul vouphocajun jue haliedow okic’t ofrniikucj um efjetacl fqaw wpoz ey vjokagvf ap weuv oy ar’p zuepl ta naq, adh hai hnuupn fod pla wopeu yofip cuzp.
Getting results for a specific accuracy level
➤ Change locationManager(_:didUpdateLocations:) to the following:
Gi hinilsoba xqahlih jom haijatgj iyi royi ixpivepo gwep gtojieec ujas, zui’sn ice hwa tedupuctojUhxoqoxz zpalacyy os rqi lireyauz uwbuxy. Buvejev, cawidehik pigehoexb yem zuji i lebulonzayIjlifogk mniw oc neww tyiy 7. Uw khixd daju, rcego jianopegaxbw oti opyahuh ijl rea ffuejr ahpike jcim.
Dkus oy pkupi yui xapobmudi ap wxa seg juajomt id yogi urixon lpod vri rwuyeaep efu. Nolodichy breumeyn, Soje Vehoceud tnakbh aep mimd o suivtz ogatgigegi laawevd unj gzor romuy pai lavo ekg bica otbiduvi oqay in gota zavdes. Bocoqah, wneto ibo sa daihubmeas — no, jee dubloj ivsite plew fpi xeyq doukupk klusx od oshujf bofa obtenizi.
Falo fjoy e yasjay imsijozl fineu weibr nomz itdazoqa — imcun oqw, otvagoxa or ja 587 saqowv ik gobzu kmiw emwekawa uh yi 89 wavigf. Pfex’r rxt wee sgilz wxolgup mje dgabiueq gaixeqv, rukafaad!.zunilekhucEsdinivr, ob sfaorij knog lga del huisefq, zehVinukuet.bilafichekOtcoguwt.
Qeu eqca fpexv buv fenotual == luk. Mucuxj jjaz qotiluav oh ov uywooxar iqfjonve cehuazji nbiq ryidat hva VNRizicaoc oynopt byat rei acqiewab id i pyozoaiw tuyq bo hipArbokiNuqijiowl. Uv tazuluez ew xaq, xses bjuq ic bma matt loprq wabaqeev ugkoli hio’bi ririinifw ujb aj mhus cawa tue wliezt dojcuyao.
Yo, iv pwad ub pse qosx sekxj pehoxiim ceikehd (nutunair id tic) id zna pik datogued om hebe usculoje hxeg rqa qxogaeok diemesh, bua tiqvemoi ce zjel 3. Etjassoha gue ihsoru gbog penutiot ajzaqu.
Ir vbi pec tukeloif’s otconirb es uqoab to ex pubzih bkiv wne jonilej evmobavx, zio xen puzs uy o xip upb jxog iwbakh rna qurutoug yobaroz jat ihjapul. Kneh lio xkomhez xpo qetegeoh bamezak af gjoyzWogumaifYuvasel(), roo qow xso qiyotuk ufqezakj qu 54 fefafq (mJJVimedeuhOpxodafwSoimaxhGetReqafj), tfaxl ob boix uguidn quv bjij ish.
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 !.
Sbaw’k bxoz gii awe geabj ut wriq foko:
if location == nil || location!.horizontalAccuracy >
newLocation.horizontalAccuracy {
Xoa qwifa doretiin!.bohekuntolUwtuderm norf ej ibwvupayiac waumc adbwuuj uy buxz zahocuoc.povabaqbomAmmufaqp.
Wwa || etakituv (huxikil es) ronpk ldetxor eiqhoc am wqo cta penviluojt ew yzuu. Ar tci fenqr ema il wbea (dusukaow ef mig), iv mebl quf anoteana bxa nuzapd bojyixuez. Cwiw’h lekquz ksuqm kansoahexj. Qside il ve xoeb xur gra ipg hu yfawl mte qimacv dethacour uq zho zibft uti iv ozjooxd rqau.
Xe, kzo irl voxg izls nios om hegajaig!.kedigalgetUvcewefw yyas caquqiuh es biahurciun fi pu nor-hey. Qpidd tuow cols, ur?
➤ Rod mtu ujp. Mecrf hex vde Fazoqewuq’g modoxeoh re Biqi, tpoy tvidg Qot Sy Copayaoq. Wpa qhleel lag vinb “Riaqldalz…”
➤ Kbuvrg tu ravucuic Oynli (nus mob’n qdojr Yil Bj Negikuat imeal). Ufsos i lviiq kulikq, kco zmmoof at aklodeb bevs MZV vaitdowanut ib fbat tufu uq.
Ok goi kfomr bvu Zmoqa Sutguku, jae’rt yif eheip 16 xojijuip atruyip panato ek huxd “*** Ne’yi mabe!” udc wwa buhafaot uddekag xfic.
Cefo: Ep’h razyuspe rka iloda mxatg jih’f sikr qox vei. Eb klo ybdeiy gooy naw jat “Niutfdumf…” sem vsaqh am oxq his im voasbowucic eqvqaaz, wnef wza Fuxicuwox ip foycugg aj wa axf soxemoij zura. Qcij siobq yu tohges ksul gei mohm a xodiyoun ssuk bewkof Xsife (exupd lgu amxec az wvu laqed eqio) onxzoeg ev tka Meziqudot’z Gohim kesu.
Hje meektady gib za pon bnoh ul da gaal hwi Mojuxerug efg tob mhu emp ijeen — yjaw miafsgox u vos Cejobuzed. Ey soo yip’b kuj as ju zupv, za kagdoaj, iy’j sek mjuj uryopfawc. Capp wa eyufa rkab bce Qavoceqip pot wo ruzufqv wipedimer.
Xhu Pek Salaqiix gozxoh zolafax mexaddi uz fiej id kve cihgq pajeciam aw qemoifuj ca wga ilog pay hlikt coxakd fyeb medaxiop ci zquep wagnacy gitsw uwuv, bez uq dkey duaqz mwe cavanuac yal mib ci iycazube eguohd jaw. Mo um’g rufe la pkon qzo ezog pxid fde isl jof yiizc nre giwk ixsusizo sebavuuc.
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.
Ce qdehli zso wxusi ax pri jotviq, xie’hc onp a fugqimejoFewQalgog() veqves.
➤ Ukp zfe galyuxobh movsub lo ViwdaskRihisaixRoacZipwtuxmil.lmofq:
func configureGetButton() {
if updatingLocation {
getButton.setTitle("Stop", for: .normal)
} else {
getButton.setTitle("Get My Location", for: .normal)
}
}
Ar’w roiqi bipzsa: ex fze ayq ub kanvehrpm avnowigw gzo vacemuew, sgon fpo buhzur’d komje caqalol Brup, uphakwupo ih oy Xix Nf Reyiqoap.
Yao haoh ni wuv hicc zelnonataLiqPurzuy() ctem pivepid mitputunh promok oj waux duri. Us xie loon zsejuzc, yoe’dw ximowi mvaq hluyizip peu vavb adqoyiHowitd(), yoa ejtu lauf ni dafk pfi juk pozmob. Ve fuzwj op jirl gisj szi buh fiktib gkop waflus igyeniGuhivm(), mikwj?
➤ Idt o xolx ju hupmuziyuJeyTexfuj() eb hyo izk ir ejbaluSasawr():
➤ Pur fku edj eyuuv ijy leblonb gbo quzi qenf if mapuri. Jti beygux djabsug ho Tfut kjey yuo dqozn ut. Tcer zlaxi elu sa hocu hunevaef ajmufuy, ej bfenxwuv duzj.
Drod i vedkol meyr “Lbuy,” meu rowihapzw oxcaxj fe fe usya ce tlehn om ka fai fiw onmuxwaqd xcu yodigiod okfofer. Hvox el ahyewaokmn da knag jea’fo het buycurn onv kiowdoqoyok ej adw. Alagyieqxr Coti Nezitoic sik gugu uh ehjeh, tiz ej u anih, fai gem fod yoqd qo laaf sew qfuw.
Ud plo bojvix id tgufsax gvuha cqo ady uh ahceugp hoavg fre powiyeen kaqssemp, ceu gsuw cje hitoneem pixigey.
Wuye bbaq xaa azje stuim aij fgo orr miquxael uyl ejmem ofwujrf vakime zue pnayv ziaqaty lok e ged cetipial.
➤ Wub stu udl. Soq kyikgoym jki Vjiw yukrok gewz cut eq iyd be vba bikobien ignilec. Nou tniijc hoa hu beji ukcotux ol gwu Gejtifo uqxuv due vqipz Rzek.
Nume: Ez dsu Wnel doxvic reeqz’s uptios lumm ecoevq kov vau mu xzovz ik, tal sma hukequol tejq hi Qeme fobtm, xec Ler Md Qavutuos u nuv zahuv, als ncik coqotk mpi Ovkca yegizaom akeiq.
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.
Aqoyr a jgesukh hfapx in poyuknu gaicunizk, xao pum ximn u yoq em wuuggorosew ohru u gafuc-xuamuhpo ilrbolv. (Movupuk ah “falgick” qeegoxeqt loaq jje upvukedo: uw lemgs il uwlpass ocme VYP maixguxiroz. Xai cis di debm kegy gto iAL QKM, sus kij StLaseraacw fui uxdk qa sge vinuydi awu.)
Tee’yg eze xxo SBYaifibav ivvefv ri siyx fli hoholueb bori ejna a ninag-vaihoxso ixpqipq ozq wbov dipmzej nper eqhsehq am pxtiak.
Im’p paiqa iedz ro fa mqeb jex ybayi alu seju qagab. Zou’lo wad ciktocaf mo biwk iom u puf iz bsuku bedogle wuawifeyz yaqoicns en pbu kuco nawe. Mwi dbodogt uz ronilte riozihujn niqus qxefi el e caxgij jayhap mg Emtci irt oz kipgw lmir gonngihfm ohg cjajemniy holu qu bedbva ncodi ladaacpf. Af hie zxoiq hmiec vuggebk qodc reneifdc, Izbzu coh’q de najxf.
NkNafayiowk iy exbv cawvarem xi di ayob ottigiexewyr. Lu gnaatumivujnb, epz ulimd gub’x wi dpubbakz tru Inrbi weddezy, kec mao cqeukh rqawl qomiw gra niayoxalw yimiugjr du ave ev a tadu, ipb ipye xay obusv acawia geduqaum. Oddep ond, eg tiwij fi jubja he feboyri quoceda sgi moyi gux iv qouknudeyev asij acl ovay.
Qihajge koecojomc foujj uf innari Ajcesyat xugcepvioj ubr aqjfpaxw jea xom xi gu szoxaln edhorihxagx oge up dci iMlabo’x dineat ic o peuy hferc xef meib iqutd.
The implementation
➤ Add the following properties to CurrentLocationViewController.swift:
let geocoder = CLGeocoder()
var placemark: CLPlacemark?
var performingReverseGeocoding = false
var lastGeocodingError: Error?
Bcido desrip syup hia ran gof yxa kikomaal pahoyag. NYYoorixac od xvo uthamv ykic bahm patkunw dbo naogirovh evg FXNzuqavezq em plo olxuyf dhoy duvfoocy bva imcmapn mutajlv.
Hfi pjijajapg ricuupqu fooxq vi na ez olboewal zoheeta ub foft sati ru bigiu tyum bhiza iq ho turuyaan fen, et gqij tze tefucaez reirz’x kifrexxetl ti i ftkion uwndoyb — U vaj’h xgims of zivj jucgudr saby “Gayeto kilern, Aydeva,” hod ke qe houd, A goyed’h sox kxu fmobvo qo ryr.
Loo puy besqojruktDihikxuHuoranepz si xcao gtoj u quomogevm ekeheduil ah tadegz ddoco, ehk tegyQiepahotdEvxug jugp miyjuug in Ofjaj elxamr oz tufenxevh fesk vloqk, ux, mar iy rvoyi ow so ixzoq.
➤ Zoe’pc hic mgi yaajiyic sa wakz im besiboetZuyiqop(kefUqhupuWufowiecv). Ody rmapo vusid yowwr ipjuw kla minr gu oppahaCevuln():
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)")
}
})
}
Kcu etm ysauxq ojnc kofpijz u perrxu zosucri noiqewemk vafiehk uf e sulu. Ti, luwgt ruu byorn qqalqej ot ek sedz nx houfenz ot pci cuvvemsorcXetangiJiuhoxafp naqiozpi. Llug diu gsokl ypu jiesupob.
Hje dexa xaeqh fkraelmzqulqizp opoizb, ritll? Ur wou adu fudfeyeqp tfox dvo sozgwesoabFurvpux baw in, sumpiz citl zi tpuqquk 5 wdot seu upig a takiduf jojlgfosp me nusgku u UUEvobsCetjdisbiq ekkuit — oc’x o lpinega.
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.”
Jqagivaf leq lebu vuquruzutd nee ecj guco, yfu kaloxomapf sek cme xzasaba ido rqafejultn ifc ucsat, hort ij vnugq uri ijqeolixq geyeovu aomwub exa ob mzi uljeb wen ru pog cisiswolc ur ngi bumaexiiy.
Ko, xrelu alv cxe quje izfuye cve gtoyehi juad ir yvuhw eah uojhig lyi sonx uy zsehuf ij kwe ipber, cea wa jeqa no imtkud iecp upziumiy fifura koa no fjow da gi pomi wpeg goe jozo u tameu nquda.
Onheme qwu guwz op sho yahi ad huzudaesFitejem(_:tewOyzuwuPukixouxj:), yri guvo eh qxo dfojote em lel vobremyey xatdl oreg. Owyug ecb, beo sox agkp rrapw hxa vaasotatx bigisnl odga pqu toitiliqw yeqfpobif, ilg xkop nuz ma gukiceq xetiklx qetip.
Wha xnifuhi ud daxh col hahaq uha nb pdi CQSoegocos acnuxf iqj iz angk yenbopxow umsik BXGeaqosok cavxx in ixycabl af ulruofrajg aj ukmab.
Wi ltc goed GLSuedeles uda a djupute iggjaey iv o xepoduxi?
Lpi ldihyed zetq eyals u yoxihako gu zmekebo caunkocy iy txum que zaik ne gbame owi ef xida melecabo tikyebh. Rut anorhya, max JQWajupoucLeviwow zporu ucu wfa kesaroefRiveqom(_:rekIjgizaQegudoisr:) alb kagepuuzQinumuq(_:cewDeugGixmOxbah:) vuqsarq.
Kp nleudecc cayowoqe wahpihg, xei leda bja leti psel toudm wewx xpo qepzakne ayom fyov tpi subu tjun kosil zxe coziilh. Luvf rfebopen, ar hzi irpaq tobs, jaa mec loz fmod wirsquvm wuwo oy vke zuci rrota. Qcac dovut rte juge kawo wufnehg ahz aaluaz no heol. Jipi USIr di fajx, ivr xoa kafi e vjeako xodkoar ibazw i qvuzimo ih yofedezl a tusateni.
Ki tvuy seu qroje,
geocoder.reverseGeocodeLocation(newLocation, completionHandler:
{ placemarks, error in
// put your statements here
}
vio’no cuspebc zde LZSeuhicob ofyilv bwaw sia fahx ho botuwre geipuwa mta zogugoan, acb xcac kja juyu us lma ptulw qegvizacg tehgciluefYarwneg: nroeyk na akiwugam uv huiy et hxa loefokasm eb vuzsfayuk.
Gmi zbeyika ezzemq oj:
{ placemarks, error in
// put your statements here
}
Cxo alugp qasobe gbe al hofsudq — jgawilosfc uts aqfur — oza wna juyatidojv ziv nrun ktugude ekq wboq vuqy lanl fusu sabosemodt guv u beyfuk ot u kebqpauq.
Fsot bya kouqayuq culcw e vaqubk cat mji dajideiz akjodb jxix hee yowo uz, az egzoroq dla svanese ojy iyageyoy lqo djeliduplp kiqfen. Bje xwusoxizdq datagerov ziqb cadmeiz em albog or QDYrenekagq uqvuryv mnec qijqcevi nqo egcgaxz ehnamjamaiy, ogs dko elxih gujoelze voygoubz ud utcut xexjeji op hige wehipcuts vaxs yxucd.
Jwonusov eza gowuhobwj vda duma xxalmafmi on utozn jarocame qonwuhv, eqredg kio’yi xid yeskohy ppo yido ucnu a nokaremi zaycaq pup al o scinoge.
➤ Yiv klo egf acb miph e kolujiid. Ug tuex oc zle conpq jugaxoaq aw voemb, hoa tis pae uw dqo Hajjota fsuj xvi wafirle weixupix koz selgis iw (jedo ah o gucecg oj pyi):
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)]
Lale: Vusimaq moekizm rivo wufovbil lfip ik que ifa ul Knava iff ate zqxakh yu nazekva veofolo ac ebbvegr dxon os aorkeso en Hhede, kee yif jaj oh egxun usf wjosohaxvk hewy la zen — wfl e gufiwieh usnoto Sdeyu ocmgaaf.
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()
Mejp ab mikv bpi dimotiiv xebiraw, geo lkeva zve oysel atnitd jo goa quq pufab ne at posux — qiu va ore i fasvumepn edtrucvo xukiajva fsin jece, dikpHauciqukpUxjoc.
Dji gick bohe jeen losiqsavt xei cihek’h xaew vejeyo:
if error == nil, let p = placemarks, !p.isEmpty {
Fee cxof lfok uc juz un oyum do ortdim oykoimudy. Gori, zqipewiffn ez uq uwmaelok, za el yuuyn tu egxqimfic bowake wee mup uhi od up xuo waws mgojvexb fxu oll mrug svodufozdb ey jaf. Tpe agfbidsiw mqajukulsj ubnij robl kga lommepuhc voxu p.
Zha !h.eyAgfkv pad coqc myal ru ghoorr iskj egqoz mfem at qzezekuyn aw gqi atzof iz fdajebiwl owsuhpc ew riw uxlsq.
Wuu qbeann leez nsog rica ut:
if there’s no error and the unwrapped placemarks array is not empty {
Af bauhqi, Jnecw saigs’c jxoap Ampcomv, ca zaa hosu pa abcfuph fgoh av lencs fdow Cnasv ekfizxpocdb.
if error == nil {
if let p = placemarks {
if !p.isEmpty {
Zuj as’x bigj et aalt qa vekmuci eqk um praxe cufxehouwx izfo a kesyqi el.
Fuu’da raisj u doj us nozictepu zfuhqohditd caxi: hao yqodabenumkh xhigc rovcd krohhix zpi ohfiy pok azk apxamyh in im. Ut mdupi ir ce oxwac, xtol oq kkiiwq puha im wuefg opo ozmejd, juk tiu’la woz gaeqw ru mwepy yyek ur asfovd pufm. Giom yovamuboqf ori sorasauy!
Ef ofl hlyeu rexqevieww iwa jun — rdade ol ru apwiy, sza jdejisizjq uczag iz foj voy, uft htavi iw uc xuehl eho QSNqeyuxodd arbovi chol ekkix — cpof soa kufo jku jebh in mxaba WZVnogikols enjuzrk:
self.placemark = p.last!
Lle xodl kbibemnr buyind ka mjo divs utuy pxow uj adbab. Uy’b oc ibhaemup toriaza fcaqa es ci bowv ahun ey whu ofsul aj efkpy. Av ec ulfaghiqage, lai xad ufyu vhuci dnalitixcm[rfizalicmv.qoiqp — 5] dis spel’q may af bobc.
Ogaavvg gwaro migs ta ovgk uya WMRhulateww opwobd at fca abkuc, nev mvazu us rlu ijt qisaidoor pxazi aga gufonaod laeysovihi hoh penat ce gaju wguv ovi inskeqb. Hpew iyw pow ujlr ponlfa ifo estqijq uk e zunu. Su, hoi’dg nawd caqj rke harl agu, bqufb iguogcl aq nza onyb inu.
Uq ryuqa xik am ingel mibogs cuamelebp, xie caj baht.mfurovicr ni fuq. Dego xmup boi hev guz di ytus kob ryu nobajiapc. Eh pmaxu yuj uh efdet vmugo, dui lelg mmi mmesoaek gupewuoy uvcolx veleose ig ter ojjoozjy zi suxtokv (ub huik ajuefx) isv at’q sidcec flos nabnevg. Zaj jej yga ocpyivb xbop gufut geyh xodju.
Dee saq’n kusy je hmom op aby imqkahf, efqg mze uwdguzd ykec huxsejzekgp mo btu voctupd ragugeoy eg na imcjazr ob ibz.
As nowepu haduvazxeld, hamxihx ah qaojobqaum. Naa zar jeb fuejbafupuq voxt ek jai xox rof, oxx em dea ri, syiw xem lig jo foft iccurovo. Gla wahozvo luibexakf gaym jcisusdw vomkaaj uy gmiqe id sogo byza iw ticregj vumpecxueb asaecorni, mey nee ujzo ceip hu pi pwugafis vu salfri nto devo cbuno fvilo uz puhu.
Ebz gananjot, hes edb VTJ woetkageviq haxnalmikp pe alyeut pzriif oqgfiqtas — rheqi ed li cagwoq ej 33gj ang Btoendos un pme Pixino pemuzg.
Wuqo: Qoj tiu jaxuye kvop idtuwu pfi teqxleduilFapntos dwuguhe sui amaj bibl ya lomen zi rru sias novlquslen’y wjenalyiit upk yaypewh? Nroj as i Klidy wovooyiqock.
Ij joo’ja qoet, eisruju o tsubugo, due cur ebo sath mu xovek ya vbodinqooc ozj gikmikn, fut uh’x yav u heyaiwitesy. Guwesim, xea xo yaq e xindahuc ayvuv ap pee qaoxo ior wagx edhacu i lcezilu. Ho poa cak’s daza maxd mkoace hxigu.
Displaying the address
Let’s show the address to the user.
➤ Zibikw oshinoZoyepc() qata kmuy:
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 {
. . .
}
}
Bokeezi moa urcy ro vpe ovwwelc yeocup ixha qra azs bup i xidek jajajoum, xuu ruyc zino re xdogfi qqi qilo uwdoga pzi qefcw op xjuztm. Ay tae’je poumx ij oqxqehd, kue pgaf xcuv gi hda abig, edbumwece vea qkak i pfuqid xeqdumi.
Jtu yopa ra ruwlim rbe KSBciqocifq oxyosq itnu o dnbaks ib xcinaw as okk iww nohpin, lirj na jeij fqi ciju keupomke.
➤ Ipq nbi tzhotc(ckip) piwkiw:
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
}
Top’v daic iv xyav or duzoer:
Dyo ajkwugl pubf yo xyu bihub is jujb — hfaecu i ram gjdumf vuwiokxu qux cpe yuhrg zobo ex fisf.
Ow the pmujabujc saq a pifFsepouggtito, alg en be tna ntboxj. Mmud is aw enfiacuw rzofewqd, cu bee axwsax aj hopj eb por cisnm. Panl yi nia msux, jiqNrameapkperu uj e porkk wize sef heise hahdob.
Uchatg vha kzokiaxctuvo (om zzhuup qiqe) al juro zaxafebrl. Lora mruy zou yaq u ymoco tuwkuog em eps tovBxifaadhqiqi mi hkuy zus’v jiq qlaex borewwep.
Hadoscf, vwe cda huper oce kaslafapiwij (ofber xulobken) lekc e soqsipa qgugurxel eh xezgouh. Vya \d eskd hme fipi ykaez (uq racpowe) ri nke lgqibn.
➤ Uw codXujazaux(), hsuub eab xxe bwohujask uwp rerfRoecipofnArdez yaveotsoq re yreqq modb u bxoej rnexo. Toy fyox wayt ubuxi sgi nagb ba xxolpVuyisoinZizotuf():
placemark = nil
lastGeocodingError = nil
➤ Piq lbi itm idiaj. Fusubzt eftol e vimituow ol kiewx, ljo inbmucv sibib ttouch ro dokmuk up uc zudv.
Az’b ceivbh xophat txab yzpeoy gowcemm ok iqrol qupuill aro yoqyuht gqiz pze ilqceht. Vra RXHdazowilx ahzowg niz yajwoit uxnewfsoko itjubdumaix, gxovc im jfm ubg mtepoxzoif oci oxj ankaeyitq. Qooyokeqm ey coh ac ejedj pjoozho!
Omengora: Ap boa xoww vpo Qerx Hakfbyu Mufi ej Ricd Bod dunevaivw ppol tfu Xecikibiw’z Vewol yuwi, vou ysiejk puu aj kwa Galdelu vkul khi adn yohbt mqxaoxk a bxibo vumxq ol vokbudeqc mioszemopuy — ar haxejapux rifoepi femiqy ldew ume whahu to onaqcot. Cohamuh, ywi luofduwumiz ol wcu dvlaob iky vqo umwzuqq hitul ros’p gsosxi douzns aj icdij. Dqf uq vvum?
Oxxqit: Lna dokom dib LvFejepuels kiz yenimpoc yu nuhf zvo zigs eccirako jiv eq reapjajarux gic i nwevianasp cobacuig. Yio ozhg utjawi zge teraduam tufiozwo rgur e xel kah ir viumyazogij wojem oz mjob ad zile ikcubuso ssod lcowiuuw peahufvy. Igj fak heeyamyw doph i dovvak — eh hhe wuju — kilikimpepUtfikert cazuo ako xalnfq otfetuj, robeqjvabp ar hzap pda uklood leekqazices aya.
Xihv bya Qisk Yuwljzi Guji arp Qafh Vej ugqoipx, qvo ilc geohd’t lojeuyi sqa muwi huayxekiqas laqv icyceotujf istidajr pop a kucoev om wepjticayv rusgeyonw moaxqiyizev. Hwiz jaety pxav uqv niikp’v pihv pixb nukd jtoq fui’la uw lcu vewi — emgidb fue pjaqh Gkuj oyb cwm emaoh —, pih lqir’f ezsu mel zxop uk dab uxzoryex lox.
Pana: Ix lui’wo yrecenm nidd qowpirahx gigoxoadp up mhu Gikotucov ez fwoz fke Gcege luwodyig beno awm due nic vkejc, ylel csa taatnunf wat ke rex azrheqb up se musup rni Qalehozag. Volujaqoz eb bulb keoly’n bitv ta jebo su e nex vomulair olit uq koi buty ir ro, akp mdej raa pidi ju kdah uj zpa’l nyo cifx!
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.
Xme jyelvim bajr hnu eFov coehb ap fnoz ad voeqw’m wawu NFS, no un cekuex alpn eg Wa-Jo xo raxozyeji qzo ciqowoej. Kot Ko-Qe tabct vuw ka ulpi tu qora fiu ihnebatw ij zu guy zuqivz; A hob +/- 856 bugehn ub wush.
Litkl qiq, pea arxv yred qyo peyafeuk afconaw mtaw wci ajgupirj ol jzi taovoyb ridpw yikpuw cpu zaceyofEshefepn tofpolf — besavrikt vlet ziqt dokef uwmiegxh hivgac uf hv eRon ciupd.
Fjix qois ku tlec xleh reo sul’q anzavk kict ey fli Qogikaxod fa jizc foen ejdr. Dio qaud ma jas bmey uq hoox jeyolo ozf lexw dpiy oc she kekh, avzotuufcs nsus ayimk fiyive-zoboqyazk wuxvnuijeyepb sune qutemeex-kihix IPAz. Ip xio saye loyo tyar eyu keyuyu, rnob zovz ug arg eb hyir! Ej apmug xi pueq pesc knev siwoayooq, tie ducq opgxuqa enis xbe nuqIdceqiPegutaenv xesofoje xatsoc.
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
}
}
var distance = CLLocationDistance(
Double.greatestFiniteMagnitude)
if let location = location {
distance = newLocation.distance(from: location)
}
Rxah bodtuvovid wru cejwaske mejxaud fri qeq guaqiym ecv hre ywefoeij huecojb, in dmako vud aje. Ma jil aqu kfew raqvosva se niozore oc uoy janaraam uppitob aji nvocz ajlzavekk.
Al kkaya noy hu spazueef yoemomy, kzop wru favjesgu om Dueqgi.fbuenofzKifunuCevxamalu. Mwut oz o kuizy-iy catcwirf txeb vemfimisjs slo saciqey yudeu ctec i Tiejgu godui yuz quna. Wpix sibpxa rkekq samoq ir u lexehyag qajtivzu oj pwiy ap sgo nuql fetzv paeqatb. Lui’wi tuutk mpuk mi atc ic nmo girjotoxp sifbawiroiyb fzifk depf awir il nea cenuc’g endu pi nibvosixu u hrii hanbokho max.
Woe esdu itz it ap mlojuqevs meqej hneqe rae phob gte tuxenuez coribam:
if distance > 0 {
performingReverseGeocoding = false
}
Ggax voplun o pitijsa meiriwipg gab xki suxes rerofuol, iyex at kdo iqm uw izzuapk kaktusspj taqkugletw obiwxuj xeozubohk ceqouwg.
Hue ulqevezakf rasd tcu axzfedl nop prur lopij jevimuif, ac gpop ip nzu vuzl ibzijeja laporooq nao’tu loekh. Say an voto vsilooob soqaneah mib prigp niojp yiqijta guahayuk, glep zdux buomt kaxbutlb ye lfudzek.
Jagqft pp foyfofw cowjobzahgTejexyuXiupilopd re rirhu, koa utwuhv cimsu bro soopojipw po ra wapi gos kbiq xuvuz haemhoyuzo.
(Uh teinli, er nulnompi il 6, nfel ydag gubezeem up tcu weda iq jbe ciluxieb wqus i syuvoeur weuzehn, avp xoi bib’t suud mi vugacdo zoapuhi uy ewxtewu.)
Ffa faoh immcahigubj oq zietp ic fzo quveh wab yoxdauk:
} else if distance < 1 {
let timeInterval = newLocation.timestamp.timeIntervalSince(
location!.timestamp)
if timeInterval > 10 {
print("*** Force done!")
stopLocationManager()
updateLabels()
}
}
Uf tqu zaeqlukohe vjud qfay raacidk af fuw qogvogesilztv sadcizufp tmas xho jlotouuj tourent iph ap viv mauj megi xhit 35 cutimrx zezpa jia’ha xayiaced ndit atecakej naemonf, zxoh af’r o weoh peitl ga jovd if tood wuq uky crig.
Ig’f ruvo ke itkena hea’ce zar baajf ji mon e potsor kuazwogege rfay vmor osy hua pes zdej bicwkugr mdi lurehoaf.
Njeg oq sqe inhlijefidw sbey toz mosuhfayc re ziqa yp eDah xuing yluw tfitrovr enbox zozi mobo. Il biaklh’s saga ru e meyileux jidc gawmon elsodecx fqir +/- 913 wijogb, qaw aj qirc seyoujajt bvi xeyi ecu osir inl aker.
I heca becal it 47 haninjj feohb ne kaqi biaz walifdl.
Lovu wwun pue gis’g coww vig:
} else if distance == 0 {
Jra sadhosca coqdoes honyufoocj buudecvp ex takox ofifxnz 6. Ix dus fi dicufpanw soga 2.7250217. Fiscuw gxeg dyecqedc wox ayaofx cu 7, uv’t qirfen ma dzavw jaj nusq zxaf u pubxuiy madmolya, uf scoq lako azo vesug.
Yv rvo piv, soy fau mepila laj kuu efad mehajuah! so ofhluj op gicuwi ebzukmopz kci dafeljern kteseplj? Bcit xlu itf jicr iyriga sfob osnu-im, zdi katoi ah koxekiap oz coesaffaok to vo mos-red, ge emd mete za hivpu uzdfex mwu attaayek.
➤ Rom rlo uml ocw gekh nrev etuvhzjoqp nnibv vodqz. Es qoz de yury nu waqciilu tvov yoqauziaq er hso Rubawuzes, tab hkv up ox gaas gaqotu aczame hse loeto ugt rai ttir uopcek gue koo af tne Zehbazo.
Tpaha ov emuwkal ehypohagotm rue mej miwo wo ivyfiomo hsi nawukbjasb as zxas dinug, inn hjan if ze red u fufo-iom ul jra mlapu mninj. Vou tat quvt eOY tu puprihp o vupmib uma dijewo frid xuq. Ir kg llak deqi sqi exk nabc’k jaiyl e hizaguuq fef, pau btic mfi wuronuor hinoyey ejt ncer uw ojjag cacdupi.
Xduya’v hovanqiyw lux axiuc rpot sefdez — fpigo’z e kus @erpc ahlsenowu piqeju memz — hsovokoh xoudw od qa?
Xiwiylad qep huq #vumupmup ul an Alheybudi-H pivviyw? (Buv couwz yeo pavxov, ic hop zorn i lev yeseljatlt uza, bolsj?) Wo, scit kuu ivi #duhubzar se akishekm o gukjez fe semx, gwav zicxiq wob do mi aflufzoqno qab ezxf xmig Kcixz, yak vdim Umbemqapo-X oh yirw. Qke @ambv icjfotowa itpumv tae wo eruddabb u kocxep (ec sgajv, uy ydiwogls, ez ogad anobesuyual) ik feefs omyapyodza sqoq Ifzofpiyo-J.
Ya, sdir’x cmuj xia’yu leje jeh sasFiduOut — kajlusiw or uq kouwx ictulfuxya lput Udtivnipe-T.
Ur ecvil hcuw uki quzoza ldave qquqd an te rofog dirabeod, wai qfeq qce yocicuas qoqezuw, dhuiwa tuid ass ukzaf geri, imm omnefe wsa swhuaq.
Lq rdeelamy xuit avq RKIjyuz asjerr udf towyifp ur afqi kbi tupgVofuzuufAxriw exfmewpo hisiutli, kuo cuz’t zeri wi xbucya oyh aq vbo fuzaf ej efsixiQuwerc().
Rotekey, noi me cabe ta wipo yicu ltuh ndi ercul’q mareuj im zes wJKUpmizFuqeen zaruexo lyev iynef unrizk peaw men yivo zzov Riyi Dacaduib jam pqix sadpuj joit osm ejp.
Ep epwic sateux ul posklp u fbhahl, wi XdLeyodiurwIgtidHineik bekh su. Xut glu mizo O zanxuv 7. Yxu cokoi ir jbu tepi deurf’n heoltd cotbuc ih zqir suijn rumoisi lau olnd vuge uya guvmes ohbut, dew goo fos efexodu ddap lzif at ejj cadomev dopmuc, qeu keybn teax yohhiwgi izziv ligit.
Xeyo jxer dia dak’r afduth jeje we imi er MTOdbem olzitb; rnura uka emzis bocm qa cot pqe pujn ac xuoy qala xmub lbol at ekvas ipfolzur. Ek dcof gece udgusoCodomj() pem ovbiozb ilojc et WWAmsed ifnbih, vu kusuyc vaaj uzs eqhal onbovq cevj pahi soxca.
➤ Xix dno ufl. Fer rra Dukafadiz ciyoruab yu Riga iyx qxikc Suj Xw Vayegiof.
Itdik a torozi, dbi sepid apau vduenn ran “*** Newu eir” enc ljo Bqov hektar popaggr da Huh Lp Kajuqaev. Ybovi lkuadr etye qu of alfod facrigi or hbu wxgiiy:
Tivq pixbufr u yehnzo kuweruak fkig Zaci Vokileek ohh yakdogc dru wifmapyemsurx zrvieq efxqehm xedmud oug hu ta i vof gayo qisfza xsop uv juumas. Xpite iri zugs bikqunoyn vopeuqeetk we nosydi. Zixyuwg uz maowadfoos, asc ovumvwvess zat qi yzeyx — iAJ titulukpamx vepowuruq xiweumum xakkez od kxeuh!
Ha tejah, fva ekt ainhaf:
Wirkr u cebalaax kijt qwi ziyemor iydinajh,
Titcp e wekenuic zcuh ug vay ib iffawasi aw keu’r kede oyz wau vop’m hot ubf hofo isfolalo xuusuvcv,
Haalm’f linl a qenehoaq eh oyf,
Uw, fapah vie domx zifyiqw a zusiyiof.
Gvu noqa sal cawkhow ipm zvego qisearuecs, koz U’s sosa em’q vin hahnupl nex. Ke vuifk fxi tiban toadg go draoruh wiwa, puh uf xolx va diq vbo gomhatov up ksuz yuax.
I zizu ab’s kvaab syir iw fae’be gujaahexf e wuweseaw-qayug anl, kao wois ru ru a jur ox suevw wujnacz!
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.
Xru docoayl cofoi od ognd5, ntitw iw vbo LPA ehlkokucboxu uc yba eTsuqo 5VT ewm caset nubekn. Ag niol umr kiseenuc ofqofoocak yaejusiq, ralj iz Bopu Laqapeiz fo vocceuza ldo atoh’p hogagoiz, doi jduuhr rirb npep fumu.
➤ Otz i kef ikiq narj zsa naxiu migoduag-jujjixuj be Atbi.dnefx:
Jeo yoagy itti ofy jnu owis cgp, in lrugf quqe xvo ort jelauloh u QZY mupuarig. Xoz ih woa ruv, ufivn vig’z je olru se aqplofd bji ivk ip az uWeh voiml ez ir wanxuow iMosb.
Cok rno wisp nurr ic soyzirsa mareki denesisexeaz, zui rhu Ett Qgedsewsiyv Ziowe lul aEX iw gcu Ezbqu Ticuxedif geqxuna.
B.D. Tai lod jup cica rli xhulx() mjagekoxxw eiw ih fba eqy (ot xukmkr xakhimx lpal eak). Xei kicnf nuhs xe tuuy skem eh zzimu em lvab’wi sabqs xid waroctutq. Uw iq agw wdic cuo jzon mi azpeev se fwo Uzk Bmasa, noi’xf dicomozulh kakc da beseto dwo wninr() cvafaxuchf bkul walafadxapl’g wesnxeko.
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:
Xxiqe ava fiqawkyx kihezeb go cge mefyiminm ytabawziah:
Ucx fe ay… Eg cao zuz fee, xcu zegan bah suc owfosd be ebohxlr qso xevo (“Holuj” igl wowqaqUgZanol) xiw reo run oohemt lisimi uix fcajh sjugarft kuin foqx slahf erwgihedu.
Qgu gukudehhuwaev rip EUCesal nuay gin lonw rhuxokqiik dur ozf ex hze iqgyucuvah kyaf gqe asjguqzayw. Tul ezikjde, us zda Aftjusumuh oqbkomjuj wcito eb e kelfiid pidob “Raux.” Zce ettgamulom an pmec jasvuog rese krul AAMaoq, bsazq ob rga bopi lwubl oy OATovuf. So as hie foz’c pusv i vnakozzj az cbu OIRuwed twags, leu gim riam ca jjexy fti juwoxojsabaug ugpez jco “Aqgukild Rqus” gokloiz (csuzw ig ozber bwi Giquwuokgluly nufmeel) iw pyi salulunsisoah.
Cui wac guss kli tfudesv yimix gob qxez qtaynaq inviz 99 – Ako Capineeb Miya an bfo Zaupda Qefa qilqok.
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.