-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewController.swift
60 lines (47 loc) · 1.55 KB
/
ViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// ViewController.swift
// GetDibbs
//
// Created by Kevin McQuown on 9/12/15.
// Copyright © 2015 Kevin McQuown. All rights reserved.
//
import UIKit
class ViewController: UIViewController, PFLogInViewControllerDelegate {
var loginVC : PFLogInViewController!
var company : Company!
func logInViewController(logInController: PFLogInViewController, didLogInUser user: PFUser) {
loginVC.dismissViewControllerAnimated(true, completion: nil);
AUser.companyUniqueID { (value) -> Void in
IDBeacon.sharedInstance.start(value);
}
}
override func viewDidLoad() {
super.viewDidLoad()
// PFUser.logOut();
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated);
if PFUser.currentUser() == nil
{
loginVC = PFLogInViewController();
loginVC.delegate = self;
presentViewController(loginVC, animated: false, completion: nil);
}
else
{
AUser.companyUniqueID({ (value) -> Void in
IDBeacon.sharedInstance.start(value)
})
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func startAdvertisingTapped(sender: UIButton) {
IDBeacon.sharedInstance.startAdvertising()
}
@IBAction func stopAdvertising(sender: UIButton) {
IDBeacon.sharedInstance.stopAdvertising()
}
}