Skip to content

Instantly share code, notes, and snippets.

@chaseacton
chaseacton / AppleWatchDetector.swift
Last active October 24, 2017 23:39
Detects if an Apple Watch is paired with the user's iPhone.
import WatchConnectivity
final class AppleWatchDetector: NSObject {
static let shared = AppleWatchDetector()
private let session: WCSession? = WCSession.isSupported() ? WCSession.default : nil
func detect() {
session?.delegate = self
session?.activate()