I am not using the Estimote SDK but I am using the beacons.
I am trying to build a simple application with two view controllers. The first view controller has two fields. Field #1 allows the user to enter in the UUID. Field #2 allows the user to enter in the minor ID. I would like to pass the minor ID info into a CLBeaconRegion func. However I can not get the function to accept a var that I created. I receive a “Cannot assign value of type ‘String’ to type ‘CLBeaconMajorValue’ (aka ‘UInt16’)” when passing the user input from view controller#1 to view controller 2. Can someone look at my code below and let me know what I am missing?
view controller #1 code:
class beaconDetailsViewController: UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate {
@IBOutlet weak var beaconOne: UITextField!
@IBOutlet weak var beaconTwo: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let planVC = segue.destinationViewController as! PlanagramViewController
planVC.UUID = self.beaconOne.text!
planVC.major = self.beaconTwo.text!
}
}
view controller #2 code:
var major: CLBeaconMajorValue = UInt16(Int("")!)
var minor = 12344
var majorIDD = "12345"
var UUID = "B9407F30-F5F8-466E-AFF9-25556B57FE6D" // I need to change UUID to uUID
var identifierString = "Estimote"
let locationManager = CLLocationManager()
let image = [59502: UIImage(named: "Plan_P"),49397: UIImage(named: "Plan_M")]
override func viewDidLoad() {
super.viewDidLoad()
let region = CLBeaconRegion(proximityUUID: NSUUID(UUIDString: UUID)!, major: major, minor: 2, identifier: "identifierString")