Initial project setup.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jeroen Leenarts
2018-05-23 21:49:10 +02:00
parent 5b6b71c6e8
commit ae73b78935
31 changed files with 1836 additions and 1 deletions
@@ -0,0 +1,38 @@
//
// ConnectionsTableViewController.swift
// Wireguard
//
// Created by Jeroen Leenarts on 23-05-18.
// Copyright © 2018 Wireguard. All rights reserved.
//
import UIKit
import CoreData
import BNRCoreDataStack
protocol ConnectionsTableViewControllerDelegate: class {
func addProvider(connectionsTableViewController: ConnectionsTableViewController)
func settings(connectionsTableViewController: ConnectionsTableViewController)
func connect(profile: Profile)
func delete(profile: Profile)
}
class ConnectionsTableViewController: UITableViewController {
weak var delegate: ConnectionsTableViewControllerDelegate?
var viewContext: NSManagedObjectContext!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
extension ConnectionsTableViewController: Identifyable {}
@@ -0,0 +1,27 @@
//
// Identifyable.swift
// Wireguard
//
// Created by Jeroen Leenarts on 23-05-18.
// Copyright © 2018 Wireguard. All rights reserved.
//
import Foundation
import UIKit
public protocol Identifyable: class {
static var identifier: String { get }
}
public extension Identifyable {
static var identifier: String {
return String(describing: Self.self)
}
}
extension UIStoryboard {
public func instantiateViewController<T: Identifyable>(type: T.Type) -> T where T: UIViewController {
return self.instantiateViewController(withIdentifier: type.identifier) as! T // swiftlint:disable:this force_cast
}
}