Tusker/Tusker/View Controllers/PreferencesTableViewControl...

41 lines
1.2 KiB
Swift

//
// PreferencesTableViewController.swift
// Tusker
//
// Created by Shadowfacts on 8/28/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import UIKit
class PreferencesTableViewController: UITableViewController {
static func create() -> UIViewController {
guard let navigationController = UIStoryboard(name: "Preferences", bundle: nil).instantiateInitialViewController() as? UINavigationController else { fatalError() }
return navigationController
}
@IBOutlet weak var showRepliesInProfilesSwitch: UISwitch!
override func viewDidLoad() {
super.viewDidLoad()
showRepliesInProfilesSwitch.setOn(Preferences.shared.showRepliesInProfiles, animated: false)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
@IBAction func showRepliesInProfilesChanged(_ sender: Any) {
Preferences.shared.showRepliesInProfiles = showRepliesInProfilesSwitch.isOn
}
}