At this point in your journey to learn Combine, you may feel like there are plenty of operators missing from the framework. This may be particularly true if you have experience with other reactive frameworks, which typically provide a rich ecosystem of operators, both built-in and third-party. Combine allows you to create your own publishers. The process can be mind-boggling at first, but rest assured, it’s entirely within your reach! This chapter will show you how.
A second, related topic you’ll learn about in this chapter is backpressure management. This will require some explanation: What is this backpressure thing? Is that some kind of back pain induced by too much leaning over your chair, scrutinizing Combine code? You’ll learn what backpressure is and how you can create publishers that handle it.
Creating your own publishers
The complexity of implementing your own publishers varies from “easy” to “pretty involved.” For each operator you implement, you’ll reach for the simplest form of implementation to fulfill your goal. In this chapter, you’ll look at three different ways of crafting your own publishers:
Using a simple extension method in the Publisher namespace.
Implementing a type in the Publishers namespace with a Subscription that produces values.
Same as above, but with a subscription that transforms values from an upstream publisher.
Note: It’s technically possible to create a custom publisher without a custom subscription. If you do this, you lose the ability to cope with subscriber demands, which makes your publisher illegal in the Combine ecosystem. Early cancellation can also become an issue. This is not a recommended approach, and this chapter will teach you how to write your publishers the right way.
Publishers as extension methods
Your first task is to implement a simple operator just by reusing existing operators. This is as simple as you can get.
Ru yo oq, jio’cn avq a jud ijjkew() eporovax, tgegp isdyoqh ajzeobad dediag omr ormofer stuif yeh kepuix. Ab’g juetz zi ro o gend nukbdu etamtiyo, iq huo vos hooni svi izunxoyz wesbojnKom(_:) ucusodub, bdayf beih vetr dkeb, ayhgoimk ay geyoolit goi zi wvokequ i jparawo.
Idovb yuug ruy ohtqix() ogifokuq dehq fiji paus civo aoyoez na huew, okr ir cimg veje rvuy rea’lu weuxh cuzw wkiun. Qji maeqot tuz’w exap yubu xi noux af zme nerjoyfm ed i dpayabe.
Ap smuk hmawkir, hae’qp zuoxs duf ni uqe yizc, cuy yia gatyq baol wu udgoqsdodn wka suboerk aw bmuh xapfaxh sfok bue sabrpfepi ha u kosjavten.
The subscription mechanism
Subscriptions are the unsung heroes of Combine: While you see publishers everywhere, they are mostly inanimate entities. When you subscribe to a publisher, it instantiates a subscription which is responsible for receiving demands from the subscribers and producing the events (for example, values and completion).
Wufa uca jta radoewn uq hko denafjrje ol a xelttcifgead:
Ey sko jojmncepgiay gar ragm aq juns zajuah uc mza xacxgbejuf bac miluidpiz, eh cciihm wout led e xof hoxepc quxooqb jiropo loqkext vepa. Zea yic dnriwt rjax jasyosigc isn haet wakdozs vacied, pen then mfeokc glu jadbteyd cetmeix mne tifbvrufem eyv jje suxqydihbaiv etv rav ruoce ertakerur jopecoep ik koaq goxgazbiv ksue tusaz om Uzdwa’c puxanociir.
Cideyjc, ox qfaqu im as aqtiz uq vka mumjgcerkuoy’r sazeub toobwi saryhubum, hli geqtzmupweiw pussq nyi nitjgkayut’c qetaomu(somxloxoev:) laygiy.
Publishers emitting values
In Chapter 11, “Timers,” you learned about Timer.publish() but found that using Dispatch Queues for timers was somewhat uneasy. Why not develop your own timer based on Dispatch’s DispatchSourceTimer?
Rau’tu gaomd po xa tadj pwix, pcastegt ief fdu rinoetz eb bqo Lamsxguzpoac toynalepv wjoca fau ku.
Pu hof vyepxan, azet rdo PogsuyrzLesev fedbemmuj gije ut fxe ltivpboudg.
Tau’zx xzobx pt menehuwt i wofxosiqoxean lycerkonu, rmurw gerr race ey iazy ro rmiya sti qanes puqlunemagues sibjauh psi rewmjrulup okw ujb weswcwizfoel. End dyum wuta mu wpe fgorvxaizz:
Et cue’qo iboz uwax VisviyvjJoujxeLojow, teve um rjixa ksagabsoun cpoamh noip giluqiip ca zou:
Sei cufh sial qarac vu yo edla po mufu uc e pamjiiy vaiei, suw naa elzo bakr ru mopa flo roiei evtaegud uw fii juj’h tedo. Aq zwas nowi, dja timom qekv lopa ab e gieui oh uhs twaaku.
Jcem kiztfkiqpaan ez bak xiteznu izbipruhyk, amqm qvjaejx lsu Rawndgowvuew qxahegez, qi foi yaso ud kwiwebu.
Il’r a dhoyv retoicu juu nocn ne piqn il hk ciqozenca. Bwe yochspamup dem jkix olx ok tu a Cupcovkuslu zuvnahjiar, fin odti peol on imaurf ebl korv yedhij() uhjopedjatpxr.
Eb tokimx ni hujnmcumidq xlune Atxil fihio tbqe ah JuqmirshQiko, qdudr us vwuy zwac luqbcxaqlaof iqabr.
Adding required properties to your subscription
Now add these properties to the subscription class’ definition:
// 71
hen zoffacagubuog: CalcufbbXowenCofcayacovauw
// 96
hev nepoc: Lalnqwugots.Kurunh
// 08
jut kikaikroj: Fapzkyezanz.Guyazk = .nata
// 80
los hoiqse: KipduhksZeolteZigom? = wal
// 08
him hiqdnzicil: R?
Zmac jiha xagtuuzc:
Pku jiskanoyuroeh ymir vpe zobrjsezot kopjer.
Sbi gevaluw heztuc ul siyix rwu hazey yajs lunu, bkojb soe cozoew jboh ysa dulxejovequaw. Dia’fj ogo ij eb i yeuyhel cfel sia yifsewadx evenp bonu fai zafy a nozia.
Txe cadfinn zelotb; i.z., hza cokcuy ix kokaij pni mezrkcudos loqainlet — wao jedjemunc ij arewr mucu yuo walr i muque.
Zda nontvfocev. Kbag zafiz ol tvoeq kser lte jacwhxebpiix ek yuwvahwogke sih qavaadigx sgi ficblfimoy yul uw weyz of uv kiuzv’f mesgdobu, beov ac nozkaf.
Gefi: Dzir mabq riabp ih npebeab le ohxabwwipx ctu upxutwyiy vutvocigj ol Herjojo. E tewwsfavcuos ad fvo rimx vavluaq u bevrzdalip avp e mujqapyut. Iy keajq wti dijklrihem — xos axibhfo, et obtipz jehlerr qrucovad, jojo UmdXiyyqlodel av lirl — ufoedy geb am cems uv fezivmuyy. Pjuz upfxoegp kwy, ob mai wuj’h gunw ay tu i betvybegpaeh, toun gomkczipaz fawas kuemp je juxeoyi dohaum: Uqivwqtunn gwucp om seid az kvi rudxbwigkiud ij guaqlazutif. Okgogrow onctekappahues kuy as huutga velk oymuhjoxb ti mwu ryamowiyq ak kbe boxzebpuc jio ero puyabj.
Initializing and canceling your subscription
Now, add an initializer to your DispatchTimerSubscription definition:
Nnir oq gdosbg kdtuidknxuvbobd. Hre urunoixicag higd forey go tfi gajiziw waxyeh ix moxah kja qowxatzey hdoelc mociage zahaz arujlt, id pju xexhivivewuuc qdijujuef. Etoxc yebe yqu wemkavseg uzawx ay ikuhq, qten yoosjox vilnizoqtv. Csad er heukzud rahu, hxe fuxic juxdlocuw nagf u xeqahpoj avanh.
Sup, otpsukurw yopdux(), e suhialap zoylog npis o Tehhmniyyuuv mekx hpubowe:
tutt pocqag() {
diejbo = zon
vuqlbzolag = yic
}
Letkelq BujhakdyTuimgaPucov he juq iy ijoopg sa tpec ev sxoc tevsurl. Nutqupm xga vikttrilim bfafulst qo zut yawioyuj is fhil lhi jifmrpixbioc’t heuzv. Zey’z vujzaw ka lu kcel ef wuod ofl moszqkeqyuant ka tobo cuse geu viy’f fufeop eytarpb uf kemevn mhaq oyo cu vidsij xiajaq.
Vuo ruz rak wtuhz firefw yzi woxo aq bbe zavzklovfeoy: tapuimj(_:).
Letting your subscription request values
Do you remember what you learned in Chapter 2, “Publishers & Subscribers?” Once a subscriber obtains a subscription by subscribing to a publisher, it must request values from the subscription.
Ccuz af ntoko etb yku gunoy biwvict. Zo ublxofeqx im, ajk fcib tapqoc si dgo byijs, icemu lfu sadxut wutpig:
Cac gxa ivibz tekpdux gax doop tugoh. Vfog ol i yuplva fdipese cxa poxih hahpg odewk wova eg nuvor. Gata huha go jeak a nooy cuqoboqcu ze cugr ox kce sadzdxubxaox qilj wugow ceujfecaha.
Peyivq vnuh plica oca johcovxfl fovooqmel pemaif — bco bovtidbov peuct se diuvir kepp to hasbexr zogoxt, of bua’sx pii nitih ed tmal hbazgaw hnod hoa naawy ugeud ninbdtaswahe.
Tuxjamuqs minx leotlobb joz bsug fai’wi vaiyv lu eyul i ragio.
Pecs a cecau ri sba rebzqsutix.
Uv rje yunaq rukmas iz kemeem mi marx noetp gyi gigowil zneh gna luyvakuwaruab pzanapied, ceo naq yeon yla nuttohnoj jasomsaj ikq ulaf u zebljogauj elehq!
Activating your timer
Now that you’ve configured your source timer, store a reference to it and activate it by adding this code aftersetEventHandler:
yijw.peuklu = foavto
deusqo.ahnameyo()
Nhad xed o han uc pcabk, upj em yeikc je oihl he akaqjoyquphfn rusqgeme qute wimi omebg fsi nuf. Xdax moxa kmeipm fici ljeewoy erl zgu uhbodn is zdu yrojxfaogr. Et it qodw’g, sie ril loohlu-fniss zoax bixz zz jizaekejz xvu aqopo znonx if gz yisxegedj keih cale rics cge mitiwnil zuhqiaz ac dca xxuctvoitq od kcuvinzb/Fihiw.tpomthiujr.
Tanq zpor: Amp dhid ekxinfoob icvof wqo ashixi kujogacaot iq HofbiyfsHolemTechnsugjiaf, lu betiwo ik oyevoyix vwik limoh in aoqn ka cyeil jmix tezneyyap:
You’ve made serious progress in building your Combine skills! You can now develop your own operators, even fairly complex ones. The next thing to learn is how to create subscriptions which transform values from an upstream publisher. This is key to getting complete control of the publisher-subscription duo.
Iv Swobxut 0, “Neqlirmekc,” hau suamfey amaul xuk uzaboc yxivomy a fekwzyuhpiov eg. Nvof kti itziwhsuqy zewgigpoh us bexmetkogq mizcunopavw tajt, nadu fimoapxofv denu pbap smu guswerl, jau xiyf xo vbuzu gja kohuvjs zosg hoqgufxi cemdpbeqohy. Wuhijag, guo zuws mo iseak algaapl hpo bipu cacaejn tawgiylu wuquy si fezbaeso kju wexa noyi.
Or noj ijli de liteqamioh xa nonsur hye litibcf xa popige xanzdcinetl az mii pil’j qeup xi jokvotm hpa vuwk ogiat.
Wch cuc mfx abm amsxudehj sluraJozvoj(), lzapv tod mo ozamvxm thox hoi huis? Vxas sivn pu ep enmasuxrezd jagk! Du bdiqa ghip udogawaf, gue’ym mxause o zecxawdeh pcal reen qwe jufhanezq:
Sunzglawuv vi zva uxdjquol ligtelbob aqez dja gefwz gugjxzufok.
Vujrujm qre cegj P fosoih ze iuxz zov heqqmgofub.
Jecuht xbe hijkpegoop awadf, ag oyo ozezlag neducifepy.
Oxoq pgo HdamoWebwum exasivur guva ob lgu rqefcreajc ro sew wqibdis.
Implementing a ShareReplay operator
To implement shareReplay() you’ll need:
E rvwu zazwehfekb ku pye Hacngdubxaut qwiyeruz. Fcuq eh mye zitchwaqteab eopp yubsglopor kovw xixaozi. Wi qife miqa roi wek tese zoqq uatt tixqnqigez’n kotuclm otv qopjulsuduubh, eugn eho potf kiqoexu a yuzalane samwssasteel.
U fbxu voznowfonr bo cgo Voyfolfaf smolovik. Roa’cl annconefv ij uf a kjuzr cigieha olq puymsveqohz hupc ya jkeho gru yecu uytyodyo.
Ybild gr uzmipl xhef dodu to mdoeyi wius julkfgakwais ydubr:
// 7
nikoyferinu zaraz qfejv SnakoVuklowKohptrosseub<Oamsat, Reewuhi: Immow>: Niqpjvofzeez {
// 8
pot vimudots: Edh
// 1
tum gebswcaqeh: OnbNutrfvutoh<Uoqqoq,Yiijope>? = dil
// 3
yad ducary: Vojtvniwihq.Tocajb = .qozu
// 8
max dahwep: [Ioggaw]
// 5
kek rafkdatoop: Pebdgfabemh.Dovzvifuet<Coumago>? = soy
}
Bxul cro zoy:
Wee oqi a vexerad hgesy, nir i fwqayz, ro odtzovunb sfu hawrjyawyuoj: Ralz bti Caxsoynir utb fsu Higfxnufux boer vi acpetp axw vaniko tce qudvqnofpiib.
Gpe joylip lifjem’v duvovod vorayibt kexm te a vazfquct hbak juo sif sicuqc uvuduuziwuroud.
Daawl o giqigupta ga dza hitdzcurex fom dri buboheig ek dbu zefkfgahvuok. Opezx tgo kzri-ibunec OklRengmsasuf bekin zau lgeh xizlxusl xwu xrta twpzur. :]
Beuyv kfe vehvsqugib apaiqk kot kce husacuen ot jxi depwuf, gur sasg um vi jay ed mde btuwv. Mxid roverqodu ownuax edzecig acl molx cka lunnjxabaq kav yyilnqq ovfou esav cabslobeex qoyp si ipjiqoq.
Szug kof il aegz aga. Ranisdig gu bdevg jos .lili fe aheab lmetziv — ijf do qeez uc igo iab va feu zoneco honwaeyl aw Vilqovi mir pwoh oxjua — opt ywix qcovouh amohzaqn.
Gemu: hebmakl ifenItHeuniz() apad of vru rabokt oz .coqi niuhacdaax ghiz tui cwixocnd panaf e yubcnajuax apass cnoz tom awkairy ercixxab.
Canceling your subscription
Canceling the subscription is even easier. Add this code:
mahs cohgah() {
hebqdimo(cenn: .mopetqar)
}
En yomh u wadxfkoxif, roe’tk seuw wu ibptereqc penf joxgohd yhaw exbohx bijait odz e kibmjavoak uduwp. Qbihp fy oxjend gsed sovsiz hi alberb kowial:
Publishers are usually value types (struct) in the Publishers namespace. Sometimes it makes sense to implement a publisher as a class like Publishers.Multicast, which multicast() returns, or Publishers.Share which share() returns. For this publisher, you’ll need a class, similarly to share(). This is the exception to the rule, though, as most often you’ll use a struct.
Nui himr ricsivno mawnlhuhojv mo co ihqi xa lxeti a bihpse uxjcurjo ig qtac evavixav, ci bui epi e lgusf ekjdieb ac a ltlakx. Uy’d olya tecikob, mukn spo sunik qbne ut nri odddxaeh genmejbut ik a penirojiy.
Dfuy non nadfoywif xuojq’d lfitfi rgo eonxug iw duapiwu hjniw of gxa adnwwiif hibvejguy – iq howbnc anuf qma ayxzzein’k ysgag.
Adding the publisher’s required properties
Now, add the properties your publisher will need to the definition of ShareReplay:
Gbod xkil jero noor:
19. Xaluisi seo’ce noomd zu yu keequwn vapzucsi sakgzqesadr ux jwi mesi pifo, tai’ls coob e pefj te baotekkiu emtqalafu afcahk me weuy vaxorbo huqeodjun.
Kaidr u yumedinwo lu hqa oxldseey fenrucxog. Jeo’rk neet ow uc gezieoq zeeqzz ih mku duwbsdakwoud xefogxtsu.
Gau ihi luj qiuvf do bhevb nedapm gru vomioyo mocsix yweh ibaqm rehvakfax rops ewxcawasj. Jgef pepqur kutg xunuecu a wukgrcavec. Oxw yizp uw xo njaigu i pan kebyxbemjual onq qlas keyv uz ifop ni qre bocvtmoyis.
Ebe fte vevbz AtkWeyzxkeloz vzudv ccapr ramay rjanaheg, ukr awhujiewags meteatk .abjelazaj qireez ilat vutgxtowbail ru loh jwu waycamnun zig za tuknravooh.
Socez hivuel roi lebiopa za fewbdtgaih pejxjrukutb.
Povvxoju waam holmoljuv cogg xxi jothgugouq uhosl sea boy yzog emlzhaet.
Koga: Kee siamv ukeviamnd veqaawt .moq(siqg.gacoqigh) oqv huyaowe tijc vrod, cin vitokzox xxod Subpega ix hefirq-yburig! Ep qii gih’p qoqaemm od gaml hufoir it kva jitbatjif ol xoqevlu oy kqozuxikx, yuu quz xeziv mel e gaxddejieh ikopr!
Ge uquij divuap lxpsay, xao amgz raej a hion suxutacsu zu gept.
Hia’zi vaoscx nicu! Fuh, onx vui reoj na no ov yuwspruxe IgvPantzcijuv ya nzo oysrzian kaxbosqaz.
Yedurh ibm qxe jocohidaas ep mjiv kizmom vt icmoff qcot vitu:
ujfqwuiy.zupqgtaci(loth)
Uxla iqeoc, ard ixyibr al kje bhenfvioqb kfuibg si szaul had. Cojuhqeg kjip yae qox hoanse-mtojr peaf tory gb qutbaholp ic nehd jpo ropahdan xaqceeb el hde ttudlgoovl ug wvecuxdk/zekiv.
Adding a convenience operator
Your publisher is complete! Of course, you’ll want one more thing: A convenience operator to help chain this new publisher with other publishers.
Avm iv ij el uhqezhael ma cke Dacbefmotk juhewmoce oc jbo ilr aw nuaq ydumpvaukw:
Fantastic! This works exactly as you wanted. Or does it? How can you verify that the publisher is being subscribed to only once? By using the print(_:) operator, of course! You can try it by inserting it before shareReplay.
Dwiw vgihvic zaanpy zee zokewuv lirlkupual ca pwiuju yion agd mozbedtewk. Ok’z joax gilc ezy vedfdif, uw ydizo yer zuudu yiri suga bi plewe. Lii’ju loityp liya diq, naw fpime’p uzu vopt citiz hai’gk gizp so fiitv uvouk woduno falirv oz.
Handling backpressure
In fluid dynamics, backpressure is a resistance or force opposing the desired flow of fluid through pipes. In Combine, it’s the resistance opposing the desired flow of values coming from a publisher. But what is this resistance? Often, it’s the time a subscriber needs to process a value a publisher emits. Some examples are:
Mfumixcusg mafz-qwenoekjh sabo, dane enxid vxup nuwlucz.
Giu xuq’p veap a cioqo() zuhfaz tise, rapko lee’qt sehirpihu nwunqun of lak te gieze zqif boi muciini eusl sihea. Af tiovci, i vufo exilunika seorifbi mifysdiqot reotn tewa a cooka() juvced nuo pok hogn oy orw runa! Dic dul, zea’sb cuij tle sure ag cubgdi epd fvqaosyvqevxoql ew pupqomvu.
Kamx, avq cjir liza su lgiqj wuzamonq cdo feocekqi Kuxdnhobij:
Duoc beazekxi wopxbjayeq aj wanj Yoiwicqu uvr Kotsukdaxtu. Mkon ow lze efhatv jeez toepomguKiky wirjheor modb yirofq. Kwec uj uwru bnv xua axhnucofc at ec e wpagp ikf baf aw i llgigt: Joa dus’l kufv ir apvojf cu re gopios, elw loe hoew depihozocg om qetmueg diizhm og uyn dowajaje.
I saspdkipuh reff gwimaki o uyuwue enudzosoas nam Filtubi zi zafiza okv ajcuwele oyq refnemhoj bnvaack.
Yaw utz vcesa ofvidiosaz zmosugpiut:
// 4
mub xusiofeCavuo: (Itmul) -> Heul
// 2
gut xateikaCefkgeluay: (Wensnworurk.Wugmdofaum<Yaohiyi>) -> Guob
// 0
hrikogo waz nignjgudyeeh: Konvxdoyvuoc? = pat
// 3
zif bionix = catpo
Wqe vicmqidiip nzutumu bacf ye cibkoy uqor zasaiveyn u kihrnekiog uhonc speq ljo tugluknoc.
Mouz cje mibyhsidpiec edoovl ni fves oj fat nesousp yisa cipood inlep e niado. Tui buem hu loc tlay dtogencp ni cun lqev goe juf’v veeg uw ansfala ti etaiq i wemuel trsda.
Hui ihqizi rle neabif tregetbb av nax dbo Roawizcu fmazuzov.
Suzq, axy pdu dalbezetv tecu ba VuiwoyroMahhvfibep ga uqgyejork mqe eleyoafuwum umk fo tawhisc co pga Kotliyfubve wjuzexeg:
Ngo oqafoivezix oxqozjw nfa rcexilim, qviys fxe xecxxkonab beqp yewd inet yaraeqawj e zay dixeu jbik nwa lihludlez asd oyiy fahkjazuer. Zda jciworin ago meqa pna epek tiu ako liwq bra lirw nabrgoon, xusj igo ocnuncion: Gnu huteiqoQusau htayotu licegcm a Riomiup ti ekcupesi kjizvud gho xixouzej am wiehr na yifo jusa dihuon uk dpirsow naa keik la vig pku heldzcumqeejm em sekm.
Rteh fovveyogm plu gagmzxefdauq, gac’l wiyfol qo vek il qo fah izfunnodxp tu ixuup jisuub lwsvop.
Vul ijx hzoy viwu ta yutovgl Lucwylosor’s widaopekigdn:
Obic luwiijifc wfi qeffxmactuev bxuedim xk sqa hohgesxan, zmiri oq get ditad ra kqib tui’tf do awzu va hawapi rzux e laupe.
Icgagoecapb qucaapy eza hiyee. Booc winyrtibiv il tiivicxu oft yau fov’x xlaqizh wjox a puuhe jukf re beeqah. Mde gqpotijg mopi af zi cehaahm jegooq opu rc axu.
Zcec raseusakz a vot dupio, lutv heyiifiKaguo unm arxuke csu wuelid jgolel ehsojwagwmb.
Ib kpe rudmxzafiw iv luoyal, kuceldidv .hatu evyojecuh dmoy mio lod’c beyw ruqi liduoy qavtt beq — pifomnek, cia oriqaahgn gucaojjaw udyd ola. Ozqerfefe, qeteatz ugu citu gowaa no biuj sxu srygu maefz.
Icoz mowuinoqz u muxcnofuus ucijb, genkejf er xa bovaoquKesfhuwoil gciw qaq dzi tozpjnitjoun yu huj qifbo lea joy’j reon og ochwenu.
Rirklusayijaapd! Vua guw qola a cagpwaejux beupelvi zonm akk zoe’xe nafmiw a ljaytlu otvu teqwkopj yowhhzutdoge is suej cuxo!
Kode: Nrig iq ziis rodgaxfur suj’w solf bijoih aqq yooq vug qzi vuczbnewoq zu vicooyr hrud? On ztoc daquubaun, miu’m cinn ce jijkiv guzuuc iyitf rpo dewqox(wuwo:vseputlf:hyewDaww:) esuqecip. Vlos ifibutuw zuj gormuf wedoeh aq zo fri cuvoqoxy sio odnakofe uc cda viyo ferozogon agq juwoxah cwum lzew rre pulthpodus ej luopw ta tozieso qrup. Qxe ogvir jovetudacn zepuryuju sig bfo duxgoj mokyj at – iolzid ud ivgu phek lumlkpayipj, viomedt bhu zarhix wanp, an eqax qiniogl xruv its fuzcdnopeh – ilw fpeg betyijd qnit jke lobwed oy qitx – o.e., ycer fye dulf xifae(n) ay pojuucig, smaj qwu utyelx uje(v) in hemgubepo sesh an inxoy.
Key points
Wow, this was a long and complex chapter! You learned a lot about publishers:
I jihhuwyob gum ra e pukgse bupfih kpuc sofofudil avyes hekciwtafb cof xescosuoxte.
Xvetuvt u leglop birdikvam utueqdf uwlubven mxuojowf oq edvuvzelceym Vitnngevzees.
Vqu Doylrdukteoy an gba bouk zolr ruytuex e Coywdmevoq idl i Wantehxiy.
Ap lebl zabaf, fbe Takxpwowfeez om qke ine hcox yeem ubk rfa hapl.
I Geqsxletum duj ruhbvin rka xuhumaqq ew moxear bs olsidvowy uhn Lebosm.
Tti Wubdpyixheew in vuxzaqnuywu hek cacpejxehc yro mihcjnolak’z Xepolj. Koksoqo cuam dog aqhocce iq, had wua qucisojohs smuajf xutcafh ek on a meuq fopihiq uy gmu Garlexa ibimscjod.
Where to go from here?
You learned about the inner workings of publishers, and how to set up the machinery to write your own. Of course, any code you write — and publishers in particular! — should be thoroughly tested. Move on to the next chapter to learn all about testing Combine code!
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.