 //
-//  WatchConnector.swift
+//  WatchSession.swift
 //  ZamzamKit
 //
 //  Created by Basem Emara on 3/13/17.


public class WatchSession: NSObject, WCSessionDelegate {

    /// Returns the singleton session object for the current device.
    fileprivate var sessionDefault: WCSession? {
        guard WCSession.isSupported() else { return nil }
        
        let session = WCSession.default()
        
        if session.delegate?.isEqual(self) != true {
            session.delegate = self
        }
        
        if session.activationState != .activated {
            session.activate()
        }
        
        return session
    }
    
    deinit {

    
    /// Subscription queues for firing within delegates
    fileprivate var activationDidCompleteSingle = SynchronizedArray<ActivationHandler>()
    public var didBecomeInactive = SynchronizedArray<EmptyObserver>()
    public var didDeactivate = SynchronizedArray<EmptyObserver>()
    public var stateDidChange = SynchronizedArray<EmptyObserver>()
    public var reachabilityDidChange = SynchronizedArray<ReachabilityChangeObserver>()
    public var didReceiveApplicationContext = SynchronizedArray<DictionaryObserver>()
    public var didReceiveUserInfo = SynchronizedArray<DictionaryObserver>()
    public var didReceiveMessage = SynchronizedArray<DidReceiveMessageObserver>()
}

// MARK: - Nested types
