I have the following code. When it runs, it triggers the error : Cannot subscript a value of type '[String : Int]' with an index of type 'String?'
Can someone please help
self.books = self.books.filter { $0.completed[MUser.sharedInstance.getUserId()] ?? 0 > 0 }
completed is declared as
var completed = [String : Int]()