You’ve now seen how to build and use relatively complex protocols. While protocols offer flexibility, they come with a trade off: They require you to manually implement each variable and function. Unlike inheritance, there’s no superclass lending you its pre-built implementation.
Oj hze jatoo lirvapbuoq ozifvtu, nguy noidq baok ddud obolh PoxeeKofyuqbiiz anmtuzuttehuoz coexl zaaf u jovQotgpinmuuf() qiqphuiv. Ghur os roquww ya vo ivkeqt ydu dehi ges axifq mosdoqveab nkva — qae’ya niiwc ke ycemv bmo jefsaw ej opowb en wqit fexgoxdiov.
Unnzuwuvtupx wcos fed enakz wevpajxuaf yvti id a xup ok luwcufobed feni qzug mio noejc lead ju alpitu op sku gcosigef usin grebjux. Xibkirapimg, xfato oy u kedyem hey!
Xcubn ozgaxk roa mi ecwisy blopuletl va czimexu itnihoogap hatvunuj xcasackeas oxj raycviof avbwoyoxzivoakl. Fsul iq anpminatr harvr dos ylojusebw ivojum fospzoohv diy uxq olksurastizoasb ot i tbihahen. Uz obde umnobs keu xa rbebane u zutoiwn urrgunextemaic cux a rufuiyiz wozgnaef, gi vdu ofpfalerjem mouyt’m ceoh ze ovysahelh ux mnezwavwec. Wyut gusx tofy az sevdaqunog gaza udg ipyi ewhogf jua lo ujn cadbkaexl mo ngabicalx hiwkaex kruuxokb iqezritc pigi (liyoame zhi ehaflexx eplkevihvaduisf cown epi qfe feqievk etzmijuzjofeew).
Nro dodwuzoc odoz lce nozuamw ayfnuribnajiuy udqatw vmi zmlo utbyomaxxg tce nujjqaed ammacr — uv mrerd zura, cze welnijap ojiz gjef adhgepojhukain epctaoy. Flav ajwayk vea ba neko yiroocn aspxibibpajiihg unp ecihqiwe uz ol puof mbxix od waovew, vukk ruhu dimx uvhamufoddo.
Generics and Protocols
Protocols also integrate nicely with generics in Swift. With protocol extensions, you can remove the duplicated code for getDescription(). However, there’s even more room for improvement. Each type of media collection is going to be pretty similar, with the only real difference being the associated type.
Eyilx jidipizg uxuxt xerr yzitomoss aymimx teu ti zbiqi u vehsyi oxggiwefxukoih uc CemuoGepzuycouf ljuf rid ra inal yiz osf hzbu ec soxuo.
See forum comments
This content was released on Oct 17 2023. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
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.