0

Hi guys i need send this variable "minorBeacon" to another ViewController, how i can do ?

   func locationManager(manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], inRegion region: CLBeaconRegion)


{
    if let beacon = beacons.first {
    var minorBeacon = beacon.minor.intValue

       print(minorBeacon)
       print(region)


    for beacon in beacons{
            if beacon.accuracy > 0{
        metrosBeacon.text = "El beacon identificado como  \(region.identifier) está en \(beacon.accuracy)m "

            if region.identifier == "MKT BEACON 28"{
                    linkBeacon.text = "Hace click acá para ver la oferta de MKT BEACON 28"
            if region.identifier == "MKT BEACON 26"{
                    linkBeacon.text = "Hace click acá para ver la oferta de MKT BEACON 26"

            if (beacon.accuracy) == -1.0{
        metrosBeacon.text = "❌Fuera de cobertura de señal de Beacons ❌"
        }

thanks!!

aloparz
  • 13
  • 3

1 Answers1

0

If you are wanting to pass the information to a new view controller as you segue to it then you need to look into overriding the prepareForSegue method. If you want to make the value generally available throughout your app then have a look at NSUserDefaults. One or the other should suit your purpose.

Westside
  • 675
  • 1
  • 7
  • 16