I had this error because I was doing this :
if(currentMeal?.State == .Deleted){
}
instead of
if(currentMeal!.State == .Deleted){
}
so I think optional not unwrapped in if condition can cause this error
More Related Contents:
- Precision String Format Specifier In Swift
- Catching NSException in Swift
- What is the difference between `let` and `var` in Swift?
- Swift 2 – UnsafeMutablePointer to object
- How to generate a random number in Swift without repeating the previous random number?
- How to set cell spacing and UICollectionView – UICollectionViewFlowLayout size ratio?
- How do I create a segue that can be called from a button that is created programmatically?
- Check if `Any` value is object
- Swift 3 first parameter names
- Providing a default value for an Optional in Swift?
- Swift variable name with ` (backtick)
- iterate over object class attributes in Swift
- Knowing where retain cycles are and removing them
- Swift – what’s the difference between metatype .Type and .self?
- How do I atomically increment a variable in Swift?
- How can I init a UIButton subclass?
- The “prefs” URL Scheme is not working in iOS 10 (Beta 1 & 2)
- Convert Swift Array to Dictionary with indexes [duplicate]
- Make tasks in Swift concurrency run serially
- Swift: failing to copy files to a newly created folder
- Conditionally use view in SwiftUI
- Swift – class method which must be overridden by subclass
- How to get the RGB Code (INT) from an UIColor in Swift [duplicate]
- Check if a string exists in an array case insensitively
- Swift nil has a numeric value?
- Displaying Artwork for .MP3 file
- Use queue and semaphore for concurrency and property wrapper?
- Highlight a specific part of the text in SwiftUI
- How to parse JSON with Decodable protocol when property types might change from Int to String? [duplicate]
- In Swift 4, how do I remove a block-based KVO observer?