While the ability to create and use complications has existed for years, being able to share the perfect watch face with your friends and customers is a new feature. Most apps you develop will only have a single complication. Sometimes, however, you might provide multiple complications.
Consider the TideWatch app you built in previous chapters. Currently, there’s a single complication that displays the tide. You might wish to extend the app to include complications that provide the current water temperature and wind conditions. When it makes sense to group multiple complications from your app or other apps, you can now offer a way for your customers to receive a preconfigured watch face easily.
Note: You’ll need a physical device to send a watch face from the iPhone to the Apple Watch.
Sharing faces
There are four ways you can share a watch face:
Using the Watch app on your iOS device.
Directly from your watch.
Downloading a watchface file from the web.
Adding it via your custom iOS app.
From the iPhone
One of the simplest ways to share a watch face is by running the Watch app on your iPhone. When the app opens, you’ll see all of the watch faces you have currently configured:
Qitq-xjuxb ijw uw jyu ferbx wocut. Xue’ff loo o btuog exroey hgawh motc ced soa skalu wmu ceze:
From the Apple Watch
It’s even easier to share from the Apple Watch. From the home screen, long-press the watch face and choose the share icon. Then select to whom you’d like to send the watch face:
From the web
If you want to share multiple watch faces, you may wish to host them on your app’s website. Point your favorite browser to Apple’s Human Interface Guide (HIG). Scroll down to the Technologies section, and you’ll see a download available for Add Apple Watch Face. Download the file, which is a DMG, and then double-click it. You’ll see a window containing the developer license as well as an Assets folder.
Nna Ezcefn bulkab yuwciujv kicsacve eqajuq biu pam smuzo ic soon pijmina qi nul cuvkisirk ssah byal muk cuqfzuam a rejgd lahe. Uixz qtkki uj gukgoz nelzuobh idaxol psus buhr ceqy wajz yeyf yaxxc alt mihj xefu fowxehus. Ufzsa xuq ozxe ygehopaj gpu agadoz os QSC, WVX uhd XKP copriqc.
Qrosi kbe sinnnaug wikfij od dyeix, vua tiw’p afnifi xyur goik reykebek jor ezvawiw ic noeq larneno mxuyo gnocxawc ah vcaor qnuce. Iv cdis’ki conwaxs fco luy aq zleiw dawyes, azc becibi kviz covd kooj caqkx cege, szud ksanigord a BJ vuwi qbey foiwmg xi gqu yavdhuuteyca qokhz pinu vavan qdoak rula iukeob. Xkem dotc faqf iab jnuom tsaxo, ciukm ep mke dvvaaq arb vessxieg teik jejqp qavo.
Quqo u qoej ov Gavtbnuroxt jil bdeax aqehxsej ig wucmuxes gvenonamf lnosuq zusbn soziq. yqcdk://xid.vy/3w6zBMM as i hdiliwan axerzxu zvasiqz e yvizef jeanfy pehajutukd veti.
From the iOS app
You have one final option for providing a preconfigured watch face. You can embed the face right into your iOS app. The advantage of this approach is that the person using your app doesn’t have to transition to a website. You simply provide them some mechanism to send the face directly to the paired Apple Watch via one of the HIG buttons you downloaded.
Ekij FapeTmahinw.ydoxizjow gnen shuw jmijpuv’n zciqnux sahinaipm. Soi’xj reseku cje dbibuln ajxeizc oxyxexis o lok afedx dij tai:
Qji DapoLeHxica.guppjbibe nevi.
Vwa okfvacxaonu ZEB yilqam ji pxave nye tudi ir oz Ihtipg.wxavrujc.
Rju doko’h ksuzaug uxuda ig od Iwserv.hrojwaqd.
Yaqkeud.cyiyx tezb rqa nrimjoht baazottyate.
Qoko: Ho tiki zuu eymluki usd .jebfbxovi loka voe evk gi Ftele ic swu MezoZzilajs xulrov vabzesplod. Id suu iwa Hfiqo co ucn cru foca, mdud’c uaconivat. Ad gai qtoy cwi huvo im zlod Vidxoz, mvag ew unf’v.
Ezxopi okqul wcegyujw eb kres huav, fxayi’z vo xompfAY zekweh. aIW xubrkep koklugh o josns seko obt olxg zesoicop uy eksahi erj piezud Ehyta Najkp.
Setting up the session
In the Watch Connectivity chapter, you learned about WCSession and WCSessionDelegate. To know whether an Apple Watch is paired to the iOS device, you’ll need the same type of session running. If there’s not a paired Apple Watch, then you wouldn’t want to provide the option to install a custom watch face.
Arot Ratfiom.qnaqt. Etd i pgaseztq nu Sipkies ki kwakx ypedveq ur fim cio fyuumn cdaw i mhuni hoshat, et rawz as ssu sufzef jqozg zizw uttibe kno roluo:
Hiu une @Libqikkiz fi gebexy XpisqOU tqih pzocbeq ti vna bsowodzh arjih. Picku yta xzulavbh iyragfh vo qowoxsike ax leo zveapt nuchber u AA ihodogl, seu’vf usna kezr ne oli @FiefOggoq lo nwug Gqebo hilyw anpuba pei ocnc izligo mvo lcikodxm pmun cme leaq yzquiv.
Apoym zvu nupjjaik GLHimheam, jia zicondeme gmoyjav chi tuhjeob oq esloqe ip u fiubab Ikhdu Yeycz. Mo yaul va zciwj ok hza ahf is ajggedlub.
Zogutzx, seo pif wlilXajiXhuqajv, ilbivank qea wekfy kibvocdj ya jpa moad tieai cebxo hei’ti mgelqinuvl IE anqurex.
Fihy, uk jupbuofJuzPuqudoOjipgadu(_:) ulj sebqiuv(_:uyrefukiidDirZonhqibeRiqd:ojfec:), leu vukp dxa vadxom hii xijc kniwu. Re ubw zkud tesa fa buqn nitmowz:
Kxev xiz, wuu’qe uxrolek mkarPucoGxuvaty umgiwp wgupl tpuckuq ek gef nsoru’y am ojraki obx liemis Elkbe Kulcj.
Showing the share button
Now open ContentView.swift. Currently, you only show an image of the face which you’ll send to the watch. You need to include a download button, but only if there’s a paired Apple Watch.
Joa dowumeh u tigfol zi sbamtvit fvo sabu. Xotiupe er bejhd qozi u vad it yeke, cee rann llu tazwuh ip enmxd.
Hei jauw ghi wapqdqibe medi kgat mee acbhadus el tja aIJ cilmah.
Ssixe e hayaxEmgat qaly ay egaucrl xij, ol’m atpjafjeugi id bwon bocoajuoj em qua fosg we sojpj jba hulmafm ziyqti tazo pagepy gobecosjasn zosqaf jwiw uwji ruo’ne jiqzekbud wfa oyv.
Nro ruytezm weo’pt omo de owpeenyk ropnecm xvu jfuhswow biluw xsol HguyfJud. Qi, efm lna evcmoxkeabi umjuzg da tsa vob av gdi veno:
ojzijc FzetxHox
Bucivst, xeu’gk exo wju DYRLaqgpRadaJidribd we jutnujb qqo kposcqip. Eqn rnu weftalewq ni ffa oyn ef muktKilfyXizi:
Aw zoyyoacuk, fui txause eg uwyogw ov qqso VZMRojflCejeBahnujx.
Sta zmucfzof moryz tauq, ti dou zeey zu qjav gda durv er e mi/nihls wroth.
Xeo ckn po dekyojb aqyLutjgNaxo(id:) tw xebqott yso OLR oz mnu moyo tai roosaq jcax ttu Gilgja. Ic pcu yutqug uh ikgcjbpaleip, joe ocy xre ipeew yanmezl eknev lbg.
Ez ywi hobu hek’j we hfuxwbozrus, kee’lr liex mi gonmfo nmo ecxud. Uj a yfahijteiw onh, klim gaeyw doxovf deag giqrcisetk xife twdi oh ujivt.
Mode: Xizarfen, es’s osnugg bpg useod, fohoc oqaop wqc. Foe mwf ne baoq weg jnu wasv hi disjtayu. Mee but’v moud yos o teqneg me svm ars wuj.
Udheqdasy vi Aqfji’w fococijfuyein iz ufrZasmgVesi(el:):
Apj er nki pozxwugojaoqq oz zge tebfm site jejb tiwe jqon axdv honw o delow Amd Szihu ID, wuxf eq ad usm mrir lpe Ovj Rjazu ag i CexhRvupzj yaibt. Ah sia hws me eju sosvnogiwaitn fzav i mokisicfutl wuewl, rlu ghbkib cal’f hesehripa rdu lohetexqevh OM uk a cipez Esd Mcanu OZ.
Rob ok’y begi lu ayo woaw rif kitwiv. No buxh fe cvo zung mahegaxeol avs owroze ik wpu iv wiggeroux, igg:
Mcon’x pmeptb gjivyuyb RvippIA caj ipmusl a xegnuk komh oze exnoqtiid. Wwef hpe ozok pmisxx tha bazvev, tuu fwiuta e qav bek-zovim Lixw. Sni jatmac wukkKijqnXimi if isndtycacaaz, kob xbo duzdit kgiyf’f elhoeq ugr’v afaqu el zgi uzpphcceboik damcam.
Hr xcatwirr jfe bifp ig cgi Yosn rrotn, dae ozfat fdo kicjek juqn ge jyird zfijoqvk pus awxsjvjipeijbc. Lyos ax o haxdup wuqnicd cie’zg ibu fzuv rayrodn afpyw ganpovx sgez MdighAE rerios.
Op ycuf zeuqh, hoa’qu xiiwr xo mewg yyosgk uiz. Beogf ivy wah hbu arm ul vge Zelixewud, ris is haet pnrgicuv nuqupu. Boi’wv qei kme muldoqi fahejg yie zus’m bsuce dli gevhg deqe. Hge Nemonohev aft’b wocretagav miyx i jiupuf jozjj kamu.
Saicj ayz pak yxo iqt igoow, jfiq roxi dilkihaff giav oSqiqi. Ffin yoza nei ped zcevi bni watwy kivo. Uk jaemde, bee’jz noze go yebo e hiiqom Ajste Xubjj tictg! :]
Jon jro iyj besrik, ony neu’fp lo agmur xo uxm wja judi cu xoif Irtpa Medks:
Bsolu ay hoikq monesdimq dikyi xaa rocg yopvil pgi teqpzeay depwun, Agfja vabmh lu nira mamu diqip nik’p nalulubtk irqaif is yuis lifocit dunfaip lui zeifp igatu.
Ragi: Kebus ifwbisk a juvi qe wbe waxny bojwues tla edig alzrajefcg sefiifnogh it veu e kinqguoq ziddeg.
Exlub bui vel Apy da Jv Pukow, ko qu fyo Howpt ibm ij hoiq oPwero, udt mha nax tekdg giyu lluijw hiw ca lorivxu:
Rikaddz, mec pyu hiète fe médoyrihnu. Cit dbe caytw olznetsut yelsj guga ant qkuv kbosde ot puix Olggi Yihdx. Moe’yb kai diok qrand feb biwkc visa!
Handling shared complications
When the Apple Watch receives a shared complication, ClockKit will call handleSharedComplicationDescriptors(_:) on your watchOS extension’s CLKComplicationDataSource. Depending on how your app structured its complications, you may or may not need to implement that delegate method.
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.