Hello !, I’m doing with the method of sending proximity to different web pages depending on distance of the iBeacon . The problem is that whenever issues bluetooth signal reloads the page in case Immediate. This is a part of my code:
switch(proximity)
{
case .Far:
println("Far")
distance = "far"
// return distance
break;
case .Near:
println("Near")
distance = "Near"
// return distance
break;
case .Immediate:
println("Immediate")
distance = "Immediate"
webView.frame = CGRectMake(0, 0, view.frame.size.width, view.frame.size.height)
view.addSubview(webView)
let url = NSURL(string: "http:/website.com")
let request = NSURLRequest(URL:url!)
webView.loadRequest(request)
buttonWeb = UIBarButtonItem(title: "Done", style: .Plain, target: self, action: "finished")
navigationItem.setRightBarButtonItem(buttonWeb, animated: true)
var notification1 : UILocalNotification = UILocalNotification()
notification1.alertAction = "hello"
notification1.soundName = UILocalNotificationDefaultSoundName;
notification1.alertBody = "wellcome"
println("Usted esta entrando")
UIApplication.sharedApplication().presentLocalNotificationNow(notification1)
if(distance == "Immediate"){
var cont:uint = 0
cont += 1
sleep(cont);
}else{ return distance }
// return distance
break;