Tusker/Tusker/Screens/Preferences/AppearanceTableViewControll...

50 lines
1.6 KiB
Swift

//
// AppearanceTableViewController.swift
// Tusker
//
// Created by Shadowfacts on 10/2/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import UIKit
class AppearanceTableViewController: UITableViewController {
@IBOutlet weak var showRepliesInProfilesSwitch: UISwitch!
@IBOutlet weak var circularAvatarsSwitch: UISwitch!
@IBOutlet weak var hideCustomEmojiInUsernamesSwitch: UISwitch!
override func viewDidLoad() {
super.viewDidLoad()
showRepliesInProfilesSwitch.setOn(Preferences.shared.showRepliesInProfiles, animated: false)
circularAvatarsSwitch.setOn(Preferences.shared.avatarStyle == .circle, animated: false)
hideCustomEmojiInUsernamesSwitch.setOn(Preferences.shared.hideCustomEmojiInUsernames, 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.
}
*/
// MARK: - Interaction
@IBAction func showRepliesInProfilesChanged(_ sender: Any) {
Preferences.shared.showRepliesInProfiles = showRepliesInProfilesSwitch.isOn
}
@IBAction func circularAvatarsChanged(_ sender: Any) {
Preferences.shared.avatarStyle = circularAvatarsSwitch.isOn ? .circle : .roundRect
}
@IBAction func hideCustomEmojiInUsernamesChanged(_ sender: Any) {
Preferences.shared.hideCustomEmojiInUsernames = hideCustomEmojiInUsernamesSwitch.isOn
}
}