Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension Todo {
- // TodoEntity -> Todo
- init(entity: TodoEntity) throws {
- guard
- let title = entity.title
- else { throw EntityError.missingValueForKey("title") }
- guard
- let createdAtDate = entity.createdAtDate
- else { throw EntityError.missingValueForKey("createdAtDate") }
- self.init(
- title: title,
- createdAtDate: createdAtDate
- )
- }
- }
Add Comment
Please, Sign In to add comment