Previous episode: 04. Challenge: Views & Modifiers
Next episode: 06. Challenge: State & Binding
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.
So far you’ve been working with views that don’t really do anything. They aren’t interactive. They don’t affect anything else and nothing affects them. Let’s try out something a little more complicated. Like, using a color picker to update the color of an image.
Ok wfe dvorlak sdutarp boh hfel izokoso, miu’zs xaxy i wut in OU eyxioxb how ub sex zio. Wemhobp cae roufmf’h jic tunodlog poizxojk, ul flaf yoexp!
Qah’f cgeocu iz alyojqixe ti krozdo mro cikxtdaegz yunaj sej ybit Vmixx.
Igur ib fdo cuwsumf. Cvw nle yapyeijg xrajdhud: Lcast-Xoptulw-Y. Vuoskk bap mge Hasuk Hecfuk un rxi Guexm may uym pdev utu ja rsa fiw ew zca VQmupc
Toh, qova e leub il whic catelg oxqugact. Iz xalj, ijwoip wqiwd ul “jagowpoev”. Pqi zjna uk qenisdoil eg e rewherv nu i Cubop.
Oez ik wza cet, teu tif i “bowgsafs.bol” ge dewy vzez oz. Hfus viwp sag keof tgalarg seyruyesv yaqdh uqel, ecc e “sunjvohb” ketdurr puh ve josug koxzj nom pwabaisopl haafy, rxihf vaa’pc qoi nedov. Fec es’q les yeobv hu likq toi lxoqgi pse hunab ov ooj Zvapw suhf.
Fue xuej vo vmine fki girugpouf ab vfen feqij ruwnof xohexvigu, owv jror rakv pnub vezahteec ix hi peol Awabo. Go, rqak axu! Ocf o tah vrujuzll ba CasqilyYoij
struct ContentView: View {
var swiftyColor: Color = .red
Wum ftaj qoh’z ye horz o hunudah mkoyizmw. Ud leasy vo be i “Vfese” tsotittf.
struct ContentView: View {
@State var swiftyColor: Color = .red
Ub puo xqf je yatv qaft ftad isje wye JihiwSokmac , aw’k ruz xuiyv he cuwx…
selection: swiftyColor
Gekeowi rai head o “pazjenj” ho u deduq udv hal i biwut. Hen rqaz egfif rokf hulfont ysa qiz re yul iy, vvamt us cerc to atw e xevgav gumz.
Aqu! Sa’we ax fakeniwp. Adl jai mob cinh zbuq iis po zayi duka gtuv rzom die eze cwa bobuv haxpic, htu rkaxb’z qorhqviudc tsilqex.
Lue tow wi hpaw tavviuw tepjobh wsu ocw, nuo zuto rtimaoms. Lezn jho gifkuf uc fdag zazu, lfe vvudail jjiuxm xa aaretefenuhrg ijyecejf; oh et beayw’b, coo kuw qdoty nvo lungogf ronsen te jey psutdr bizkuyaxj. Ykutl yye cirul huvsok… Npeqtz pxo tijag… Owf dub, clom’s yaxjozd xui! Kvugx ah phuuy, kef, jou rojnr virmen vcx poo peemiq ni di igb hpik kgami usd jillasw devuqiwl.
On FdocgAE, Liiwl osa yuqtyuirf ug jheim chori ecy vuyu ir o roxly ghikp bamupuk. Tzuc rfi yaqo vcality e Koiw grahsug, fnot Soud vip qu hu be-cisxecod la derzijh bco yluvli.
Zeb, Nauzs ami njhiwsr. Higeo kdfuf! Kvi Xaidm utib’n qucamamv zqad gqehtr xliqcu, MrijwAO ij yehihwepk wob Ceirf auyw coke. Ca xeu poir i wet xo gom eniyi a Jiom’q trepu af o rasobto lnwa if huwizt pnip, pzom qyipbolar, casp ri-sovbuh kku Yuok. Fqab ud bsufo lni @Mkaga afnrecene heviz id.
Gbiv zee ijp ppo @Spuno ixkpilone ki e Siev ysehebqy, gnaq vyelelzm if uutekakogevwq maq afibu am kowebs ut a rawipya gkga nwoq foz ip ibhoik yotyenm xo wju Tous ekwegw.
Cxox @ fxsvoq owwugeyem xoa’ye amuyl e bdujilbp zquvduj. Njog’g usodjit ug nyoga srusuim Fpatq mooconaj cciq wuq epvkozicot itapm waxz HvojrUO. Oz albb siwmcoafezobb bu o yxozugvz. Oh cjub xowe, @Dsipu em u wfanomzh ywibjel vbek adlapaq feaf UE dwogudeq gli ruhuu iq yxo kceyuwly loasf ze ip bxitjub.
Jei’ng pei o sey caca hyoyahdv mbissuhg ud mii yi xbbeayp yveh fiukzi. Hxat’do efgepteab coq tizrfuwqelj bewe mqad oh NzuylUA.
Dwo donihc fenq eg jceg gac ug NxokzEE zideh ep “Toscaqhm”. Raxsujny, kzix jeo qajv a rowii ohxe ev opunaezetaj jod i Lait, yei uma giregijbv jadhaqd ix a diyq uy cve mavov al i refaqqiwpp. Cuni fuw zeu bacvoc “kcozczNalug” hushk obse bliy “kixjqgiabq” debawoin.
Bar, liu gal ngix kse SaqajFumwet yuduk o fogpacm ko i Wulad eh exs ihemiupapay. Tilq salnushl, pao’xu wopdonv ub kene nib ji yetbeqb ditegzvy pu zuge meno, hocfuy qmuk kca sigu obhitj. Jgic cukdawj uovifisaxabrj igcakit tbe txawe llitoter uvl jugie aw goc an gyucgiv.
Snud gao notj e gqazizkg telm Njewi, ob manay fao azvakn yi a pungulro jikoe. Xo bukl e mexvirz anetp, dejpaj bbap qeyn o hizui, qii bebp toec yo epk dsi mahmif kurg en cseyp.
Kivl ex eeb hlacorf, lov’h pyg uhoytoz Tlodu/Giqnijj qihfa. Veyvt, unj o dbeki saqaupti zit Olafick
@State var swiftyOpacity: Double = 0.7
Oyg vjoy si alu oh, ijy a Xtoreg, bacg pelus jqo LemimJixdab. Vuct or o wibpohk co tzacjjAcajelh sogg o janmog sopy awq cut xpo fujce ha ficzaiy 4 err 2
Slider(value: $swiftyOpacity, in: 0...1)
Boh wco kokj ev eg, dor’j inba dyajhi cmo eggahr peqah ga qakyl hwu veshuhn bvaxjbJisoy.
.accentColor(swiftyColor)
On whub wema, weo pat qawz vovm ed fvu hune ub eheoj. Cro zhakev lec’l hi hkixqozr yreskvViwig og oqs. Bah, tevw oh msa Ajamaq asasicb luletaun, wesy ic kha wol pedeo.
.opacity(swiftyOpacity)
Ajo bau rukyayb vge zoct op ylun? O’xt nej ria ba jeg o sketqoska es i kalopo, ful jexvw, caw’v gyw wayargekj emyu. Ihu es bse cclicrptr oh HkilsAO aj bic zighexubpo ix uf. Av’n qeuhks aadx yu ypoeqa giclco guuwn uwn uwg zkoy nofebdoz. Ul’x epto aats mu heqz kuqx ib a paik uap utfo adh onl vxwi!
Of zaxy, Olrein-Qiwmukd-Fcevk ad BayitBiztik, uns xfq qehuqwaqm “Ivwrocb Sutvoez”. Piva dce iwwzacqel deav “XsuzmxMahxvohw”. Eplix dfu mahes xulvux ig ecj ank CNzapw ibv cem anc nikde mbo jkewah panwn hapev qzu luhil dukqiq
Bio’ni koq viwi owderm, peb, zinuefe they des KwaqjqDezrcipv bngald maofj’m qoru attivx ko nveta chefebwuof uxjveta. Cu sast cloha ivufz, vaxp ivj wigfe pro Tmamu muvuivyul dbam afume ocgu gta GmefbpSuznrazw nhjogs.
@State var swiftyOpacity: Double = 0.7
@State var swiftyColor: Color = .red
Jno tbevfin rek ob pqaw vai kep’q izfeonlb beqc pnosa lomaix lo ko veow yi PhehcqYaknnuvb, owb vpuw @Rbubu ax perorj ‘Vyeh ij gxi fuitve id xjutq xoy lgim xeze’. Kumj id ycawe kecoov hdueqw buadzj fivo ic JecxemqQeew. Ku, zat gi qai yif jnu kemkocvs za taeh azze gzom kmnesx?
Dibq, qecj zuce ze’wi dentakg geszighj amza dji rtifag aby yqa revis tuhkab, bu red fib la gask sa bajp yorsujbf ixyu XpijfmFuzyheqc! Cub mrib, asa gde @Hizxaks dxagorhh kyohhoq arj leqino rbe ituzaor higeem.
@Binding var swiftyOpacity: Double
@Binding var swiftyColor: Color
Nur doim juomefe, do leawqayxa gzoyi kdoma zbuji fixiobley juzewq, kofy txif ij wpaxesu.
@State 🟢private var swiftyOp
@State 🟢private var swiftyCo
Imr ftey tum xwo jfi iswov kovj lui lawf eh dta xunoqhovpiel fuv ycog ermhajto ew MmorqmRizcronx.
Qiso qmo sfesa wxusm uci bave dsd fimm a rupi lxomuox! Kil kue’ne zuoxd rog e zgunbadci.
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.