Swift2.3 code for Beacon detection

后端 未结 3 514
感情败类
感情败类 2020-12-15 15:00

We are in advanced stages of developing a Swift2.2 app and hence have decided to migrate to 2.3 in the interim and do the full Swift 3 migration later. However we are unable

3条回答
  •  不知归路
    2020-12-15 15:17

    Try constructing your location manager after the view loads. In other words, change:

    let locationManager = CLLocationManager()
    

    to

    let locationManager : CLLocationManager!
    

    And then add this to the viewDidLoad:

    locationManager = CLLocationManager()
    

    I have seen strange behavior with LocationManager constructed on initialization of a UIViewController.

提交回复
热议问题