mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add keyboard shortcuts for Add Feed and Add Folder
This commit is contained in:
@@ -33,6 +33,7 @@ class AddContainerViewController: UIViewController {
|
||||
|
||||
private var currentViewController: AddContainerViewControllerChild?
|
||||
|
||||
var initialControllerType: AddControllerType?
|
||||
var initialFeed: String?
|
||||
var initialFeedName: String?
|
||||
|
||||
@@ -40,20 +41,26 @@ class AddContainerViewController: UIViewController {
|
||||
|
||||
super.viewDidLoad()
|
||||
activityIndicatorView.isHidden = true
|
||||
|
||||
switchToFeed()
|
||||
|
||||
typeSelectorSegmentedControl.selectedSegmentIndex = initialControllerType?.rawValue ?? 0
|
||||
switch initialControllerType {
|
||||
case .feed:
|
||||
switchToFeed()
|
||||
case .folder:
|
||||
switchToFolder()
|
||||
default:
|
||||
assertionFailure()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@IBAction func typeSelectorChanged(_ sender: UISegmentedControl) {
|
||||
|
||||
switch sender.selectedSegmentIndex {
|
||||
case 0:
|
||||
switchToFeed()
|
||||
default:
|
||||
switchToFolder()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@IBAction func cancel(_ sender: Any) {
|
||||
14
iOS/Add/AddControllerType.swift
Normal file
14
iOS/Add/AddControllerType.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// AddControllerType.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 9/5/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum AddControllerType: Int {
|
||||
case feed = 0
|
||||
case folder = 1
|
||||
}
|
||||
@@ -44,6 +44,7 @@ class AddFeedViewController: UITableViewController, AddContainerViewControllerCh
|
||||
urlTextField.autocapitalizationType = .none
|
||||
urlTextField.text = initialFeed
|
||||
urlTextField.delegate = self
|
||||
urlTextField.becomeFirstResponder()
|
||||
|
||||
if initialFeed != nil {
|
||||
delegate?.readyToAdd(state: true)
|
||||
@@ -31,6 +31,8 @@ class AddFolderViewController: UITableViewController, AddContainerViewController
|
||||
accounts = AccountManager.shared.sortedActiveAccounts
|
||||
|
||||
nameTextField.delegate = self
|
||||
nameTextField.becomeFirstResponder()
|
||||
|
||||
accountLabel.text = (accounts[0] as DisplayNameProvider).nameForDisplay
|
||||
|
||||
if shouldDisplayPicker {
|
||||
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// AddView.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 6/17/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct AddView : View {
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello World!"/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct AddView_Previews : PreviewProvider {
|
||||
static var previews: some View {
|
||||
AddView()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user