-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[update] OP_RETURNをJSON化。detail viewリファクタリング
- Loading branch information
daiki.sekiguchi
committed
Aug 19, 2018
1 parent
ae7471a
commit 37b5520
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Vote.swift | ||
// SimpleWallet | ||
// | ||
// Created by Daiki Sekiguchi on 2018/08/19. | ||
// Copyright © 2018年 Akifumi Fujita. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct Vote: Codable { | ||
let hash: String | ||
let message: String | ||
|
||
func toJson() -> String { | ||
let encoder = JSONEncoder() | ||
let data = try! encoder.encode(self) | ||
let json: String = String(data: data, encoding: .utf8)! | ||
|
||
return json | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters