Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftproperty wrappersSingle-choice MCQ

Given a property wrapper with both `init()` and `init(wrappedValue:)`, what does `@Logged var x: Int` (no initial value) use?

@propertyWrapper struct Logged { var wrappedValue: Int init() { wrappedValue = -1 } init(wrappedValue: Int) { self.wrappedValue = wrappedValue } } struct M { @Logged var x: Int } print(M().x)