[Solved] Return from initializer without initializing all stored properties error

[ad_1]

The error says you returned from init without initializing all stored properties. That’s what the problem is. You need to initialize Type and OperatingSystem in init:

init () {
    DeviceID = 1233
    Type = .Phone
    Operating_System = OperatingSystem(type: .iOS, version: OperatingSystemVersion(Major: 9, Minor: 0, Patch: 2))
    UserID = 2
    Description = "took"
    InventoryNR = "no17"
}

In the future, please read the error messages before posting.

4

[ad_2]

solved Return from initializer without initializing all stored properties error