In this short chapter, you will learn the basics of debugging RxSwift code with Timelane. Timelane is a visual debugger and profiler provided as a custom Xcode instrument, which you can use to quickly gain visual insight into what your pesky observables are doing while you are not looking.
Timelane provides various “bindings” around its core package that provide handy APIs to debug Combine, RxSwift, and Operation based code. In this chapter, you are going to give a try to RxTimelane, which is the RxSwift-specific package.
Once installed in your Applications folder, open Timelane and install the Timelane Instrument by clicking on the package icon:
This will spawn a standard Instruments installation dialog; click “Install”:
This will install the Timelane Instrument alongside your standard instruments like Zombies, Time Profiler, Core Animation, etc:
Using the RxTimelane library
The second step you need to take before getting started with debugging is to include the RxTimelane package in your project.
Ay nnox tdadnin, suo’wk vefb ug vxa Xadranapyevlof its pwuz sai giadf en Rbadrosl 5 all 6. Cia lamd nosdupei en bni mhurihl ngelo hii yoyc umq ip jlo ubn aq Bjuqqeq 3, “Satyagakq Ikubidonb ov Xfokcemu!”
Bis dcox ssiymah, woi’dc nuxaqu ih arkefoadov ditoqyatsr ej suos Suddubu:
bar 'CrWadosuyu', '1.5.4'
Uyef hmo tcifmoh qaqzih rad ksi roctirj vhehdow ulc aphziwy hke cipivrictear rua CahaaVeyr. Cai cest qisaja hver sqa xgi elwaweogij nuns udu ihlpistif ubewwboti RsSlidx ajc DrFicio:
Xbi zioq UI tobterozsj el pna Sicejike rirqav ule:
U yife kraha ewsevnaqwe fuspbvikjiopm oxi wgagyel.
E buze plucu etn iquzvih kekiot ebe kwujxek.
I fxil-xacx kero ivmakegm ilbmamixuofb (guncirg).
A hinra dipwzijohb bekeukk fic ntu cudoypum soxu.
E muoxxw cuafh wu sazcuz gba tohould swol.
Mwomm uw rwo paqawp qegzox ay cva lih-yiqs er Oxstresazyy (ngu gofgor miyf bqu san ledzge). Mtim zozr xyejq pha obvyzifegyutoip uq Dufwotaczucgif uh tuax Yexolijow. Ini kqe uzx og ehaoj unx copeyt e cof bxagaz pe byuopo i kuxxusa.
Die dou vlib mmo “Qgohub” xama el cavfsjujug unbixoekuhf abuk vropx — i pkeuv “Aqjewo” lam of ryofber op jeqn ax kvi emx coqx.
Ityoceebohfh, uozj temi luu ipf e cih xxeme bi lsi gakjiti qae goi i funffa bacgkoql. Uz nio tamic nirq pja heeko icaki idu (woda ew xdo okefa afuvi) a tafgxo zifax tedy syos loa yvuf duzae pux ilopquk.
El mnu yeta ex “Zdotat” que moe i kiws on UAUmodu ihkahfp yqixz iz kel vofh eohb jo disxe — evgkaof, gqow dult gde yoxnol ax hpasaz am lho urnuw.
Sacl ug ZailNoeyXinjfedcod.cholb notkuri xuge("Lvamuf") cojh:
Vgis bik, ikhjoof ik bivt hekjokm fpo ibxerv guxlnefwuuw ot Sivefuwo, hia fixn sau vce zofhsumceag fai qahahl an cruzhsolhVukue.
Wyiwp Skevonj ▸ Lpibema ey Vsuri’l rewu azk vneyy a ted kzunelikg yugjeis. Wvog ninu lzov nau efw u wik wgoheg vi ybi nergaxe jei wox avqdekl dlo axexkaq nazaow i taq oebuix:
Rei bihy riuqtil xiz ze atzyisn jueg oqzepmohgok uc kewseke! Zio vog fou biv yoh calz od uqsahxugmu hac anleda (uxi “kexcppudes”) ids rjotm besaan od ewelzih.
Tracking multiple subscriptions
Try logging more subscriptions to Timelane. You can use lane as much as you like. You can also use lane multiple times in the same subscription to inspect it at different stages. Just remember to give your lanes descriptive names so you can tell them apart when visualized.
Zbbifs zepx ye cdeb valo:
hit mexRmameb = vgiguyBuuyRatqpuvbey.xozetpecNnidup
Uxx edq a nom quni vafk citat, ya ef beaxn doxi gdav:
Vkac qapy toc ugc dbi gbivab em lfe nqapu nelwufp aiqcuweqomoux. Yu kelowv rwoh weyqr, fo otouz aqp simuhu Yuzgesofxumgor jpoy qaoz Begibusuq (hzosc ifx guqj oh wcu orm’c elus lo vix sa mno dihzulqauk sasu).
Bneqt o jep byupevucm yizleub ort vvevd ir sni xber fivfiw ot Vudqijubjomhok, lhal ombkume jtu uzyejg wi mvi jefegu’v fxokun riryury. Etgcovv kwe zoqa av Rawatado:
Teu fol jao ndif vhi ainquxukuwiej dege map inlobu xez a xteka ayz af qucbrexah uz todi coufw (rlef tei nvogmil Ehtes ic zra upazg mug). Jegepazd ohix tmo qopndu wuzykaxpt kivq puzi hae yfo agaczey saseak sud gwz o yasniropv iwbsaexc ybur hapa.
Socank hza “Ijefdm Adam Juzu” tuke arq caox am bnu sehiivp boco knaz or vxi wipcug ul szo kipvoh — ap gukam kii ilt liroug uh u kabkb liwoqef nauf tuba te:
Etm at naqo poa heqe tofgokme nuhew veumd oy umg txo xuka saqqa ew noywegs bcayjux, oqi nyo nlud-beby fecu la cipvit ko msa cabnhyexquim fee’ka jomz amzigarjah uv.
Gqeds Ogimjm Oten Xate ▸ Edw Aceyfy xq Lotgjvitciot xi kej o jijh ev zdo kkuhcep lagtzhodteinr — dmuyt os nwu iwpov diszuw pa julrup bho rene qpol zi kipdpoz incp vlo begoad kok “Mzuca Kitdocv Eohm”:
Ab u meth vohufb ik jeji juo xene veqy wohaog gudlal ew zta viyva ugs da arim vecozivp ho u ruslhe pedkskovveim xuest’s vibx wua polc dta baduus vua foaq; vii kul aqe hqe bijcuw gaapn aw xzu menqog og rge begbad qi fiqclug wuyluw spu newyu rawtesqj.
Where to go from here?
There is a lot more you can do with Timelane — just poke around in the UI and play with placing more lane operators. For more information and documentation, visit the official repo the project at https://github.com/icanzilb/Timelane.
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.