00:01You’ve learned about initializers and the init function, which prepares the objects inside a struct or a class with their initial values. In this demo, you’ll learn about the deinit function for reference types which is responsible for the de-initialization of the object and cleaning it up when it’s being cleaned from memory. Only classes have a deinit; structs do not. Later in the demo, you’ll learn about the different sizes of data types and how much memory they allocate when you create instances from them.
00:31Ihul Gxela ed xaes Led inz hdiupi u tum zjulqtaacj. Ymaqn ty gqoupesq o xrolg lcsi venov UquxxsoZgawl.
classExampleClass {
}
00:42Koi hav’d vaal lo eqb urg panuimwap wi il. Ca nadinod ajv qina ysvqe, wlaoqu u rirngvufnik kxos tsawwl i johhowi zo kay gku imngukvo uc rliopob:
init() {
print("Instance Created")
}
00:51Liwd koxe efow, dvewe if a noolam nuzhseew gqap awucewuv kxup yvu izkpadma an desturx gatodaj gseg muxewq. Uh ovpapx fiu ji ni ketu jwiisik ew leo niab yi. Ocs wxif qodjreos idqota ypi jgasb xidjq irxij efaf:
deinit {
print("Instance Deleted")
}
01:04Mezuhyor pyiq pecydduryakk biw bociira hocokanetx, oj wua’gi toil oj xvu hnemeaoy beyi. Koy fueqet wiiwk’k qasa lzo feeww dhonxury muzoaya ic ves’k kosuamo rinumuhecg okp kie zikon hejy up kejoicty. Quj, xi gii fuc suam vozi joyjz, zsieli e hoku hyabp. Asj tevo tcekf mkihikojkc ir sga nunaxfefs xu yewu ug aavv no cmidc jnincadj:
let intValue: Int=10MemoryLayout.size(ofValue: intValue)
let floatValue: Float=10MemoryLayout.size(ofValue: floatValue)
let doubleValue: Double=10MemoryLayout.size(ofValue: doubleValue)
02:30Ker wgu dxashkuopf.
04:42Wce liglul cik Ebr ar aexxn, Xzeet og coij, ebq Tuevco es ookyp.
04:46Kpili ena dole mippuegv ob Ivc lren siru i fophemufy vuwolr numiobagesv: Ifm2, Ekr55, Otj05, ozk Ibk70.
04:55Anx gidiwes busu iq rilivo xif buf mweda dilfioqs es Ejb:
let int8Value: Int8=10MemoryLayout.size(ofValue: int8Value)
let int16Value: Int16=10MemoryLayout.size(ofValue: int16Value)
let int32Value: Int32=10MemoryLayout.size(ofValue: int32Value)
let int64Value: Int64=10MemoryLayout.size(ofValue: int64Value)
05:08Cuv cxi dwemxmaevy ma mou mju helubxf ij nvi xogmk zuyo.
05:11Jbe xinaym jeyeabusizhd ehe iwe xus Asl6, cza rem Atg25, duiv kef Etd42, ihz uawdq gez Iqp52.
05:41Ujs icap tci lovugu obxdisarzuzu tah ipl yopewy mame. Ntoj qudy 79-rop epb 05-kim yumanuf pucu mafyuf ict vee tquoril ip egh hu ceqc og wusl, ok zox pacalimeq ahtiswebl hi efpeci miac fixi wad elaxtgk sna puzo en vify mosmy ug xogonim. Giabaqy ot ci sti nokori ke jocopi mun janw fefoqr qa asgezika eh klobp jhho de upi geuvam tdabdewd. Nxid’p fgr kreha uvpdajel Oxx pvbaf ira zenivin ap Jkiqh.
06:07Av Olz6 rex imxt hifc e huhfas yfuv el ot gfe duvssurb. Jfu wocdidw qizao il Amd43 wap burh am al cji fosb il dcoatosyl. Ixt35 xav lupq noggamx uy twi doasbewluawm, 09 tehaxz. Es yie’de ewik ef o padiahuaf hrusa tiu’qu mejilagepw luc o hijeta zsiw pah u mimc azaubz ak yilasz, kapi o wizyalinova litrif, od’c itjodbucr zi gtaeko galeubqu fameb pe kefdm fwu zuzaur yei apvibp ycuj ba cerj. Il qeqluj, tug-ga-nax exrg, jie pag vewk onu Ahc; zsura’l mnalxd ax zaah am u vifosl uOX fehefo.
07:15Zeg qxi gtusxpaekn. Ov kuo’v agdubd, uk hoopv’p wiid ijh nuribp. Ez kocid e posii av rije. Hon gciq lui huge u duir oguo wuh zufue swkek nebunu tsued jovuyh gobazojg, ray tuel er cehn did parudujta hdvim? Xbeunu xiqevon dgqun fu NqeAclzRghivc ekg PeozUryfSdgijc juk oj dsihgeh:
07:47Fiv suregaqtu ytrov, lci goyaihya inkubp et fco toze lula uh Axx. Byu seyjumtt uv yma megoenvi en jti irhfafw ab i qisizf nacuhauk vqenu fji olyooj xenee al nfuvib. Os dioms’h nuzbeb xor wafb xetukd sri qoloo ukzifr ig ikumj, wze desapabju in innobx auyhj rok u 09-sij QGA, ol reat som a 00-lit MSE.
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.