I have a view which goes to my Store, gets data from an API and bringing back to the view.
var productId = 123
@ObservedObject var productStore = ProductStore()
init() {
productStore.getById(productId: self.productid)
}
The object from ProductStore is coming back but when I try to use it:
Text(self.productStore.product!.title)
I get: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Why this is happening if the object doesnt have nil values ?