Minor Bugs and How to Fix it Swift Part I

Photo by Ritchie Valens on Unsplash

1. ErrorCode: Type ‘yourEnum’ has no member ‘allCases’

Source: Author
// Error Codeenum ListSection: Int {
case registered = 0
case login = 1
case biometric = 2
}
print(ListSection.allCases.count) // error here// Solutionenum ListSection: Int, CaseIterable {
case registered = 0
case login = 1
case biomatric = 2
}
print(ListSection.allCases.count) // 3

2. initializer without initializing all stored properties

Source: Author
Source: Author

3. Error: validation failed: Couldn’t parse property list because the input data was in an invalid format

Source: Author
Source: Author
Source: Author

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store