Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
[ad_1]
For instance that I’ve this pretty minimal implementation of customized configuration and content material view in my app:
struct ExampleContentConfiguration {
let title: String
let rating: Int
}
extension ExampleContentConfiguration: UIContentConfiguration {
func makeContentView() -> UIView & UIContentView {
return ExampleContentView(configuration: self) // [1]
}
func up to date(for state: UIConfigurationState) -> ExampleContentConfiguration {
return self
}
}
remaining class ExampleContentView: UIView, UIContentView {
var configuration: UIContentConfiguration // [2]
init(configuration: ExampleContentConfiguration) {
self.configuration = configuration
tremendous.init(body: .zero)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been carried out")
}
}
The 2 protocols that underlie this haven’t any concurrency annotations. Alternatively, UIView
(and its subclasses) are marked as @MainActor
. So once I set the Strict Concurrency Checking construct setting to Full, Xcode studies two points on the marked strains:
(Confusingly, if I have a look at the generated interface for UIListContentView
, its configuration
property has a @MainActor
attribute.)
What am I lacking right here? How may these varieties implement these protocols whereas adhering to the strict concurrency guidelines?
[ad_2]