Alternate approach to inheritance for Swift structs?

前端 未结 2 2165
悲哀的现实
悲哀的现实 2021-02-12 13:21

I\'m using structs instead of classes to store data in my iOS app because of the obvious advantage of value vs reference types. However, I\'m trying to figure out how to archite

2条回答
  •  自闭症患者
    2021-02-12 13:50

    There is a detailed answer at following Gist, with all possible approaches. I do not like any of them as I am fan of Classes. But structs are future of Swift, you have to understand, adopt and like :( it .

    Link: https://gist.github.com/AliSoftware/9e4946c8b6038572d678

提交回复
热议问题