 
 
 class TableViewController: UITableViewController, ClinkDelegate {
-    let clink = Clink.shared
-    
     override func viewDidLoad() {
         super.viewDidLoad()
         

        Clink.shared.logLevel = .verbose
        
        var count = 0
        Timer.scheduledTimer(withTimeInterval: 3, repeats: true) { timer in
            count += 1
            Clink.shared.updateLocalPeerData(["count": "\(count)"])
        }
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(startScanning))

    }
    
    func clink(_ clink: Clink, didUpdateDataForPeer peer: ClinkPeer) {
        print("did update peer data \(peer.data)")
        
        if let sendTime = peer.data["sentAt"] as? TimeInterval {
            let transferTime = Date().timeIntervalSince1970 - sendTime
            
            print("after \(transferTime) seconds")
        }
    }
    
    func clink(_ clink: Clink, didCatchError error: Error) {
