This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreBluetooth | |
let kServiceUUID = CBUUID(string: "0000a000-0000-1000-8000-00805f9b34fb") | |
let kCharacteristicUUID = CBUUID(string: "0000a001-0000-1000-8000-00805f9b34fb") | |
let centralManager = CBCentralManager(delegate: self, queue: nil) | |
var foundDevice: CBPeripheral? | |
public func centralManagerDidUpdateState(central: CBCentralManager) { | |
if centralManager.state == .PoweredOn { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CoreLocation | |
let beaconUUIDs = ["f7826da6-4fa2-4e98-8024-bc5b71e0893e"] | |
let locationManager = CLLocationManager() | |
locationManager.delegate = self | |
for uuid in beaconUUIDs { | |
let beaconRegion = CLBeaconRegion(proximityUUID: NSUUID(UUIDString:uuid)!, identifier: uuid) | |
manager.startMonitoringForRegion(beaconRegion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import UIKit.UIGestureRecognizerSubclass | |
class UIDoubleTapAndMoveGestureRecognizer : UIGestureRecognizer { | |
private var timer : NSTimer? | |
private var isFirstTapDetected = false | |
private var isDoubleTapDetected = false | |
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent) { |