I have the info(Uuid, Major, Minor) of two beacons in my DB, and I want to create two CLBeaconRegion but dynamically, because there is the possibility of adding more beacons and create more CLBeaconRegion, I have this code:
for i in 0 ... self.ArrayBeaconIDs.count-1 {
let beaconRegion = CLBeaconRegion(
proximityUUID: UUID(uuidString: self.ArrayBeaconIDs[i])!,
major: CLBeaconMajorValue(self.ArrayMajor[i])! ,minor:CLBeaconMajorValue(self.ArrayMinor[i])!
, identifier: "teuchlitlan"
)
self.ArrayRegiones.append(beaconRegion)
}
for i in 0 ... self.ArrayRegiones.count-1 {
self.ArrayRegiones[i].notifyEntryStateOnDisplay = true
self.ArrayRegiones[i].notifyOnEntry = true
self.ArrayRegiones[i].notifyOnExit = true
self.beaconManager.startMonitoring(for: self.ArrayRegiones[i])
self.beaconManager.startRangingBeacons(in: self.ArrayRegiones[i])
self.beaconManager.requestState(for: self.ArrayRegiones[i])
}
but only detect the last region in the Array, How can I solve it?