Я попытался написать приложение для конфигурации моего проекта в помещении с маяками, скопировал код с estimote.com и у меня возникли ошибки.
import UIKit
class ViewController: UIViewController, EILIndoorLocationManagerDelegate {
let locationManager = EILIndoorLocationManager()
override func viewDidLoad() {
super.viewDidLoad()
// 3. Set the location manager's delegate
self.locationManager.delegate = self
func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}}
let locationBuilder = EILLocationBuilder()
locationBuilder.setLocationName("office") //error-expected declaration
locationBuilder.setLocationBoundaryPoints([
EILPoint(x: 0.00, y: 0.00),
EILPoint(x: 0.00, y: 4.00),
EILPoint(x: 4.48, y: 4.00),
EILPoint(x: 4.48, y: 0.00)])
locationBuilder.addBeaconWithIdentifier("395b8767bd63efc0fff23894fa05cb0b", //Expected declaration - error
atBoundarySegmentIndex: 0, inDistance: 4.46, fromSide: .LeftSide)
locationBuilder.addBeaconWithIdentifier("4bb0675d47649d4273a9bb963ea9dd13",
atBoundarySegmentIndex: 1, inDistance: 0.38, fromSide: .RightSide)
locationBuilder.addBeaconWithIdentifier("739cd8034732d5349f15c33c625c9f05",
atBoundarySegmentIndex: 2, inDistance: 4.46, fromSide: .LeftSide)
locationBuilder.addBeaconWithIdentifier("a823daa6f67076543143752b57514507",
atBoundarySegmentIndex: 3, inDistance: 0.43, fromSide: .RightSide)
locationBuilder.setLocationOrientation(270)
let location = LocationBuilder.build()
ESTConfig.setupAppID("<configuration-3rj>", andAppToken: "<668f7c994b82b07e902ccf4a3d7d88ba>")
let addLocationRequest = EILRequestAddLocation(location: location) //Cannot use instance member 'location' within property initializer; //property initializers run before 'self' is available - error
addLocationRequest.sendRequestWithCompletion { (location, error) in //Expected declaration -error
if error != nil {
NSLog("Error when saving location: \(error)")
} else {
NSLog("Location saved successfully: \(location.identifier)")
}
}
}