You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
//
|
|
// SettingsTableViewController.swift
|
|
// elpha-ios
|
|
//
|
|
// Created by Dwayne Harris on 11/12/18.
|
|
// Copyright © 2018 Elpha. All rights reserved.
|
|
//
|
|
|
|
import AlamofireImage
|
|
import FLAnimatedImage
|
|
import UIKit
|
|
|
|
class SettingsTableViewController: UITableViewController {
|
|
@IBOutlet var headerImageView: UIImageView!
|
|
@IBOutlet var avatarImageView: FLAnimatedImageView!
|
|
@IBOutlet var displayNameLabel: UILabel!
|
|
@IBOutlet var usernameLabel: UILabel!
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
navigationItem.title = "Settings"
|
|
|
|
avatarImageView.layer.cornerRadius = 10
|
|
avatarImageView.layer.masksToBounds = true
|
|
|
|
if let account = AuthenticationManager.session?.account {
|
|
headerImageView.af_setImage(withURL: account.headerURL!)
|
|
avatarImageView.setImage(withURL: account.avatarURL!, withShadow: true)
|
|
displayNameLabel.text = account.displayName
|
|
usernameLabel.text = "@\(account.acct!)"
|
|
}
|
|
}
|
|
|
|
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
switch indexPath.row {
|
|
case 1:
|
|
let storyboard = UIStoryboard(name: "Main", bundle: nil)
|
|
|
|
if let controller = storyboard.instantiateViewController(withIdentifier: "InstancesNavigationController") as? InstancesNavigationController {
|
|
self.parent?.present(controller, animated: true)
|
|
}
|
|
default:
|
|
return
|
|
}
|
|
}
|
|
}
|