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