blob: 570d0f6e6b2389a6d836ffa48c9e1b446df2bde8 [file] [edit]
import Foundation
@objc protocol TestWeatherServiceDelegate: AnyObject {
@objc func didUpdateWeather(_ weather: String)
}
@objc class TestWeatherService: NSObject {
@objc static func fetchWeather(delegate: TestWeatherServiceDelegate) {
DispatchQueue.global().asyncAfter(deadline: .now() + 0.1) {
delegate.didUpdateWeather("Sunny, 25°C")
}
}
}