Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add secondary reset confirmation alert #799

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Vocable/Features/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
// SettingsViewController.swift
// Vocable AAC
//
// Created by Jesse Morgan on 2/6/20.
// Copyright © 2020 WillowTree. All rights reserved.
//

import UIKit
import MessageUI

Expand Down Expand Up @@ -393,6 +385,20 @@ final class SettingsViewController: VocableCollectionViewController, MFMailCompo

let alertViewController = GazeableAlertViewController(alertTitle: alertString)

alertViewController.addAction(GazeableAlertAction(title: cancelTitle))
alertViewController.addAction(GazeableAlertAction(title: confirmationTitle, style: .destructive, handler: { [weak self] in
self?.presentSecondaryResetConfirmationAlert()
}))
present(alertViewController, animated: true)
}

private func presentSecondaryResetConfirmationAlert() {
let alertString = String(localized: "settings.alert.secondary_reset_app_settings_confirmation.body")
let cancelTitle = String(localized: "settings.alert.secondary_reset_app_settings_confirmation.button.cancel.title")
let confirmationTitle = String(localized: "settings.alert.secondary_reset_app_settings_confirmation.button.confirm.title")

let alertViewController = GazeableAlertViewController(alertTitle: alertString)

alertViewController.addAction(GazeableAlertAction(title: cancelTitle))
alertViewController.addAction(GazeableAlertAction(title: confirmationTitle, style: .destructive, handler: { [weak self] in

Expand Down