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 {
|
|
|
|
func dismiss()
|
|
|
|
}
|
|
|
|
|
|
|
|
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) {
|
2019-05-23 04:17:50 +02:00
|
|
|
let storyboard = UIStoryboard.settings
|
2019-05-19 21:18:11 +02:00
|
|
|
switch indexPath.row {
|
|
|
|
case 0:
|
2019-05-23 04:17:50 +02:00
|
|
|
let addViewController = storyboard.instantiateViewController(withIdentifier: "AddLocalAccountViewController") as! AddLocalAccountViewController
|
2019-05-20 01:04:32 +02:00
|
|
|
addViewController.delegate = self
|
2019-05-23 03:29:00 +02:00
|
|
|
navigationController?.pushViewController(addViewController, animated: true)
|
2019-05-20 01:04:32 +02:00
|
|
|
case 1:
|
2019-05-23 04:17:50 +02:00
|
|
|
let addViewController = storyboard.instantiateViewController(withIdentifier: "FeedbinAccountViewController") as! FeedbinAccountViewController
|
2019-05-20 01:04:32 +02:00
|
|
|
addViewController.delegate = self
|
2019-05-23 03:29:00 +02:00
|
|
|
navigationController?.pushViewController(addViewController, animated: true)
|
2019-05-19 21:18:11 +02:00
|
|
|
default:
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-20 01:04:32 +02:00
|
|
|
func dismiss() {
|
2019-05-23 03:29:00 +02:00
|
|
|
navigationController?.popToRootViewController(animated: true)
|
2019-05-20 01:04:32 +02:00
|
|
|
}
|
|
|
|
|
2019-05-17 00:45:38 +02:00
|
|
|
}
|