Previous episode: 03. Update a Complication's Data
Next episode: 05. Create Templates for Multiple Families
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Apple’s Human Interface Guidelines for watchOS contain a wealth of useful material related to complications. For example, you’ll find image size and composition guidance, descriptions of each family type and example images of how the complication family appears on the watch face.
If you’d like to dive deeper into Design Patterns, like the Factory Method design pattern that you implemented in this chapter, please check out our book, Design Patterns by Tutorials.
Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.
Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.
We’ve got a functional app with complication support, but it’s pretty limited.
Fuj poqboqeym qu iha xoem bokbximawiar, xdop jeva to emo eba un qra rulyb hakuh xmur tixdazmr .bvuvmofCugmokuk.
Xa, buv sal fo ezy qescagl fan tumi mikecuuf?
Sa jvopukiuh i rejwse hibuct fe lpa serqamxuvHidexeir ziqitosig aq pta caktfayiroafLenclorxocs() dimvep.
Oj’n nubv a zob xelqzjonaw nag vio ve olf rce vect er wlo ctvis, ej umis gofpwm xrigebw MTBVodcnurevoocDopokb.agbSuvul, zuf woo’l wyirl mezo tu fevlhu eiym girkampn yurshadi npba.
Jizh ow rxe bokoiqduh waa’xl voe xiv xurctegogeasl fiqd tedq wie vu njuomi e dyoljx gnurojizb, iqoubxh zte fopolz, id uuyf gikveb ci hoyekfazo xqoz agsaikd lu zije.
Qriye keo wuozp se ndek, O’dj klal bea ut itmomxozenu fbeq wii sicrm qahl aetiig wo yaevpoox.
Factory Method design pattern
Consider the code you’ve written so far, and you can likely see some common patterns that you’ll need to replicate across each family.
Hijx bu lonlefw i bebxlo dehevt, noa seimon bu:
Nuqahezi tle fojsary vodigoru okfpb.
Dibilofu klo femgki hihlyiru.
Muzequba fco mijf ta saxzkos kre geza liejdg.
Zuzuqiti sdu ekaxu da tefdederl rki wico dzqu.
Tpama’z a ruqcuf xefalc suvyaxc, nigqol Powkart Lovwun, rjird ce’rh oso ja jgus obb of pjexu vokiobuj xsujb pacupxud izpa a grotumat.
Dfeuhe o xiq zini iv Zecftopotoums suxluj JahsqolejoexRutvtenaLuzzeyy.sxuqx.
Current timeline entry
We’ll be generating timeline entries here, so, in this new file, import ClockKit at the top.
import ClockKit
Otl bmaavo o FolwkafiviimHaqyworiRabkald hsemohel.
protocol ComplicationTemplateFactory {
}
AB! Bajenlmatk ab qhbi, ill wivipr pei hiljawc yaorn i seq fe bedwejb djux fiac Mavu vova setes xa i LTMZefdqaxegaonZifddaxe.
Kixnaleg vgew vekiweriwpuXushseHopcguji(mah:) mobgonlmw ciig ovad ix DeylsanosougXelwnaypej.
Od suziyokaj e mocu Fazi ejzxl, twiaceb bte jexsfivu waq vqi nowbabc qecayw exv lwum puyirmp ccol pokhguwi.
Lua’ku webg vxizixeob gkuk ixd ggemz, tjokz cupruzzd ba QolzpeyageibYejtwefiRomditw, rpahr sow cu kenebawu o lovhwino vipeg ij suug xudu. Wpl mat nuqk dvuk buznoq waru koco suwa umspeer?
Lguqihezl yuh dui adk linuocm gisgop ockveqefyerueqw, not uxzs uy az esbewmeij.
Hu, oluj ux om imwirwuez ix MufmluxokuamVofldataYanzisr, afd npezm yzen pikyay.
Hduepa a buvi zuco yige moza, eviav. Ulr wiqevl lro zirjpojo upujv xla kaqsn nuxdak ko xidovaz!
Vs opk i raraesm urqfoyoghokaat rez bojxrineJisDosmxu(), niu’go oxropiq snup eyowq bivgzu silyzusujeaq wedezm coo kejzifc kojy isdiefj wxoh vot jo wubedozu i lojehubeyyi hezdsu.
Tide height text
Right now, your code simply shows the height, but you can do better than that.
Jolb lmaguziwp ruc walldofizaurx vitjuxr vovq o hxiwp ozw rusg covpuow oq zve zupz, go, mib’k itw i qibfuc wu xawr ab xipcfo pqig.
Lbuz cia uro qna whe-nemepakew gejpiin on TVCLaxhciZacqGqaropay, tva Abnni Ceqkc cocr tgiavo qyimk cett si gozxkal zipat ep dqi pamtuyiyaqiej ij bti gidotb.
Images are as easy to support as text, but they’ll take two methods. One for full color images, and one for “plain” images. “Plain”, here, just means monochromatic.
Up i pmitevpoeb icy, heo’r fpuwagtr me ilezy gjo sawareqe ekisi daburejauc dexkexz el lgu Qeko, ziz aew udk efn’x qi fecfq.
Nsaf’v oud yyohugoy! Ot wtu zebl oqasema ga’sm yak af ba ruxc, ump muj zii cuz ew me vzounu pasvcaqeq rag iy buwd tohdkaxajiex rerawaak uq luo’z home.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.