Change settings from using SwiftUI to using UIKit

This commit is contained in:
Maurice Parker
2019-10-21 11:51:33 -05:00
parent 94f31b18bc
commit effec24674
26 changed files with 1916 additions and 1198 deletions

View File

@@ -0,0 +1,48 @@
//
// AddLocalAccountViewController.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 5/19/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
import Account
class AddLocalAccountViewController: UIViewController {
@IBOutlet weak var cancelBarButtonItem: UIBarButtonItem!
@IBOutlet private weak var localAccountNameLabel: UILabel!
@IBOutlet weak var nameTextField: UITextField!
weak var delegate: AddAccountDismissDelegate?
override func viewDidLoad() {
super.viewDidLoad()
localAccountNameLabel.text = Account.defaultLocalAccountName
nameTextField.delegate = self
}
@IBAction func cancel(_ sender: Any) {
dismiss(animated: true, completion: nil)
delegate?.dismiss()
}
@IBAction func addAccountTapped(_ sender: Any) {
let account = AccountManager.shared.createAccount(type: .onMyMac)
account.name = nameTextField.text
dismiss(animated: true, completion: nil)
delegate?.dismiss()
}
}
extension AddLocalAccountViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
}