|
|
@ -33,11 +33,14 @@ class SettingsViewController: FormViewController { |
|
|
|
override func viewDidLoad() { |
|
|
|
override func viewDidLoad() { |
|
|
|
super.viewDidLoad() |
|
|
|
super.viewDidLoad() |
|
|
|
|
|
|
|
|
|
|
|
title = "Settings" |
|
|
|
title = NSLocalizedString("Settings.Title", value: "Settings", comment: "") |
|
|
|
|
|
|
|
|
|
|
|
form = Section(header:"Export", footer: "Keep it secure and never share it with anyone.") |
|
|
|
form = Section( |
|
|
|
|
|
|
|
header: NSLocalizedString("Settings.Export", value: "Export", comment: ""), |
|
|
|
|
|
|
|
footer: NSLocalizedString("Settings.KeepItSecure", value: "Keep it secure and never share it with anyone.", comment: "") |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
<<< AppFormAppearance.button("Export Private Key") { |
|
|
|
<<< AppFormAppearance.button(NSLocalizedString("Settings.ExportPrivateKey", value: "Export Private Key", comment: "")) { |
|
|
|
$0.title = $0.tag |
|
|
|
$0.title = $0.tag |
|
|
|
}.onCellSelection { [unowned self] (_, _) in |
|
|
|
}.onCellSelection { [unowned self] (_, _) in |
|
|
|
self.run(action: .exportPrivateKey) |
|
|
|
self.run(action: .exportPrivateKey) |
|
|
@ -48,7 +51,7 @@ class SettingsViewController: FormViewController { |
|
|
|
+++ Section() |
|
|
|
+++ Section() |
|
|
|
|
|
|
|
|
|
|
|
<<< PushRow<String> { |
|
|
|
<<< PushRow<String> { |
|
|
|
$0.title = "RPC Server" |
|
|
|
$0.title = NSLocalizedString("Settings.RPCServer", value: "RPC Server", comment: "") |
|
|
|
$0.options = [ |
|
|
|
$0.options = [ |
|
|
|
RPCServer.main.name, |
|
|
|
RPCServer.main.name, |
|
|
|
RPCServer.ropsten.name, |
|
|
|
RPCServer.ropsten.name, |
|
|
@ -65,10 +68,10 @@ class SettingsViewController: FormViewController { |
|
|
|
cell.imageView?.image = R.image.settings_server() |
|
|
|
cell.imageView?.image = R.image.settings_server() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
+++ Section("Security") |
|
|
|
+++ Section(NSLocalizedString("Settings.Security", value: "Security", comment: "")) |
|
|
|
|
|
|
|
|
|
|
|
<<< SwitchRow { |
|
|
|
<<< SwitchRow { |
|
|
|
$0.title = "Passcode / Touch ID" |
|
|
|
$0.title = NSLocalizedString("Settings.Biometrics", value: "Passcode / Biometrics", comment: "") |
|
|
|
$0.value = self.isPasscodeEnabled |
|
|
|
$0.value = self.isPasscodeEnabled |
|
|
|
}.onChange { [unowned self] row in |
|
|
|
}.onChange { [unowned self] row in |
|
|
|
if row.value == true { |
|
|
|
if row.value == true { |
|
|
@ -85,21 +88,21 @@ class SettingsViewController: FormViewController { |
|
|
|
cell.imageView?.image = R.image.settings_lock() |
|
|
|
cell.imageView?.image = R.image.settings_lock() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
+++ Section("Open source development") |
|
|
|
+++ Section(NSLocalizedString("Settings.OpenSourceDevelopment", value: "Open Source Development", comment: "")) |
|
|
|
|
|
|
|
|
|
|
|
<<< link( |
|
|
|
<<< link( |
|
|
|
title: "Source Code", |
|
|
|
title: NSLocalizedString("Settings.SourceCode", value: "Source Code", comment: ""), |
|
|
|
value: "https://github.com/TrustWallet/trust-wallet-ios", |
|
|
|
value: "https://github.com/TrustWallet/trust-wallet-ios", |
|
|
|
image: R.image.settings_open_source() |
|
|
|
image: R.image.settings_open_source() |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
<<< link( |
|
|
|
<<< link( |
|
|
|
title: "Report a Bug", |
|
|
|
title: NSLocalizedString("Settings.ReportABug", value: "Report a Bug", comment: ""), |
|
|
|
value: "https://github.com/TrustWallet/trust-wallet-ios/issues/new", |
|
|
|
value: "https://github.com/TrustWallet/trust-wallet-ios/issues/new", |
|
|
|
image: R.image.settings_bug() |
|
|
|
image: R.image.settings_bug() |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
+++ Section("Community") |
|
|
|
+++ Section(NSLocalizedString("Settings.Community", value: "Community", comment: "")) |
|
|
|
|
|
|
|
|
|
|
|
<<< link( |
|
|
|
<<< link( |
|
|
|
title: "Twitter", |
|
|
|
title: "Twitter", |
|
|
@ -113,14 +116,12 @@ class SettingsViewController: FormViewController { |
|
|
|
image: R.image.settings_telegram() |
|
|
|
image: R.image.settings_telegram() |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
+++ Section("Support") |
|
|
|
+++ Section(NSLocalizedString("Settings.Support", value: "Support", comment: "")) |
|
|
|
|
|
|
|
|
|
|
|
<<< AppFormAppearance.button { button in |
|
|
|
<<< AppFormAppearance.button { button in |
|
|
|
button.title = "Rate Us on App Store" |
|
|
|
button.title = NSLocalizedString("Settings.RateUsAppStore", value: "Rate Us on App Store", comment: "") |
|
|
|
}.onCellSelection { _ in |
|
|
|
}.onCellSelection { _ in |
|
|
|
if #available(iOS 10.3, *) { |
|
|
|
if #available(iOS 10.3, *) { SKStoreReviewController.requestReview() } else { |
|
|
|
SKStoreReviewController.requestReview() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
UIApplication.shared.openURL(URL(string:"itms-apps://itunes.apple.com/app/id1288339409")!) |
|
|
|
UIApplication.shared.openURL(URL(string:"itms-apps://itunes.apple.com/app/id1288339409")!) |
|
|
|
} |
|
|
|
} |
|
|
|
}.cellSetup { cell, _ in |
|
|
|
}.cellSetup { cell, _ in |
|
|
@ -128,7 +129,7 @@ class SettingsViewController: FormViewController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<<< AppFormAppearance.button { button in |
|
|
|
<<< AppFormAppearance.button { button in |
|
|
|
button.title = "Donate" |
|
|
|
button.title = NSLocalizedString("Settings.Donate", value: "Donate", comment: "") |
|
|
|
}.onCellSelection { [unowned self] _ in |
|
|
|
}.onCellSelection { [unowned self] _ in |
|
|
|
self.run(action: .donate(address: Values.donationAddress)) |
|
|
|
self.run(action: .donate(address: Values.donationAddress)) |
|
|
|
}.cellSetup { cell, _ in |
|
|
|
}.cellSetup { cell, _ in |
|
|
@ -138,7 +139,7 @@ class SettingsViewController: FormViewController { |
|
|
|
+++ Section() |
|
|
|
+++ Section() |
|
|
|
|
|
|
|
|
|
|
|
<<< TextRow { |
|
|
|
<<< TextRow { |
|
|
|
$0.title = "Version" |
|
|
|
$0.title = NSLocalizedString("Settings.Version", value: "Version", comment: "") |
|
|
|
$0.value = version() |
|
|
|
$0.value = version() |
|
|
|
$0.disabled = true |
|
|
|
$0.disabled = true |
|
|
|
} |
|
|
|
} |
|
|
|