-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from vergecurrency/add-disconnect-view
Add disconnect wallet view and refactor pin unlock view closing 😇
- Loading branch information
Showing
15 changed files
with
198 additions
and
14 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
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
15 changes: 15 additions & 0 deletions
15
VergeiOS/Assets.xcassets/Placeholders/DisconnectWalletPlaceholder.imageset/Contents.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "disconnet-wallet.pdf" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"preserves-vector-representation" : true | ||
} | ||
} |
Binary file added
BIN
+7.51 KB
...OS/Assets.xcassets/Placeholders/DisconnectWalletPlaceholder.imageset/disconnet-wallet.pdf
Binary file not shown.
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
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
50 changes: 50 additions & 0 deletions
50
VergeiOS/Views/Settings/DisconnectWalletViewController.swift
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,50 @@ | ||
// | ||
// DisconnectWalletViewController.swift | ||
// VergeiOS | ||
// | ||
// Created by Swen van Zanten on 23-08-18. | ||
// Copyright © 2018 Verge Currency. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class DisconnectWalletViewController: UIViewController { | ||
|
||
@IBAction func disconnectWallet(_ sender: Any) { | ||
let alert = UIAlertController( | ||
title: "Disconnect Wallet", | ||
message: "Your about to disconnect this device from your current wallet. " + | ||
"Please make absolutely sure you have written down your paperkey. " + | ||
"Remember that your paperkey is the only way to restore your current wallet.", | ||
preferredStyle: .alert | ||
) | ||
|
||
let cancel = UIAlertAction(title: "Cancel", style: .cancel) | ||
let confirm = UIAlertAction(title: "Disconnect", style: .destructive) { action in | ||
// Show unlock view. | ||
let pinUnlockView = PinUnlockViewController.createFromStoryBoard() | ||
pinUnlockView.cancelable = true | ||
pinUnlockView.completion = { authenticated in | ||
if authenticated { | ||
pinUnlockView.dismiss(animated: true) { | ||
self.performSegue(withIdentifier: "disconnectWallet", sender: self) | ||
} | ||
|
||
// Reset wallet manager. | ||
WalletManager.default.reset() | ||
PriceTicker.shared.stop() | ||
} else { | ||
pinUnlockView.dismiss(animated: true) | ||
} | ||
} | ||
|
||
self.present(pinUnlockView, animated: true) | ||
} | ||
|
||
alert.addAction(cancel) | ||
alert.addAction(confirm) | ||
|
||
present(alert, animated: true) | ||
} | ||
|
||
} |
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
Oops, something went wrong.