Skip to content

Instantly share code, notes, and snippets.

@RuiAAPeres RuiAAPeres/foo.swift
Created Apr 15, 2017

Embed
What would you like to do?
struct MyModelDTO {
let property1: Type1
let property2: Type2
}
extension MyModelDTO {
init(model: MyModel_CoreData) {
self.init(property1: model.property1, property2: model.property2)
}
}
class MyModel_CoreData: NSManagedObject {
@NSManaged var property1: Type1
@NSManaged var property2: Type2
}
@Czajnikowski

This comment has been minimized.

Copy link

commented Jun 25, 2019

Hi @RuiAAPeres, what's the meaning behind a DTO suffix?

@RuiAAPeres

This comment has been minimized.

Copy link
Owner Author

commented Jun 25, 2019

DTO means Data Transfer Object (as you probably know). I use the suffix when in situations where the naming of the entity is not entirely clear that it's just a dumb struct carrying data.

@Czajnikowski

This comment has been minimized.

Copy link

commented Jun 25, 2019

Makes sense 👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.