0
var imageView = UIImageView.self
let locationManager = CLLocationManager()
let region = CLBeaconRegion(proximityUUID: UUID(uuidString: "B9407F30-F5F8-466E-AFF9-25556B57FE6D")!, identifier: "Estimotes")
let images = [
53219: UIImage(named:"White Glyph 2"),
59317: UIImage(named:"White Glyph 3"),
17068: UIImage(named:"White Glyph 4")
]
func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) {
let knownBeacons = beacons.filter{ $0.proximity != CLProximity.unknown }
if (knownBeacons.count > 0) {
let closestBeacon = knownBeacons[0] as CLBeacon
self.imageView.image = self.images[closestBeacon.minor.intValue] // error gets thrown on this line
}
}
どうすればこのエラーを修正できますか?このコードは機能するのでしょうか、間違った方向に向いていますか?インスタンスメンバー 'image'は 'UIImageView'タイプでは使用できません
var imageView = UIImageView()またはstoryboardまたはxibからのIBOutlet、変数 'var imageView = UIImageView.self'はUIImageViewではありません。オブジェクトはUIImageViewがクラスであるためです。 –