2019-05-16 17:45:38 -05:00
|
|
|
//
|
|
|
|
// AddAccountViewController.swift
|
|
|
|
// NetNewsWire-iOS
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 5/16/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2019-05-19 16:52:21 -05:00
|
|
|
import Account
|
2019-05-16 17:45:38 -05:00
|
|
|
import UIKit
|
|
|
|
|
2019-05-19 18:04:32 -05:00
|
|
|
protocol AddAccountDismissDelegate: UIViewController {
|
2019-06-03 05:04:03 -05:00
|
|
|
func dismiss()
|
2019-05-19 18:04:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
class AddAccountViewController: UITableViewController, AddAccountDismissDelegate {
|
2019-05-16 17:45:38 -05:00
|
|
|
|
2019-05-19 16:52:21 -05:00
|
|
|
@IBOutlet private weak var localAccountNameLabel: UILabel!
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
super.viewDidLoad()
|
|
|
|
|
|
|
|
localAccountNameLabel.text = Account.defaultLocalAccountName
|
|
|
|
}
|
|
|
|
|
2019-05-19 14:18:11 -05:00
|
|
|
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
|
|
switch indexPath.row {
|
|
|
|
case 0:
|
2019-05-24 10:07:17 -05:00
|
|
|
let navController = UIStoryboard.settings.instantiateViewController(withIdentifier: "AddLocalAccountNavigationViewController") as! UINavigationController
|
2019-06-03 05:13:55 -05:00
|
|
|
navController.modalPresentationStyle = .currentContext
|
2019-05-24 10:07:17 -05:00
|
|
|
let addViewController = navController.topViewController as! AddLocalAccountViewController
|
2019-05-19 18:04:32 -05:00
|
|
|
addViewController.delegate = self
|
2019-05-24 10:07:17 -05:00
|
|
|
present(navController, animated: true)
|
2019-05-19 18:04:32 -05:00
|
|
|
case 1:
|
2019-05-24 10:07:17 -05:00
|
|
|
let navController = UIStoryboard.settings.instantiateViewController(withIdentifier: "FeedbinAccountNavigationViewController") as! UINavigationController
|
2019-06-03 05:13:55 -05:00
|
|
|
navController.modalPresentationStyle = .currentContext
|
2019-05-24 10:07:17 -05:00
|
|
|
let addViewController = navController.topViewController as! FeedbinAccountViewController
|
2019-05-19 18:04:32 -05:00
|
|
|
addViewController.delegate = self
|
2019-05-24 10:07:17 -05:00
|
|
|
present(navController, animated: true)
|
2019-05-19 14:18:11 -05:00
|
|
|
default:
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-03 05:04:03 -05:00
|
|
|
func dismiss() {
|
2019-06-03 04:22:58 -05:00
|
|
|
navigationController?.popViewController(animated: false)
|
2019-05-19 18:04:32 -05:00
|
|
|
}
|
|
|
|
|
2019-05-16 17:45:38 -05:00
|
|
|
}
|