Choosing between structures and classes in Swift

We can always choose structures by default for our data model. We can also use structures along with protocols to adopt behaviour by sharing implementation. Classes are preferred if we need objective-c interoperability. They are also preferred if we need more control over the data model entity we define through our Class.

Leave a Reply

%d bloggers like this: