Skip to content

Commit

Permalink
init from json
Browse files Browse the repository at this point in the history
  • Loading branch information
s2mr committed Aug 19, 2018
1 parent 1d04baf commit b9216aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SimpleWallet/Modules/Models/Vote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ struct Vote: Codable {
}
}

extension Vote {
init(from data: Data) {
self = try! JSONDecoder().decode(Vote.self, from: data)
}
}

0 comments on commit b9216aa

Please sign in to comment.