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,41 @@
//
// TimelineNumberOfLinesViewController.swift
// NetNewsWire-iOS
//
// Created by Maurice Parker on 4/29/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import UIKit
class TimelineNumberOfLinesViewController: UITableViewController {
override func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
cell.textLabel?.adjustsFontForContentSizeCategory = true
cell.textLabel?.text = "\(2 + indexPath.row)" + NSLocalizedString(" lines", comment: "Lines")
let numberOfLines = AppDefaults.timelineNumberOfLines
if indexPath.row + 2 == numberOfLines {
cell.accessoryType = .checkmark
} else {
cell.accessoryType = .none
}
return cell
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
AppDefaults.timelineNumberOfLines = indexPath.row + 2
self.navigationController?.popViewController(animated: true)
}
}