저는 옵서버를위한 새로운 구문을 이해하기 위해 정말로 애 쓰고 있습니다.스위프트에서 옵서버와 셀렉터 추가하기 3
당신은 나를 스위프트 3.
nc.addObserver(self, selector: #selector(MapViewController.locationUpdated(_:)), name: LocationNotification.kLocationUpdated, object: nil)
nc.addObserver(self, selector: #selector(MapViewController.locationAuthorizationStatusChanged(_:)), name: LocationNotification.kAuthorizationStatusChanged, object: nil)
nc.addObserver(self, selector: #selector(MapViewController.locationManagerDidFailWithError(_:)), name: LocationNotification.kLocationManagerDidFailWithError, object: nil)
에
많은 감사를이 번역 도울 수 있습니다! 자사의 경우 (
struct LocationNotification {
static let kLocationUpdated = Notification.Name(rawValue: "LocationUpdated")
static let kAuthorizationStatusChanged = Notification.Name(rawValue: "AuthorizationStatusChanged")
static let kLocationManagerDidFailWithError = Notification.Name(rawValue: "LocationManagerDidFailWithError")
}