[英]If we declare structure with all optional values, what is the size of the structure in swift?
例如,我创建了一个具有所有可选值的结构。 那么,结构的大小是多少。 我们如何快速计算结构的大小?
您可以使用此代码。
struct Structure {
//Some properties here
}
let size = MemoryLayout<Structure>.size
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.