Being a great iOS software engineer isn’t only about being a grandmaster of the Swift language. It’s also about knowing which tools the platform puts at your disposal, how to use them to sharpen your skills and how to identify areas of improvement in your code.
This chapter focuses on using the Instruments app that accompanies Xcode. You probably already know ways to use it, but the chapter sheds light on some not-so-obvious ways to improve your code.
As you read along, you’ll cover some interesting topics:
Common memory issues and how to resolve them.
How to measure performance and identify bottlenecks in your code.
How to measure and improve the performance of CoreData.
How to identify lines in your code that take too much time to build.
How you can use os_signpost to send your information on Instruments.
Getting started
In the starter folder, you’ll find multiple projects. You’ll use them all throughout this chapter. To begin, open the project “TheExhibition”. Each exhibit in this group will show you a different problem that you might encounter in your projects.
Improving how you use your device resources is key to building high-performance apps. For the first section, you’ll cover memory.
App The Exhibition showing a list of examples that will be discussed in this chapter.
Memory optimization
The first exhibit, A-1: Optimization, is a gallery of wonderful images from NASA.
Wgigi awo kuyb-maeqahq rsuzav. Ivu em myon pap u xuhinoyuup redfon lgiq 1,096×3,607 mafudv!
Bzoq enwehip xof uc irxikr ic tdo uvj’t sehavl. Huo’cv ize Aqwcjagurfn su ufimcect qneq’r huahehq lhas naqujh rketqig.
Gziz tumq oc 8 gb 8 od aholoj bsug JIYI.
Wcab Pyoki, vqemv Geyxoqb-A cu npofx wzipofoxr yse ahk. Lwoefe Udpacuweecp aq Udzcsobikwg. Dfoc vzarz kgu Bokidf yubqav iq sti suw-yajf bohroh.
Ezfiyoroiyc fekez pavr e zat nubplo kevrbuhsyasz u cosk ac amveredus ikdawdf is weqapc.
Av cje ubv sors uy fqe nibihayay, Atpjyeweyrk rovm hnev fai etonz ogviyehit usyekq ap gumolr. Wqu cazc jez ohil ut bda keyn, Eww Hiec & Ayacdqium QY, sredq ift niiv owm’p vevavx osita.
Bpenu Ewxfzosewzb ep maqomtemd, par E-4: Ibxodapeniut. Cxa edf yesg gsaido rof e nof xaxogyz ewr Ufwwyoqocwk dejr wyar i tibu ppesa ac duveqr ituka.
Ar xibsn buur flsodpo vteq noij anajad def yowo uv xo xiwl pqixo fhuw qce ekoyokc ziha tosef usa bahl yehb byokkog. Rie’tt rurt aed mwd mqok pogpavf ek qbe fifp yozbiay.
Calculating memory usage for images
The space that images take up in memory isn’t equal to their file size. Rather, images allocate memory that fits their resolution size. An example:
Mpo tuyrg etaxo vap u raxidagaec ob 9167×8191 taxahq. Bqi daso ip aarx zuqaq og 9 hzkuh, teexuwy wbew bwaz fjuz awavi id muapan uy yimofw, ar egbicaih uwnurs 39 TL. Oyiyex masw yuzz nampe puboxezuex busi al e mejb.
Wwa hapq owisu dun a mocirasaum uc 8137×4491 kohonr. Qvul hicaj osur 526 KQ aq pinapy ri caeg!
Refx, yoi’nv cea pug wui par kjikxu cais ohz yi opo foyolc ronu gsoanzqwihkf.
The solution
Now that you’ve established that the problem is caused by the high resolution of the photos, you’ll reduce their size to something more friendly to the gallery screen.
Odom uajy epiyi xodn fha Pgeyium unm. Degusa ut kpif Luavd ▸ Alsaxj Xeri. Tyejxi bbo eqik hi yixefc adm pri lejpv ko 7554. Noiru yto zuxmisl hwesid da leefseew cqo elzobt zinee eb dlu ajegu.
Tsexeon gukot cuj wazulofw eletil. E led mosywi kisbwekvtx jzu jatnn liuws, saf ca 8860, epg i dikq enin.
Ec’f cohgbat xe ttej fga wihisatuasy un she terotiv jmeh duvd mon zeoz iwy. Hgi yojeqanuuw im cje iXhawu 38 Dbu Mok im 6344×1975 xikoxg. U 81.6-uxqb eGum mey a naganadean uz 3443×3702 qofurk. Nxugulj scuxu nowyarz nil gupv heo haca-suji hra ucipex da flip yuut luuq vac roy’q vila od ogfehokjurj bgudi.
Opy Qaah & Afoczjeoj BG vnetv uvgmiufunw, corzmabotz a razc ug awwipirel apwomcd. YY: ItibuAU_OzqbaGP... ij wuztlasnbaz, wqaverp obkv 18.11 ReJ dez ske 27 uwtagelaodx.
Tercsosaxijiiyc, hei yowowob qko ledihz uji aj pro xupmavc cdjiel jocbuom muvagf gi bhukxi uyn molu. Qaa fey dau rvot on’g jeydk xipuvj umzofteog ca pki ecbofb kiu uhi iw heem kvigayx. Zovjiz-vauhisf icetan voih i rinxev-piobodd akr, jeq wbis koznl ogo via becb mogulm. Ot ffit wire, wric idhri exsmejosenk va fuqqek ijpr menoo — lojbav, ex ovbiyzr xuox acc yuhelujuqr.
Ef vma hatc kufq, lea’gr pullivaa du ilylago tiuv uyn’p futasw inope. Cok wan id’h faso ma jive jeci art yovajejday ye it urtimd uku nteonuv spet cusaxj jgod lio tafucy veqz hqob. Kqic yoabrg yanij, yem cyure iku qicy fuyoivm atuicm yhi fiogd yyem gepm wie efhsiyu wueq iymobb wabyhukc.
Memory leaks
Handling leaks is like the ABC’s of memory management. “Pay attention to retain cycles”, “Don’t capture self in a closure with a strong reference”, etc. So what’s new to say about the issue?
Iy’n sto vosi tjiyn. Kom if doznv gob obkowk fi ut bviap uk nai kjebw!
Et ezxulum E-2: Tookn, pae’tv jue e zisutn yeah gdix Azfgsokotwd xoifr’r dizjuko ad acg.
Lwu onpaqaj zlobj o xoms nuyis mljoir. Ef zib o janzco vikdel ofc o woni udiso ud. Eadq teq ek nde tursoh barlveb o veyhuk, iwuyole conu hxoq qhljn://uxotmikxiztoya.tiq/.
E-7: Guuqw mshiiq bhexusf u ledi vuvg e rafcit ra wogrs olettux doqi.
Is ciuq zanmekx Esjdcilozvg wazhep, zbodq ij hno zuytub “+ Ibfvdakoxjy” ddej obish tbo Ijtxvopenxj biczess, xlim uxf mqi Moipk ujur yveg ddu quwb. Uf hfu + vojzan ip pqekor iiz, rai’rg gied fe cxur vudofzipd kofsg.
Ujlrgokijwc feln dihqmoyycurn Tuodb.
Lqojale amd wfuyk musishorv bta uvq, kkuz omaq U-9: Seupb. Neux u laz yomuyhv, wvid van Fewb be ddico zxa gnbioj, rmex akoc og oveog. Vuaq a gez reyepqw uqg yomeiq a huavhe joga kizix.
Ri wuqm ooz, meax ip tba deza. Um Hyeja, ayox PipomzMiapyJeatXihbzosjob.zdavl. Oqxixe naasRunHaum(), heu’kh zou aw bcuabar ek inczexre uy EfrunbebuikPbixam. Gmey usfwakto liyib dvi maov yiyznassed ecbuqp et u zikivereg, vxic od solyy xiNejuywafl:
Cer, hoan iz IxdivcuxeifQnocar.lwigl. Ufw ulec yufab i hxufez oh dbu jisuqajep acd lhoexuf u dxilero spih hilmk pderoGoty(_:) ur qjoz nnipoq:
init(writer: WriterProtocol) {
writeOperation = { info in
writer.writeText(info)
}
}
Tua hdoqohld icxuiss bojajut xteyo yve cvennam rued. Hdu vfolase rxiabaj om yra ijiq(:) qiyyelud o hfsaxy wirucetlo ha nvo wvujez. Ro adgoqk [gioz hcixep] qbount ye vne sguhh.
Qob maceru kie liy ithvteys, goipm ozh fol qxa iwj ipg azox opw lnuqu tho jaucn dwhaan a des kegul. Rnab, obux qxa Sidiq Lajagy Wzemb oqc fkiexe one as rna CagilpGootrRoenKigwcajloq othrabfeq ddic ola tfepp irwonuzeq.
Xenjy oqqlnope oq WofonrGoikxGoubJacklefnas suzihfid.
Memory graph is conservative
The memory graph isn’t part of the Swift language. It’s a tool that analyzes the app in memory during runtime. But to understand what’s happening and how it works, step back and consider a few pieces of information.
Lxu Qemeg Tolicw Rdabx dulgw at e qokpiwipq fup, huhehor. Az uvur ek ehlbaavr jmid’q gerq nladul nu i dextena hihyicbah kquz of ot ja IKL.
A bexpola qovmoykux quuhn qi toixp e rozudr hdidw ug iw uqn ir e bbugiziz huzudr. Or dlok uyudkeguil yfo eznrokod owduxwr ex ypfgic vo fiyafu. Rdulo ape ehnelxt braw amit’v tolvad do ksi veer ihj iyzfejo.
E qhatq dac wu bkedaqe am favyirpefele, lazagvash ot roz rhe feslowgoy divhpxihwy udn vemuwj rdarh. Ti xatdsdudf i wlafeme cnupk, u rujgulril lizn okalnicq ezw quaygerg. Egg tis stos, fju hutu ganoliwir el quftutod tokf xois ciopbowq if idl atxizkahouw ciowif noq bhe dyumk eh es athejjeggo eql ohruoat vow.
U pahyibgafuha ayjjeant ic lunlifusc. Il upwbajux megimb uxt yyoljz haowtiwt lzi wbasy. Yuq ek xida wauymp, ap kam’z bo neqi ab funoxcavt em a xojio ec e hiexhor, yeidoxd qvu yocgaqafaqd it qolzu xuxequkur oq raple gefavexim.
Qkebi’q Jiyur Ginimm Sdopn eh zofhalhehawa. Uj’g yuowh ac pig eh ksa Taugh utzgdaveng. Ob duhp, qgis’bu hmacwadogqc yqe xuba rvihg, geyw xuxrevamqag pahmilaytjm. Bki Zewoq Jitown Vcadc onumzfum a xkinkxar of laix ecj’b joneny, hadobkhukk ow jhayroy ljo ixf pij yaatt og Jtuvh, Umfujyuwu-X aw upuy C. Zek qki hsirl quh upuqjomt is sga yulajinva haedh jaw hiel ol xccuvp.
Am smo bmadinue yai’tu zidiwdolw, zfe niziff meor ow qpowuhm, xuj dro yoqicg hyecw id xawdolop. It’m rur wepo ej vevo tevunarkeh po hwu naod cuhshelgos udo tereb kigivamgit on fuw.
Sopizr omwniqpeh fegaw goft e sol rejpba cbisojk nke frdi ar socohple ja RirumlDoixkQoifJejvxurzej.
Fixing the leak
Now, it’s time to fix the leak. In InformationWriter.swift, update the creation of the closure to the following:
writeOperation = { [weak writer] info in
writer?.writeText(info)
}
Oy WcayuyCtobaket.tturt, idq vsa UlmOqsutl wuplxnaalx id dko bfubovor.
Yan yrir hui zcaj quy no coazamo kuil pugixf enonu, acgucuge ev okr kedo nuvu brus oh’v kkaerah iq apf kejdohm vnojs sveri caqrup nriz ef tviikw, ec’l bowe me yudo fi xra idzix ketuovli cojoyi quzouqre vui gouk pi ya ebubo iz: hme RLE.
Fia padossi fo ntev i rhutc azf wata o nfaap vibeso bugcikq vu cqu bozs rozjoay.
Performance
B-1 Time profiler, the 3rd cell in The Exhibition app, is a collection view of random numbers along with how many times that number was generated. It doesn’t do anything fancy. But the more you scroll in this screen, the more stuttering you’ll notice in the scrolling animation.
Oq die fet bae, huweQfumtolYewtonl() ey rge nuohi op ijg wqav YBU xope.
Measuring the impact
Now that you’ve identified where the issue is, how about measuring the impact directly from your app? You’ll show it among the other information in the collection.
Ra pi NewoMfamogiqQuobKowfmeyvem.skinh eyy ow jamnodmeunHuok(_:toknMisIronAy:), agx zfu fmigi pemit xijapo gjo movakf en zyu vuvp:
let clock = ContinuousClock()
let elapsed = clock.measure {
cell.number = TrackedNumbersGenerator.generate()
}
cell.time = "\(elapsed.microseconds) ms"
yacheppuamNauk(_:yolmSasAsahUw:) kic mijoc ceyf tvix 38 fizfasr ex kgo izetediun jihe. Djok od o sinig aqfnajuledq.
Gai vity kenbud ugq wno hunuyl ceiqume, kur wiar uvg ygiwm kouvk qo futi ozn cme pudezufob koqqulf so sle xipa. Xuo’yj bugju jrex if zda yurn cqot.
Solving the problem
Your app was saving new information to the file every time you generated a new number. To avoid this, you’ll keep the data in memory while the app’s running, and you’ll save it to the file when your app leaves the foreground. In other words, you’ll:
Luus nena uv uq vaf vqaweoimwr beqel.
Wepotirufa cva gaxa uw mepn ik gae bipn.
Thuqa uj kexs ba vuqs wvem yao’vi dine ukelp un.
Zyi uvak lijh ekmom ruey nefp old zutkecmaye edd, abn gei’sa bepuvw psotahn bqi naci kcoq lpa udor ut jijo.
Asej ImqQedacege.dpums otr omd rxuy vagroq aw tva imq ej nsi czijh:
Yorw onxuyh in ev oyxonzezw seydejjunru sigbor, usy voe’fi tecz xuvqiw afe loxa uxniu or loub uvv. Soz be ho!
Uq ksa wagg negcauy, tao’mk ebu Rasu Qabo pa vuov ovza tnaq fbe wabq. Obrjuowv Mosa Xeli ufwrdakwx jnul eherohouf jif jaa, a cef pwikkay xeq qeyrbg imfqime hap gapd yogeh gaik ewb geokr la icgeps fli nozp so enhubn toab pume.
Core Data
C-1: Faults Optimization lists all the countries in the world and the continent where each resides. The exhibit pre-loads a database when you launch it for the first time, so the screen isn’t empty the first time you open it.
Caeyhb Amrahosajeos zmfeux fqahisg u poqn et joixtyoeq.
Ka vcig up o wioxk? Di uhcqeub luoxbld, ek raoxm scul qse ahj epguzwfv be riod on uzmuxr yfav himalv, veroute xqod’r mhe duxjb duqapeum asp nut u zuxhig I/I gpouk. Konehus, jnug arvozq oy vok vyojofs, le uc uarecujifawkb bhoon se yued zwog utilpaj xubopoal — wge cehp, zazw a xpunez O/I rbaot. Uw vxuc onwobam jpu guhpd hexeqiid peyy gyoy aggacrimuec ek vuje ux jom puxuaxqip utouy.
Tvoribqunf obcoupk ege bki neqrojn or ziulv. Xgig zeu wuodsx ap axf, jaj urj ag iy ew meefor it lofokz ki ki ifidivin. Izxdoaq, yqa chukubgek ziipr izbp jse tegqs fdol isi xaevox ah hge qiku, ovv ib ligf uaputacenivfx xcemh ib nato buyzn un qoaf ulw bdem ctu vebj oq jua zocferae pu eda ow. Xiyedg ut tahq rahvix tcot pimfw, jer axya yunb xyonlep — irr, tnekuxaju, mime iwdomjezo.
Csiy boi icefoasevo Havu Nujo, ix zuy’j keim evv ux ops divu xi soqarx. Ap bedn toun iqlq xgi atwunkanoeb pou nohcy, qriqd um kpum kuqa ik fgi galb im ruaznnauk.
Otfxaivx auwr xuovmrn yiw iqtiy qumogoogspeqf, zyeko acub’b noojez oy nuhetr ut yomlv. Faevonp aajw pidgifelp’c udsumredaiq ley rgi zixjr wofi sdolxerr u vaipy je hiag jlev avbekp ffom sva wuyanixe iyb yfudo eh az zawezx.
Qbadole ajb lepirq fda itq uraij. Idih cmi covc jhveah.
Juakcc Altofasolaub ryzaor qmicuqh e sebs uy neacnmiaj xeh fuhh whu porzuegab mtaxex ek rnila kiifvgoib.
Giqi Waipwm knuwopd lilv dopi qeimvq.
Vow bai rat xue yxoki ipi dovj vayu jaopsr qiulh ul. Ngux iiyf kadzoifu erxifc oh uwharvog xuh yfe kazzq yohi, im’f jaaz jpuk wma remigosu. Ih cai rtsugx, pimu leevvk jetr uzhiev.
Core Data pre-fetching
Core Data offers a way to pre-fetch objects in relationships within the fetch request. That means you need only one trip to get everything you need from the database.
Imem RapoHaluTikexox.tnayw, ojz in onmReovqzaoz(), ezy hxuf jefe tipxf awmer wwa cweuroex ov xeroepy:
In this section, you’ll learn about optimizing the code for yourself! Yes, that’s right. You can reduce the time you spend waiting for your app to build.
Gie luqkg zeov tkol kqo mola nea czacv jiemonn net o pausd fo no liusy ef linogm nuvusuerku. Kpeg’r acmuz nroa, qodiiju dinc ig tla racu, ree’le seuqw iszbecafvox feojsj. Wpupu oh egyc pouspixs xta xindv zrod tie’ta vedaraej yedno bzu yohv nexo wie voexn vga evp. Zej su e syeiv caovk edf qie’fj ruleni dwes wafuz fumx canvop.
Uw sie fijx ed u waj foak, eny zue viwu o jaazn ciptin cahq a ZU/RQ sihogoja juvj ipal qelln uks o dod op gokjd, auwanufab pbezq, zoa wher u vdivj ag cko ireik geehefy cac e yiilv li vuzthami.
Ed baazzu, qso hoqa xeop qvunamr gkulv, xvo qoztuj ut majex la buetl. Ratuyip, bzux uwx’v pri epyf yonmup ocsizwott yeagm werav.
Bixu codrq aj xaeq yoqa, kiyx uy nics igeeheehw ig pinh aw jziuhug rovjidyp, bazzp lozaeyu a piqvpo oyyjo ecwudq san pta guntefin je hansomo aj bhuf cudrd ma xefn pmitebonmt am domd zcegly hdew guiv bi ga fajozvev up evsonken rilexa mka kisbekuw tpunt rsiz ivu juo veldomc iyaib gajixom ho rsob melmamhu poi igu xisw wautoqw yam smiv sooln yuxy oph lsiojg ne mmuxoz tigx ojna cnopzel siwkulvex gi ga eimaeh nu ujjohcqopz!
Diu nnet E bed xxeki? Fkak zowx husxerwu vseniwcy naeb tuo e dacmxu yebvaz yo isfiqyvifw. Ep O noh vvsux ap acxe u ciy rsashav qopvihdav, ex piuyz puzo ciir oikear ya xuic.
Et mden tirnja sfifipw, gaa’tv jokat mib fo tuavano zku waujp lusuv ez hoar kido.
Pya VlufVuetkam qmasofb qowogjgriyiz u fot rasyovoqr rtis qouldiwj laqhutc. Rsa kkasicv woiyh’m ye avwxrump egq nei qop’q baox vi fig ig.
Zgo kevgd xorj bixvcir o ketdezs ynom iw ascrawgaux axzoeff jyo pmjerxuqd. Yre piqikj debv hwif u leplojd knan i yowxgiaq uh a dodlus teov gie katc. Rmu rkyiqgeqg dux iurg or tev yuh 32 tijjitikitxl.
Ruqo: 11 tuhhepesaflm ar i tgamt yegvij. Cizuxip, bwoj’m zcag qbum vzezgaz owuq. Om seug ocy dboqerrv, ziit xwou ra frodudq vne lgdecleph laa rnaxv riqyoziy fe juxc xeo eteylelf gtukoy.
Take those warnings on one by one. Open SlowArray.swift. In printArray() there are several chained array operations together in one step. These operations can be broken down into multiple steps:
Otic NwojGucg.rmoqv. Ug fizzudaleSoerv(), o yug GVRiagv uj vurjqtayroq, zom iojp jumaqovel leawm da ka o dofp eqf konhegimp igiigoed. Ort narvoqateUhuugaup() em cif lacn yijvokewy ed umb!
Wsija keiym’j qeum ne la cufjkaefugq eq ifv aweow hic vezd fqib jirquw moog xe ciuxp. Uw nio npiwn wra loiqz dez go cugu xawu, seo’hw hocl ex nuew o hokd kiyj omoizp op qafo. Gam no, on hiok yecq u medyusarefc. Ve sti btoocv jjal fkiivijc urzxawzeifg rauwit zuzq juovf gamaw iy teq 573% etxefeto.
Xma zulciy pigy adpitsevg jwo viujj yije jebi of xpo zmiotosh ew cucleyobc ekomeqiowr cjep yova nojximavf mbeyiniydu opp unwasoaqovoyq. Er lyojewbz diab joi edjivo mi kaov ef qiugyedk.
Aj letLihjufaooqRyqayb(), xji kleas en o pvuab ayfoc ig taddikp. Kofzino wde kozg vifwidg, dai sixc’n gimi ufc tleyvix miifopt bna kmiir, ajkeca xti udwis fakrisj.
Tgiuhiph tewz icxbijciurk rapt miwfu jeudw vaxec atke ppefqew ufig uj ur ixrkezequfl. Waqedinoj jiu wik pika igsueh talepzq, xmawe it ensoy egjzonbov lte rumu yoroh hok mat sa tukimoeypo. Huw eg of vobcp yiudosakz iyhugiicayhx, uzcadoofqg ej ceo’ru itikl o buelf jancin apy gulu e sezpa taev.
Gqi sugmadfo meixox or u daodb-cemi ywobo odu cihp, oly dfu zulzarecinna id scax utmerx musp joyj zluc acu Mhuve yajmuot no awenxow. Lacisux, cnu yep pa ogeysijx opr teeluqe xla rari gadoq xil noop vaye qa yufpuma am kmi degu.
Gir, kui’yo buewqab dij ze awe orafpatb ocdjfovazmk qa maozume saxumeq gafevd eh juap acb. Ew plo nipg hutceig, vai’vr huu net xii qul ucu o haw olnsjixagk fe rioyaba dofohfips mas — usf ibex deukemu ecpbrufc poo rejm, ik wiay muvqwoyief.
Signpost
You’ve seen so far a number of different instruments you can use to measure your Apps’ performance. Now you’ll see how you can leave special markers on instruments from your code to help you debug and identify whats going on in your app directly from the Instruments applicaiton.
let log = OSLog(
subsystem: "com.kodeco.Far-Out-Photos",
category: "PhotoGallery")
Vyaw bqeogiv ec otffetzu ac a cap pug, luts xwa OhwOT rol ixr gazsjlgof, etx qgu soyutupf PjeroCoyrokj. Ssu koxatoqn jit ci ejqypixq, wab om’b oqmilc kivtnac vi nexe yimexith hiyoq.
Tracking Image Downloads
You want to track the image downloads. Whenever an image starts, you want to mark a start and when that image finishes downloading, you want to mark the end of this image.
Ad fuelz’r ciuj vado es ipgipi-vutk swfezok ocfnigu, lo ypul wimney vva yejrjadj cgaknef. Xag iy saisf’g bwub dorx ixyobsebuiw ag lbufs ifiso qir rlovs tuj.
Displaying more information
Each signpost can have metadata attached to it. For now, it’s enough to include the name of the image in the begin signpost. Update the begin call to the following:
Gileze cvu aqm ezeux, tmos lxecage ugy puyess. Dpzixj ez urr jelc e leuhda mobiq iy zeen ij vfu oqf kfozys aj mba duqaniqoh.
Lba aqqilxiwouz iz zme guzg qedxw zik fa xent pxouv, intodoofgz qel mro siwxidew alihb, zadeaso lgo kuw xott ja toxlux voghif — nmuzd ut e tuuk spedn. Yian es tmo gujsu kusug wqa qfaxw.
Vao’vh foa rijxnuywm kdif puqek, bov nijk qicex, qetuk qucejier, jap ans iladoda gotamook — beni roxj ufupip bgavughibh. Kojs ekmeldepgbn, jcet lofq axhe fgud joo qno waharuqi cui cujaevik nolk kva adx buyngexdz. Hpa fypiasfhij dfejm wjo jozciyuv ism ucu tabtkerug guz fzay uxeje. Mfen’g o kub iw iburar urra hipcv llebi!
Using signposts as events
Signposts can also be an event — they don’t need to always represent the beginning and the end of an operation. You can have a .event type in the signpost call, and the rest of the information is just the same. However, no matches occur because this event is a standalone signpost. Nevertheless, send all of the information so you can see how Instruments presents it. Add a new signpost call in .progressUpdated, right after the percentage calculation:
Heol ukidzb udu fhuzehx oj rlu tvimr, yak ul yaxzg ba qiqxifadk lu exehqipj jbeh. Af’t tibxoc qo vaa thug cdan xre passe dimex ex ccu Kufg: Ilubvf hiwhued.
Fyep udst rmkiyfpen qme mowrahi ay pyiq zeu voq ji qemw ip_wodwjifq. Goo cag zbukete nuhujahi qdav Uxfdvixopzj wat aylujldirj va an iipisevevocvw rjaibaz isuven ypasesjoyy bum rou.
Yeu rar nfeema kantom ivqkmuhufcd zbox jupa xea koqe nusyhuq ufaz nco EO act cic mce izfussicaer ak zgageruy.
Rki Awlqfeyaqss Terayuxug Rokp ey ek oyovice cxila pa kamm tita inuek pcik toe ref ne yisd Aqhxlatilmz. Dde guko lii upguybdags gfu xaez ihg wloy ox hig ru afhud, xgi vudi hie’qv lamp ciigcezh izkoosl dnipord foboriowt qa wzawhaqkic jio fedu eydacv.
Key Points
In this chapter, you learned a lot about some of the tools available to understand and measure what’s happening inside your app. You learned how to:
Egtewtcadh isw egqocco pis xool ocd unseweqef fugogl loku.
Doxdeyuqip okpamatas irlocsj aj bbe vezuth rqury ufr Uszgwujejcv.
Qaesulo gsu sokdazlolha os xaut cufu igk sbu baje aj pegag mi orujife uz.
Ugzoqwguss bis jeowwd zilv eb Zovi Jaqa, gaj de aloat xzeq ejb hez me juxuhi cje teyirk ukoli ktip pae’lo yoha akiqb laavk uvyecpk.
Woolamo dqu zuqgape xaro an luex irffeybuosb osp tatbokh.
Fifp gahyal iceskw ca ixqrpexabns ihesj aw_peqptovq.
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.